summaryrefslogtreecommitdiffstats
path: root/src/fbgui.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-05 16:55:26 +0100
committerJonathan Bauer2011-03-05 16:55:26 +0100
commit602106a89c654762d8963f8ab57142c48dc19983 (patch)
treeb9865cd69830d0f1cecf3db6a5caf6941982e056 /src/fbgui.cpp
parentmisc. (diff)
downloadfbgui-602106a89c654762d8963f8ab57142c48dc19983.tar.gz
fbgui-602106a89c654762d8963f8ab57142c48dc19983.tar.xz
fbgui-602106a89c654762d8963f8ab57142c48dc19983.zip
URL parsing now works with CommandLineOptions. Incomplete...
Diffstat (limited to 'src/fbgui.cpp')
-rw-r--r--src/fbgui.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp
index cc10f20..6b70214 100644
--- a/src/fbgui.cpp
+++ b/src/fbgui.cpp
@@ -5,6 +5,7 @@
#include <QApplication>
#include <QSettings>
+#include <QUrl>
void printUsage()
{
@@ -21,19 +22,26 @@ void printUsage()
int main(int argc, char *argv[])
{
+
+
+ // This is the main object of a QT Application.
+ QApplication a(argc, argv);
+
/* SETTINGS TEST */
CommandLineOptions clOptions(argc, argv);
-
+ 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.
- // hackfix for now...
- QUrl url = QUrl(argv[4]);
- QUrl defaultUrl = QUrl("http://132.230.4.3/webkitTest.html");
- qDebug() << "URL given: " << url.toString();
/* SETTINGS TEST */
- // This is the main object of a QT Application.
- QApplication a(argc, argv);
+
// 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?