diff options
| author | Jonathan Bauer | 2011-01-21 17:49:51 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2011-01-21 17:49:51 +0100 |
| commit | c2a9d5111f388d87cfc8dd9f16ddf6eb5331b2d3 (patch) | |
| tree | cddec789f932e47b249e9e387335930aad200c9a | |
| parent | testApp.sh now needs the URL as parameter, about time... (diff) | |
| download | fbgui-c2a9d5111f388d87cfc8dd9f16ddf6eb5331b2d3.tar.gz fbgui-c2a9d5111f388d87cfc8dd9f16ddf6eb5331b2d3.tar.xz fbgui-c2a9d5111f388d87cfc8dd9f16ddf6eb5331b2d3.zip | |
URL validity check removed, will be done in the error handling of the request...
| -rwxr-xr-x | fbbrowser/fbbrowser | bin | 521879 -> 518639 bytes | |||
| -rw-r--r-- | fbbrowser/fbbrowser.cpp | 14 | ||||
| -rw-r--r-- | fbbrowser/main.cpp | 22 |
3 files changed, 14 insertions, 22 deletions
diff --git a/fbbrowser/fbbrowser b/fbbrowser/fbbrowser Binary files differindex 03a4448..63efad8 100755 --- a/fbbrowser/fbbrowser +++ b/fbbrowser/fbbrowser diff --git a/fbbrowser/fbbrowser.cpp b/fbbrowser/fbbrowser.cpp index b53134c..3844f66 100644 --- a/fbbrowser/fbbrowser.cpp +++ b/fbbrowser/fbbrowser.cpp @@ -22,20 +22,20 @@ fbbrowser::fbbrowser(const QUrl & url) //connect(reply, SIGNAL(error()), this, SLOT()); //connect(reply, SIGNAL(finished()), this, SLOT()); - // Check if the reply is an error message (?) + // Check if the reply is an error message. qDebug() << reply->error(); //TODO: error differentiation - if(reply->error()!=0) - { - qDebug() << "show errorPage"; - view->load(QUrl("qrc:/html/errorPage.html")); - } - else + if(reply->error() == QNetworkReply::NoError) { qDebug() << "show Page"; view->load(url); } + else + { + qDebug() << "show errorPage"; + view->load(QUrl("qrc:/html/errorPage.html")); + } //remove the window decoration this->setWindowFlags(Qt::SplashScreen); diff --git a/fbbrowser/main.cpp b/fbbrowser/main.cpp index b6c6dac..086f2c5 100644 --- a/fbbrowser/main.cpp +++ b/fbbrowser/main.cpp @@ -16,21 +16,13 @@ int main(int argc, char *argv[]) url = QUrl(argv[1]); else //Default URL to load url = QUrl("http://132.230.4.3/webkitTest.html"); - // Check if the URL is valid. - // TODO(joe): also check for correct host - // handle the case of a non-valid URL properly. - if (!url.isValid()) - qDebug() << "Invalid URL."; - else - { - qDebug() << "Valid URL."; - // Create a new Framebuffer-Browser object for displaying the given URL. - fbbrowser *fbb = new fbbrowser(url); - // Listen to the signalQuitAll() Signal to kill the app from within the browser. - QObject::connect(fbb, SIGNAL(signalQuitAll()), &a, SLOT(quit())); - // Display the browser. - fbb->show(); - } + // Create a new Framebuffer-Browser object for displaying the given URL. + fbbrowser *fbb = new fbbrowser(url); + // Listen to the signalQuitAll() Signal to kill the app from within the browser. + QObject::connect(fbb, SIGNAL(signalQuitAll()), &a, SLOT(quit())); + // Display the browser. + fbb->show(); + // Exit the application. return a.exec(); } |
