diff options
author | Jonathan Bauer | 2011-01-25 17:13:35 +0100 |
---|---|---|
committer | Jonathan Bauer | 2011-01-25 17:13:35 +0100 |
commit | 2346f109df05309a02f13c6992b01f6f5f2329ef (patch) | |
tree | 7c07fb4d5601e0440ba9d375f5c08cc8e711e2a6 | |
parent | fbgui.h updated (diff) | |
download | fbgui-2346f109df05309a02f13c6992b01f6f5f2329ef.tar.gz fbgui-2346f109df05309a02f13c6992b01f6f5f2329ef.tar.xz fbgui-2346f109df05309a02f13c6992b01f6f5f2329ef.zip |
fbgui.o removed
-rw-r--r-- | fbbrowser/fbbrowser.cpp | 30 | ||||
-rw-r--r-- | fbbrowser/fbbrowser.h | 6 | ||||
-rw-r--r-- | fbbrowser/fbgui.cpp | 4 | ||||
-rw-r--r-- | fbbrowser/fbgui.o | bin | 320592 -> 0 bytes | |||
-rwxr-xr-x | fbbrowser/testApp.sh | 3 |
5 files changed, 25 insertions, 18 deletions
diff --git a/fbbrowser/fbbrowser.cpp b/fbbrowser/fbbrowser.cpp index bef6aca..50fc86a 100644 --- a/fbbrowser/fbbrowser.cpp +++ b/fbbrowser/fbbrowser.cpp @@ -7,6 +7,11 @@ void fbbrowser::httpReadyRead() { // This slot listens to readyRead() signal from our QNetworkReply. qDebug() << "readyRead() signal emmited!" << endl; + if(reply->error() == QNetworkReply::NoError) + { + qDebug() << "No error, loading given URL..."; + view->load(url); + } } fbbrowser::fbbrowser(const QUrl & url) @@ -16,12 +21,13 @@ fbbrowser::fbbrowser(const QUrl & url) // Create QNetworkAccessManager which is needed to send/receive requests. manager = new QNetworkAccessManager(this); // Create a QNetworkRequest object and set its URL. - QNetworkRequest request; + // QNetworkRequest request; request.setUrl(url); // Check Internet connection // Let the manager send the request and receive the reply. - QNetworkReply *reply = manager->get(request); + // QNetworkReply *reply = manager->get(request); + *reply = manager->get(request); connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead())); //connect(reply, SIGNAL(finished()), this, SLOT()); @@ -32,16 +38,16 @@ fbbrowser::fbbrowser(const QUrl & url) // reply->error() returns 0 even for invalid URL. // A possibility to check for validity, is to listen to readyRead() // signal, haven't found a better way yet ... - if(reply->error() == QNetworkReply::NoError) - { - qDebug() << "No error, loading given URL..."; - view->load(url); - } - else - { - qDebug() << "Error occured, loading error page..."; - view->load(QUrl("qrc:/html/errorPage.html")); - } + //if(reply->error() == QNetworkReply::NoError) + //{ + // qDebug() << "No error, loading given URL..."; + // view->load(url); + //} + //else + //{ + // qDebug() << "Error occured, loading error page..."; + // view->load(QUrl("qrc:/html/errorPage.html")); + //} //remove the window decoration this->setWindowFlags(Qt::SplashScreen); diff --git a/fbbrowser/fbbrowser.h b/fbbrowser/fbbrowser.h index 9e7c0fd..c869197 100644 --- a/fbbrowser/fbbrowser.h +++ b/fbbrowser/fbbrowser.h @@ -22,9 +22,9 @@ public: Q_INVOKABLE void quitAll(); private: - // QUrl url; - // QNetworkRequest request; - // QNetworkReply reply; + QUrl url; + QNetworkRequest request; + QNetworkReply *reply; QWebView * view; QNetworkAccessManager * manager; //QApplication * app(int & argc, char ** argv); diff --git a/fbbrowser/fbgui.cpp b/fbbrowser/fbgui.cpp index 4d34fa9..fe67b79 100644 --- a/fbbrowser/fbgui.cpp +++ b/fbbrowser/fbgui.cpp @@ -12,7 +12,7 @@ void printUsage() // Prints usage information, incomplete. // Q: How is the -qws option handled, mention it here or not? QTextStream qout(stdout); - qout << QObject::tr("Usage: ./fbbrowser [OPTIONS] <URL>") << endl; + qout << QObject::tr("Usage: ./fbgui [OPTIONS] <URL>") << endl; qout << QObject::tr("Options:") << endl; qout << "-h or --help " << QObject::tr("Prints usage information.") << endl; qout << "-qws " << QObject::tr("Set this application to also be the server application.") << endl; @@ -33,7 +33,7 @@ QString getPath(const char* c) int main(int argc, char *argv[]) { // Parse command line arguments. - int opt = 1; + int opt = 0; int longIndex = 0; // Declare the short options as a char*, these have exactly one - followed by letter from optString. // For example: ./fbbrowser -h diff --git a/fbbrowser/fbgui.o b/fbbrowser/fbgui.o Binary files differdeleted file mode 100644 index c79ce7a..0000000 --- a/fbbrowser/fbgui.o +++ /dev/null diff --git a/fbbrowser/testApp.sh b/fbbrowser/testApp.sh index 9d3c2d2..0995695 100755 --- a/fbbrowser/testApp.sh +++ b/fbbrowser/testApp.sh @@ -10,7 +10,8 @@ fi sleep 1 # Start the fbbrowser app. # This requires the fbgui git repository to be in the user's home directory. -~/fbgui/fbbrowser/fbgui -qws $1 +export PATH=~/fbgui/fbbrowser/:$PATH +fbgui -qws $1 # Check if fbbrowser is not running, if so kill the qvfb. if [ $(ps aux | grep -v grep | grep -c fbgui) -eq 1 ] then |