Skip to content

Commit

Permalink
Ability to set FV_APP_NAME / FV_APP_VERSION manually
Browse files Browse the repository at this point in the history
  • Loading branch information
pypt committed Aug 1, 2012
1 parent 6c9e034 commit cc0d9c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
25 changes: 17 additions & 8 deletions Fervor.pri
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
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/"
#CONFIG += qtestlib
#SOURCES += tests/fvversioncomparatortest.cpp
#HEADERS += tests/fvversioncomparatortest.h



DEPENDPATH += "$$PWD"
INCLUDEPATH += "$$PWD"

Expand Down
4 changes: 2 additions & 2 deletions fvupdatewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down

0 comments on commit cc0d9c3

Please sign in to comment.