Prepend QBT_ for preprocessor variables

This commit is contained in:
Chocobo1
2017-03-03 16:42:13 +08:00
parent fc49856857
commit cb1646be32
13 changed files with 29 additions and 29 deletions

View File

@@ -47,7 +47,7 @@ public:
setAttribute(Qt::WA_DeleteOnClose);
// Title
lb_name->setText("<b><h2>qBittorrent " VERSION "</h2></b>");
lb_name->setText("<b><h2>qBittorrent " QBT_VERSION "</h2></b>");
// About
QString aboutText = QString(

View File

@@ -139,7 +139,7 @@ MainWindow::MainWindow(QWidget *parent)
Preferences *const pref = Preferences::instance();
m_uiLocked = pref->isUILocked();
setWindowTitle("qBittorrent " VERSION);
setWindowTitle("qBittorrent " QBT_VERSION);
m_displaySpeedInTitle = pref->speedInTitleBar();
// Setting icons
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
@@ -1332,7 +1332,7 @@ void MainWindow::updateGUI()
setWindowTitle(tr("[D: %1, U: %2] qBittorrent %3", "D = Download; U = Upload; %3 is qBittorrent version")
.arg(Utils::Misc::friendlyUnit(status.payloadDownloadRate(), true))
.arg(Utils::Misc::friendlyUnit(status.payloadUploadRate(), true))
.arg(VERSION));
.arg(QBT_VERSION));
}
}
@@ -1495,7 +1495,7 @@ void MainWindow::on_actionSpeedInTitleBar_triggered()
if (m_displaySpeedInTitle)
updateGUI();
else
setWindowTitle("qBittorrent " VERSION);
setWindowTitle("qBittorrent " QBT_VERSION);
}
void MainWindow::on_actionRSSReader_triggered()

View File

@@ -66,7 +66,7 @@ void ProgramUpdater::checkForUpdates()
RSS_URL, false, 0, false,
// Don't change this User-Agent. In case our updater goes haywire,
// the filehost can identify it and contact us.
QString("qBittorrent/%1 ProgramUpdater (www.qbittorrent.org)").arg(VERSION));
"qBittorrent/" QBT_VERSION " ProgramUpdater (www.qbittorrent.org)");
connect(handler, SIGNAL(downloadFinished(QString,QByteArray)), SLOT(rssDownloadFinished(QString,QByteArray)));
connect(handler, SIGNAL(downloadFailed(QString,QString)), SLOT(rssDownloadFailed(QString,QString)));
}
@@ -137,9 +137,9 @@ void ProgramUpdater::updateProgram()
bool ProgramUpdater::isVersionMoreRecent(const QString &remoteVersion) const
{
QRegExp regVer("([0-9.]+)");
if (regVer.indexIn(QString(VERSION)) >= 0) {
if (regVer.indexIn(QBT_VERSION) >= 0) {
QString localVersion = regVer.cap(1);
qDebug() << Q_FUNC_INFO << "local version:" << localVersion << "/" << VERSION;
qDebug() << Q_FUNC_INFO << "local version:" << localVersion << "/" << QBT_VERSION;
QStringList remoteParts = remoteVersion.split('.');
QStringList localParts = localVersion.split('.');
for (int i = 0; i<qMin(remoteParts.size(), localParts.size()); ++i) {
@@ -153,7 +153,7 @@ bool ProgramUpdater::isVersionMoreRecent(const QString &remoteVersion) const
return true;
// versions are equal, check if the local version is a development release, in which case it is older (2.9.2beta < 2.9.2)
QRegExp regDevel("(alpha|beta|rc)");
if (regDevel.indexIn(VERSION) >= 0)
if (regDevel.indexIn(QBT_VERSION) >= 0)
return true;
}
return false;