Skip to content

Commit

Permalink
Use command line parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ElTh0r0 committed Oct 19, 2019
1 parent d7298ce commit 0000f6c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = iQPuzzle
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.1.3
PROJECT_NUMBER = 1.1.4

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '1.1.3-{build}'
version: '1.1.4-{build}'

environment:
matrix:
Expand Down
3 changes: 2 additions & 1 deletion iqpuzzle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ void IQPuzzle::generateFileLists() {
QDirIterator::Subdirectories);
while (it.hasNext()) {
it.next();
if (!it.filePath().contains(QStringLiteral("freestyle"))) { // Filter freestyle boards
// Filter freestyle boards
if (!it.filePath().contains(QStringLiteral("freestyle"))) {
QString sName = it.filePath().remove(m_sSharePath + "/boards/");
// qDebug() << sName;

Expand Down
17 changes: 10 additions & 7 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,22 @@ int main(int argc, char *argv[]) {
app.setApplicationName(APP_NAME);
app.setApplicationVersion(APP_VERSION);

if (app.arguments().contains(QStringLiteral("-v")) ||
app.arguments().contains(QStringLiteral("--version"))) {
qDebug() << app.arguments().at(0) << "\t" <<
app.applicationVersion() << "\n";
exit(0);
}
QCommandLineParser cmdparser;
cmdparser.setApplicationDescription(APP_DESC);
cmdparser.addHelpOption();
cmdparser.addVersionOption();
QCommandLineOption enableDebug("debug", "Enable debug mode");
cmdparser.addOption(enableDebug);
cmdparser.addPositionalArgument("file", "Board file to be opened (*.conf) "
"or savegame (*.iqsav)");
cmdparser.process(app);

// Default share data path (Windows and debugging)
QString sSharePath = app.applicationDirPath();
// Standard installation path (Linux)
QDir tmpDir(app.applicationDirPath() + "/../share/"
+ app.applicationName().toLower());
if (!app.arguments().contains(QStringLiteral("--debug")) && tmpDir.exists()) {
if (!cmdparser.isSet(enableDebug) && tmpDir.exists()) {
sSharePath = app.applicationDirPath() + "/../share/"
+ app.applicationName().toLower();
}
Expand Down
4 changes: 2 additions & 2 deletions res/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.1.4</string>
<key>CFBundleVersion</key>
<string>1.1.3</string>
<string>1.1.4</string>
<key>NSHumanReadableCopyright</key>
<string>(c) 2012-2019, Thorsten Roth</string>
</dict>
Expand Down
8 changes: 4 additions & 4 deletions res/iqpuzzle_win.rc
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
IDI_ICON1 ICON DISCARDABLE "images/iqpuzzle.ico"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,3,0
PRODUCTVERSION 1,1,3,0
FILEVERSION 1,1,4,0
PRODUCTVERSION 1,1,4,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "A diverting I.Q. challenging pentomino puzzle\0"
VALUE "FileVersion", "1.1.3\0"
VALUE "FileVersion", "1.1.4\0"
VALUE "InternalName", "iQPuzzle\0"
VALUE "LegalCopyright", "Copyright (c) 2012-2019 Thorsten Roth\0"
VALUE "OriginalFilename", "iQPuzzle.exe\0"
VALUE "ProductName", "iQPuzzle\0"
VALUE "ProductVersion", "1.1.3\0"
VALUE "ProductVersion", "1.1.4\0"
END
END

Expand Down

0 comments on commit 0000f6c

Please sign in to comment.