summaryrefslogtreecommitdiffstats
path: root/src/fbgui.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-05 20:42:59 +0100
committerJonathan Bauer2011-03-05 20:42:59 +0100
commitb50c681d6fac718f65abf58057889fcbe9b6aa10 (patch)
treeab6734b95f2710f50a5a793630a8c4a169cd3b43 /src/fbgui.cpp
parentURL parsing now works with CommandLineOptions. Incomplete... (diff)
downloadfbgui-b50c681d6fac718f65abf58057889fcbe9b6aa10.tar.gz
fbgui-b50c681d6fac718f65abf58057889fcbe9b6aa10.tar.xz
fbgui-b50c681d6fac718f65abf58057889fcbe9b6aa10.zip
help fixed, misc cleanups...
Diffstat (limited to 'src/fbgui.cpp')
-rw-r--r--src/fbgui.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp
index 6b70214..3fad734 100644
--- a/src/fbgui.cpp
+++ b/src/fbgui.cpp
@@ -27,24 +27,37 @@ int main(int argc, char *argv[])
// This is the main object of a QT Application.
QApplication a(argc, argv);
+ // Note: The QT arguments (-qws, -display etc) seems to be gone at this point.
+ // So we should be able to ignore the QT arguments when calling fbgui,
+ // and add them "manually" to argc/argv here? Testworthy!
+
/* SETTINGS TEST */
CommandLineOptions clOptions(argc, argv);
+
+ // Check if help was requested, if so printUsage() and exit.
+ if (clOptions.contains("help"))
+ {
+ qDebug() << "Help requested. Printing usage info. Exiting...";
+ printUsage();
+ // Not quite sure what the best exit statement is.
+ // Maybe better a.quit() ?
+ //exit(0);
+ // Probably use the EXIT_SUCCESS / EXIT_FAILURE constants as defined in "man exit"
+ return EXIT_SUCCESS;
+ }
+
+ // Check if URL was given at cmdline argument,
+ // if not set default.
QUrl url;
if (clOptions.contains("url"))
- {
- qDebug() << "URL from clOptions is: " << clOptions.value("url");
url = clOptions.value("url");
- }
else
url = QUrl("qrc:/html/errorPage.html");
- // TODO: parse url arg from CommmandLineOptions object.
-
/* SETTINGS TEST */
// Get the application path and prints on screen.
qDebug() << "Application Path: " << a.applicationDirPath();
- // Is this really needed, since we kill the app through the fbbrowser object?
QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
// Create a new Framebuffer-Browser object for displaying the given URL.