Skip to content

Commit

Permalink
Parse args as early as possible
Browse files Browse the repository at this point in the history
This avoids unneccesary output for options like albert -v
  • Loading branch information
ManuelSchneid3r committed Nov 17, 2017
1 parent d427c12 commit f85a693
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/albertcore/src/core/albert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,8 @@ int Core::AlbertApp::run(int argc, char **argv) {
app->setApplicationName("albert");
app->setApplicationDisplayName("Albert");
app->setApplicationVersion("v0.14.10");
app->setQuitOnLastWindowClosed(false);
QString icon = XDG::IconLookup::iconPath("albert");
if ( icon.isEmpty() ) icon = ":app_icon";
app->setWindowIcon(QIcon(icon));


/*
* PARSE COMMANDLINE
*/

// Parse commandline
qDebug() << "Parsing commandline";
QCommandLineParser parser;
parser.setApplicationDescription("Albert is still in alpha. These options may change in future versions.");
Expand All @@ -104,6 +96,11 @@ int Core::AlbertApp::run(int argc, char **argv) {
if (parser.isSet("debug"))
printDebugOutput = true;

app->setQuitOnLastWindowClosed(false);
QString icon = XDG::IconLookup::iconPath("albert");
if ( icon.isEmpty() ) icon = ":app_icon";
app->setWindowIcon(QIcon(icon));


/*
* IPC/SINGLETON MECHANISM
Expand Down

0 comments on commit f85a693

Please sign in to comment.