summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-06 17:10:29 +0100
committerJonathan Bauer2011-03-06 17:10:29 +0100
commit0193e902466857b2b81e2b35cf172b314a10a6b2 (patch)
treed64e7bc4df8736da1120985270729132bc43996e /src/main.cpp
parentcleaned includes a bit (diff)
downloadfbgui-0193e902466857b2b81e2b35cf172b314a10a6b2.tar.gz
fbgui-0193e902466857b2b81e2b35cf172b314a10a6b2.tar.xz
fbgui-0193e902466857b2b81e2b35cf172b314a10a6b2.zip
baseUrl is now global variable
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f8c0880..4172d79 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,12 +1,16 @@
#include <QApplication>
+#include <QSettings>
#include <QtCore>
#include <getopt.h>
#include <cstdlib>
#include <iostream>
#include "fbgui.h"
+extern QUrl baseUrl;
+// temporary settings testing stuff
QMap<QString, QString> options;
+
void printHelp()
{
// Prints usage information.
@@ -24,16 +28,8 @@ 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];
-
int longIndex = 0;
static const char *optString = "u:h";
static const struct option longOpts[] =
@@ -64,11 +60,8 @@ int main(int argc, char *argv[])
//
if (options.contains("url"))
- {
- QUrl url = options.value("url");
- gui->setUrl(url);
- }
-
+ // TODO: also check in conf before settings this.
+ baseUrl = options.value("url");
else
{
std::cout << "No URL specified. Exiting...";
@@ -77,6 +70,8 @@ int main(int argc, char *argv[])
// TODO: Read INI.
// Start fbgui.
+ fbgui *gui = new fbgui();
+ gui->setParent(app);
gui->startBrowser();
return app->exec();