mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
Using new QupZilla site: qupzilla.cc.co from now
This commit is contained in:
parent
3c8b08957a
commit
17f80f31b5
|
@ -37,6 +37,7 @@
|
||||||
#include "qtwin.h"
|
#include "qtwin.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "webhistoryinterface.h"
|
#include "webhistoryinterface.h"
|
||||||
|
#include "globalfunctions.h"
|
||||||
|
|
||||||
MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cmdActions, int &argc, char **argv)
|
MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cmdActions, int &argc, char **argv)
|
||||||
: QtSingleApplication("QupZillaWebBrowser", argc, argv)
|
: QtSingleApplication("QupZillaWebBrowser", argc, argv)
|
||||||
|
@ -646,16 +647,12 @@ bool MainApplication::checkSettingsDir()
|
||||||
QString homePath = QDir::homePath();
|
QString homePath = QDir::homePath();
|
||||||
homePath+="/.qupzilla/";
|
homePath+="/.qupzilla/";
|
||||||
|
|
||||||
QByteArray rData;
|
QString profileVersion;
|
||||||
if (QDir(homePath).exists()) {
|
if (QDir(homePath).exists()) {
|
||||||
QFile versionFile(homePath+"version");
|
profileVersion = qz_readAllFileContents(homePath + "version");
|
||||||
versionFile.open(QFile::ReadOnly);
|
|
||||||
rData = versionFile.readAll();
|
if (profileVersion == QupZilla::VERSION)
|
||||||
if (rData.contains(QupZilla::VERSION.toAscii())) {
|
|
||||||
versionFile.close();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
versionFile.close();
|
|
||||||
#ifdef UNRELEASED_BUILD
|
#ifdef UNRELEASED_BUILD
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
@ -668,30 +665,30 @@ bool MainApplication::checkSettingsDir()
|
||||||
dir.cd(".qupzilla");
|
dir.cd(".qupzilla");
|
||||||
|
|
||||||
//.qupzilla
|
//.qupzilla
|
||||||
QFile(homePath+"version").remove();
|
QFile(homePath + "version").remove();
|
||||||
QFile versionFile(homePath+"version");
|
QFile versionFile(homePath + "version");
|
||||||
versionFile.open(QFile::WriteOnly);
|
versionFile.open(QFile::WriteOnly);
|
||||||
versionFile.write(QupZilla::VERSION.toAscii());
|
versionFile.write(QupZilla::VERSION.toAscii());
|
||||||
versionFile.close();
|
versionFile.close();
|
||||||
|
|
||||||
if (rData.contains("1.0.0-b3")) // Data not changed from this version
|
if (Updater::parseVersionFromString(QupZilla::VERSION) >= Updater::parseVersionFromString("1.0.0-b3") ) // Data not changed from this version
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
dir.mkdir("profiles");
|
dir.mkdir("profiles");
|
||||||
dir.cd("profiles");
|
dir.cd("profiles");
|
||||||
|
|
||||||
//.qupzilla/profiles
|
//.qupzilla/profiles
|
||||||
QFile(homePath+"profiles/profiles.ini").remove();
|
QFile(homePath + "profiles/profiles.ini").remove();
|
||||||
QFile(DATADIR+"data/default/profiles/profiles.ini").copy(homePath+"profiles/profiles.ini");
|
QFile(DATADIR + "data/default/profiles/profiles.ini").copy(homePath + "profiles/profiles.ini");
|
||||||
|
|
||||||
dir.mkdir("default");
|
dir.mkdir("default");
|
||||||
dir.cd("default");
|
dir.cd("default");
|
||||||
|
|
||||||
//.qupzilla/profiles/default
|
//.qupzilla/profiles/default
|
||||||
QFile(homePath+"profiles/default/browsedata.db").remove();
|
QFile(homePath + "profiles/default/browsedata.db").remove();
|
||||||
QFile(DATADIR+"data/default/profiles/default/browsedata.db").copy(homePath+"profiles/default/browsedata.db");
|
QFile(DATADIR + "data/default/profiles/default/browsedata.db").copy(homePath + "profiles/default/browsedata.db");
|
||||||
QFile(homePath+"profiles/default/background.png").remove();
|
QFile(homePath + "profiles/default/background.png").remove();
|
||||||
QFile(DATADIR+"data/default/profiles/default/background.png").copy(homePath+"profiles/default/background.png");
|
QFile(DATADIR + "data/default/profiles/default/background.png").copy(homePath + "profiles/default/background.png");
|
||||||
|
|
||||||
return dir.isReadable();
|
return dir.isReadable();
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ const QString QupZilla::VERSION = "1.0.0-rc1";
|
||||||
const QString QupZilla::BUILDTIME = __DATE__" "__TIME__;
|
const QString QupZilla::BUILDTIME = __DATE__" "__TIME__;
|
||||||
const QString QupZilla::AUTHOR = "nowrep";
|
const QString QupZilla::AUTHOR = "nowrep";
|
||||||
const QString QupZilla::COPYRIGHT = "2010-2011";
|
const QString QupZilla::COPYRIGHT = "2010-2011";
|
||||||
const QString QupZilla::WWWADDRESS = "http://qupzilla.ic.cz";
|
const QString QupZilla::WWWADDRESS = "http://qupzilla.co.cc";
|
||||||
const QString QupZilla::WIKIADDRESS = "https://github.com/nowrep/QupZilla/wiki";
|
const QString QupZilla::WIKIADDRESS = "https://github.com/nowrep/QupZilla/wiki";
|
||||||
const QString QupZilla::WEBKITVERSION = qWebKitVersion();
|
const QString QupZilla::WEBKITVERSION = qWebKitVersion();
|
||||||
|
|
||||||
|
|
|
@ -31,14 +31,6 @@ public:
|
||||||
explicit Updater(QupZilla* mainClass, QObject* parent = 0);
|
explicit Updater(QupZilla* mainClass, QObject* parent = 0);
|
||||||
~Updater();
|
~Updater();
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void downCompleted(QNetworkReply* reply);
|
|
||||||
void start();
|
|
||||||
void downloadNewVersion();
|
|
||||||
|
|
||||||
private:
|
|
||||||
struct Version {
|
struct Version {
|
||||||
bool isValid;
|
bool isValid;
|
||||||
int majorVersion;
|
int majorVersion;
|
||||||
|
@ -67,11 +59,44 @@ private:
|
||||||
{
|
{
|
||||||
return !operator<(other);
|
return !operator<(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator==(const Version &other) const
|
||||||
|
{
|
||||||
|
if (!this->isValid || !other.isValid)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return (this->majorVersion == other.majorVersion &&
|
||||||
|
this->minorVersion == other.minorVersion &&
|
||||||
|
this->revisionNumber == other.revisionNumber &&
|
||||||
|
this->specialSymbol == other.specialSymbol);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator>=(const Version &other) const
|
||||||
|
{
|
||||||
|
if (*this == other)
|
||||||
|
return true;
|
||||||
|
return *this > other;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator<=(const Version &other) const
|
||||||
|
{
|
||||||
|
if (*this == other)
|
||||||
|
return true;
|
||||||
|
return *this < other;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Version parseVersionFromString(const QString &string);
|
static Version parseVersionFromString(const QString &string);
|
||||||
static bool isBiggerThan_SpecialSymbol(QString one, QString two);
|
static bool isBiggerThan_SpecialSymbol(QString one, QString two);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void downCompleted(QNetworkReply* reply);
|
||||||
|
void start();
|
||||||
|
void downloadNewVersion();
|
||||||
|
|
||||||
|
private:
|
||||||
void startDownloadingUpdateInfo(const QUrl &url);
|
void startDownloadingUpdateInfo(const QUrl &url);
|
||||||
|
|
||||||
QupZilla* p_QupZilla;
|
QupZilla* p_QupZilla;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user