summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-06 12:38:47 +0100
committerJonathan Bauer2011-03-06 12:38:47 +0100
commit4c130760d46a0e06e867447a39440596e215015c (patch)
tree7b55e2c6d8fd3cc541571748d46a522b9e87e37b /src/main.cpp
parentmain.cpp added (diff)
downloadfbgui-4c130760d46a0e06e867447a39440596e215015c.tar.gz
fbgui-4c130760d46a0e06e867447a39440596e215015c.tar.xz
fbgui-4c130760d46a0e06e867447a39440596e215015c.zip
fixed URL loading from cmdline
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 95981e0..1f4a984 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,6 +5,7 @@
#include <iostream>
#include "fbgui.h"
+
QMap<QString, QString> options;
void printHelp()
{
@@ -23,10 +24,14 @@ int main(int argc, char *argv[])
app->setApplicationName("fbgui");
app->setObjectName("test");
+ // Initialise fbgui
+ fbgui *gui = new fbgui();
+ gui->setParent(app);
+
/* Parse cmdline argus. */
- qDebug() << "Received " << argc << "arguments:";
- for (int i = 0; i < argc; i++)
- qDebug() << i + 1 << ": " << argv[i];
+ //qDebug() << "Received " << argc << "arguments:";
+ //for (int i = 0; i < argc; i++)
+ // qDebug() << i + 1 << ": " << argv[i];
int longIndex = 0;
static const char *optString = "u:h";
@@ -56,9 +61,13 @@ int main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
//
- QUrl url;
+
if (options.contains("url"))
- url = options.value("url");
+ {
+ QUrl url = options.value("url");
+ gui->setUrl(url);
+ }
+
else
{
std::cout << "No URL specified. Exiting...";
@@ -66,11 +75,8 @@ int main(int argc, char *argv[])
}
// TODO: Read INI.
+ // Start fbgui.
+ gui->start();
- // Init fbgui
- fbgui *gui = new fbgui(app);
- gui->setParent(app);
- qDebug() << "Obj name: " << gui->parent()->objectName();
- qDebug() << "Created fbgui...";
return app->exec();
}