diff options
author | Jonathan Bauer | 2011-03-08 23:12:12 +0100 |
---|---|---|
committer | Jonathan Bauer | 2011-03-08 23:12:12 +0100 |
commit | 0c6fa0dbb3522f643e6916092a310ad0a2622044 (patch) | |
tree | 583afb1bbb4a8a3185adecfa14bf128b865b2e2f /src/fbgui.cpp | |
parent | changed testcode back to what it was supposed to be :P (diff) | |
download | fbgui-0c6fa0dbb3522f643e6916092a310ad0a2622044.tar.gz fbgui-0c6fa0dbb3522f643e6916092a310ad0a2622044.tar.xz fbgui-0c6fa0dbb3522f643e6916092a310ad0a2622044.zip |
misc
Diffstat (limited to 'src/fbgui.cpp')
-rw-r--r-- | src/fbgui.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 6c2eead..dbee71f 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -14,19 +14,14 @@ QString binPath(""); QString downloadPath(binPath + "/downloads"); QUrl baseURL(DEFAULT_URL); bool debug = false; - -fbgui::fbgui(QApplication *parent) +//------------------------------------------------------------------------------------------- +fbgui::fbgui() { if (debug) qDebug() << "Application dir path: " << QApplication::applicationDirPath(); - /* Lookup hostname */ - QHostInfo hostInfo = QHostInfo::fromName(baseURL.host()); - if (hostInfo.error() != QHostInfo::NoError){ - if (debug) qDebug() << "Lookup of " << baseURL.host() << "failed." << "Exiting..."; - exit(EXIT_FAILURE); - } + checkHost(); - /* Browser init. */ + /* Init "browser" */ QWebView* webView = new QWebView(this); webView->load(baseURL); @@ -45,6 +40,13 @@ fbgui::fbgui(QApplication *parent) setWindowFlags(Qt::SplashScreen); showFullScreen(); setCentralWidget(webView); - + show(); +} +//------------------------------------------------------------------------------------------- +void fbgui::checkHost() const { + QHostInfo hostInfo = QHostInfo::fromName(baseURL.host()); + if (hostInfo.error() != QHostInfo::NoError){ + if (debug) qDebug() << "Lookup of " << baseURL.host() << "failed." << "Exiting..."; + exit(EXIT_FAILURE); + } } - |