diff --git a/Fervor.pri b/Fervor.pri index 8d6d9a2..58accc1 100644 --- a/Fervor.pri +++ b/Fervor.pri @@ -1,11 +1,22 @@ QT += core gui webkit network -DEFINES += FV_APP_NAME=\\\"$$TARGET\\\" -DEFINES += FV_APP_VERSION=\\\"$$VERSION\\\" - - - -# FIXME unit tests +isEmpty(FV_APP_NAME) { + warning("Fervor: falling back to application name '$$TARGET'") + DEFINES += FV_APP_NAME=\\\"$$TARGET\\\" +} else { + message("Fervor: building for application name '$$FV_APP_NAME'") + DEFINES += FV_APP_NAME=\\\"$$FV_APP_NAME\\\" +} + +isEmpty(FV_APP_VERSION) { + warning("Fervor: falling back to application version '$$VERSION'") + DEFINES += FV_APP_VERSION=\\\"$$VERSION\\\" +} else { + message("Fervor: building for application versione '$$FV_APP_VERSION'") + DEFINES += FV_APP_VERSION=\\\"$$FV_APP_VERSION\\\" +} + +# Unit tests #DEFINES += FV_DEBUG=1 #DEPENDPATH += "$$PWD/tests/" #INCLUDEPATH += "$$PWD/tests/" @@ -13,8 +24,6 @@ DEFINES += FV_APP_VERSION=\\\"$$VERSION\\\" #SOURCES += tests/fvversioncomparatortest.cpp #HEADERS += tests/fvversioncomparatortest.h - - DEPENDPATH += "$$PWD" INCLUDEPATH += "$$PWD" diff --git a/fvupdatewindow.cpp b/fvupdatewindow.cpp index 31a6306..d5cd55f 100644 --- a/fvupdatewindow.cpp +++ b/fvupdatewindow.cpp @@ -19,7 +19,7 @@ FvUpdateWindow::FvUpdateWindow(QWidget *parent) : setAttribute(Qt::WA_DeleteOnClose, true); // Set the "new version is available" string - QString newVersString = m_ui->newVersionIsAvailableLabel->text().arg(QApplication::applicationName()); + QString newVersString = m_ui->newVersionIsAvailableLabel->text().arg(QString::fromUtf8(FV_APP_NAME)); m_ui->newVersionIsAvailableLabel->setText(newVersString); // Connect buttons @@ -45,7 +45,7 @@ bool FvUpdateWindow::UpdateWindowWithCurrentProposedUpdate() } QString downloadString = m_ui->wouldYouLikeToDownloadLabel->text() - .arg(QApplication::applicationName(), proposedUpdate->GetEnclosureVersion(), QApplication::applicationVersion()); + .arg(QString::fromUtf8(FV_APP_NAME), proposedUpdate->GetEnclosureVersion(), QString::fromUtf8(FV_APP_VERSION)); m_ui->wouldYouLikeToDownloadLabel->setText(downloadString); m_ui->releaseNotesWebView->stop();