Skip to content

Commit

Permalink
Version setting cross-platform compromise
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmassay committed Jun 18, 2019
1 parent d555c6a commit 3dc899b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Expand Up @@ -141,7 +141,8 @@ set_property( SOURCE ${QRC_FILES_CPP} PROPERTY SKIP_AUTOMOC ON )
qt5_add_translation( QM_FILES ${TS_FILES} )

# Define the PageEdit version string for use in source files
set_source_files_properties( pageedit_constants.cpp PROPERTIES COMPILE_DEFINITIONS PAGEEDIT_FULL_VERSION="${PAGEEDIT_FULL_VERSION}" )
set_source_files_properties( Utility.cpp PROPERTIES COMPILE_DEFINITIONS PAGEEDIT_VERSION="${PAGEEDIT_FULL_VERSION}" )
set_source_files_properties( main.cpp PROPERTIES COMPILE_DEFINITIONS PAGEEDIT_VERSION="${PAGEEDIT_FULL_VERSION}" )

set( ALL_SOURCES ${SOURCE_FILES} ${HEADER_FILES} ${UI_FILES_H} ${QRC_FILES_CPP} ${QM_FILES} )

Expand Down
2 changes: 1 addition & 1 deletion Utility.cpp
Expand Up @@ -478,7 +478,7 @@ void Utility::DisplayExceptionErrorDialog(const QString &error_info)
message_box.setStandardButtons(QMessageBox::Close);
QStringList detailed_text;
detailed_text << "Error info: " + error_info
<< "PageEdit version: " + PAGEEDIT_VERSION
<< "PageEdit version: " + QString(PAGEEDIT_VERSION)
<< "Runtime Qt: " + QString(qVersion())
<< "Compiled Qt: " + QString(QT_VERSION_STR);
#if defined Q_OS_WIN32
Expand Down
2 changes: 1 addition & 1 deletion main.cpp
Expand Up @@ -113,7 +113,7 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationName("sigil-ebook");
QCoreApplication::setOrganizationDomain("sigil-ebook.com");
QCoreApplication::setApplicationName("pageedit");
QCoreApplication::setApplicationVersion(PAGEEDIT_VERSION);
QCoreApplication::setApplicationVersion(QString(PAGEEDIT_VERSION));
QCoreApplication::setAttribute(Qt::AA_DisableShaderDiskCache);

QApplication app(argc, argv);
Expand Down
3 changes: 0 additions & 3 deletions pageedit_constants.cpp
Expand Up @@ -2,9 +2,6 @@
#include <QStringList>
#include "pageedit_constants.h"

// Use compile-time define from CMake file to limit version to one location in the source.
const QString PAGEEDIT_VERSION = QString(PAGEEDIT_FULL_VERSION);

#if _WIN32
#include <QProcessEnvironment>
// Windows barks about getenv or _wgetenv. This elicits no warnings and works with unicode paths
Expand Down
2 changes: 0 additions & 2 deletions pageedit_constants.h
Expand Up @@ -25,8 +25,6 @@

class QString;

extern const QString PAGEEDIT_VERSION;

extern const float ZOOM_STEP;
extern const float ZOOM_MIN;
extern const float ZOOM_MAX;
Expand Down

0 comments on commit 3dc899b

Please sign in to comment.