diff options
| author | Jonathan Bauer | 2011-01-27 18:18:56 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2011-01-27 18:18:56 +0100 |
| commit | d7b3217e900faf29857abdac39f3d94829c0a50e (patch) | |
| tree | ff26cdc7bb3c91d280389ddc631b4b380f81d5d4 /src | |
| parent | remove absolute path from test script .. (diff) | |
| download | fbgui-d7b3217e900faf29857abdac39f3d94829c0a50e.tar.gz fbgui-d7b3217e900faf29857abdac39f3d94829c0a50e.tar.xz fbgui-d7b3217e900faf29857abdac39f3d94829c0a50e.zip | |
Started the download functionality, imcomplete though...
Diffstat (limited to 'src')
| -rw-r--r-- | src/.cproject | 169 | ||||
| -rw-r--r-- | src/.project | 82 | ||||
| -rw-r--r-- | src/fbbrowser.cpp | 69 | ||||
| -rw-r--r-- | src/fbbrowser.h | 14 | ||||
| -rw-r--r-- | src/fbgui.cpp | 4 | ||||
| -rw-r--r-- | src/fbgui.h | 2 |
6 files changed, 253 insertions, 87 deletions
diff --git a/src/.cproject b/src/.cproject index 08a2b7b..046216a 100644 --- a/src/.cproject +++ b/src/.cproject @@ -3,14 +3,60 @@ <cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> <storageModule moduleId="org.eclipse.cdt.core.settings"> - <cconfiguration id="org.eclipse.cdt.core.default.config.1065718378"> - <storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.1065718378" moduleId="org.eclipse.cdt.core.settings" name="Configuration"> + <cconfiguration id="0.1719944755"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1719944755" moduleId="org.eclipse.cdt.core.settings" name="Default"> <externalSettings/> <extensions> <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> </extensions> </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + <storageModule moduleId="org.eclipse.cdt.core.pathentry"> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtNetwork" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtCore" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtXml" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtTest" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtDBus" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtSql" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtDeclarative" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtGui" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtScript" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtSvg" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtScriptTools" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtMultimedia" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtUiTools" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="Qt" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtWebKit" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtDesigner" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="Qt3Support" kind="inc" path="" system="true"/> + <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtHelp" kind="inc" path="" system="true"/> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration buildProperties="" description="" id="0.1719944755" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg"> + <folderInfo id="0.1719944755." name="/" resourcePath=""> + <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1953817660" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain"> + <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.1953817660.1039381753" name=""/> + <builder id="org.eclipse.cdt.build.core.settings.default.builder.1891129888" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/> + <tool id="org.eclipse.cdt.build.core.settings.holder.libs.1062620040" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/> + <tool id="org.eclipse.cdt.build.core.settings.holder.640273578" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder"> + <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1373462247" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> + </tool> + <tool id="org.eclipse.cdt.build.core.settings.holder.2017625377" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder"> + <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1294540575" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> + </tool> + <tool id="org.eclipse.cdt.build.core.settings.holder.1775845390" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder"> + <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.35744408" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> <storageModule moduleId="scannerConfiguration"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> @@ -93,7 +139,91 @@ <parser enabled="true"/> </scannerInfoProvider> </profile> + <scannerConfigBuildInfo instanceId="0.1719944755"> + <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> + <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> + <buildOutputProvider> + <openAction enabled="true" filePath=""/> + <parser enabled="true"/> + </buildOutputProvider> + <scannerInfoProvider id="specsFile"> + <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> + <parser enabled="true"/> + </scannerInfoProvider> + </profile> + <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> + <buildOutputProvider> + <openAction enabled="true" filePath=""/> + <parser enabled="true"/> + </buildOutputProvider> + <scannerInfoProvider id="makefileGenerator"> + <runAction arguments="-E -P -v -dD" command="" useDefault="true"/> + <parser enabled="true"/> + </scannerInfoProvider> + </profile> + <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> + <buildOutputProvider> + <openAction enabled="true" filePath=""/> + <parser enabled="true"/> + </buildOutputProvider> + <scannerInfoProvider id="specsFile"> + <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> + <parser enabled="true"/> + </scannerInfoProvider> + </profile> + <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> + <buildOutputProvider> + <openAction enabled="true" filePath=""/> + <parser enabled="true"/> + </buildOutputProvider> + <scannerInfoProvider id="specsFile"> + <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> + <parser enabled="true"/> + </scannerInfoProvider> + </profile> + <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> + <buildOutputProvider> + <openAction enabled="true" filePath=""/> + <parser enabled="true"/> + </buildOutputProvider> + <scannerInfoProvider id="specsFile"> + <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> + <parser enabled="true"/> + </scannerInfoProvider> + </profile> + <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> + <buildOutputProvider> + <openAction enabled="true" filePath=""/> + <parser enabled="true"/> + </buildOutputProvider> + <scannerInfoProvider id="specsFile"> + <runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> + <parser enabled="true"/> + </scannerInfoProvider> + </profile> + <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> + <buildOutputProvider> + <openAction enabled="true" filePath=""/> + <parser enabled="true"/> + </buildOutputProvider> + <scannerInfoProvider id="specsFile"> + <runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> + <parser enabled="true"/> + </scannerInfoProvider> + </profile> + <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> + <buildOutputProvider> + <openAction enabled="true" filePath=""/> + <parser enabled="true"/> + </buildOutputProvider> + <scannerInfoProvider id="specsFile"> + <runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> + <parser enabled="true"/> + </scannerInfoProvider> + </profile> + </scannerConfigBuildInfo> </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"> <buildTargets> <target name="Qt Release Build" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder"> @@ -104,38 +234,11 @@ <useDefaultCommand>false</useDefaultCommand> <runAllBuilders>true</runAllBuilders> </target> - <target name="Qt Debug Build" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder"> - <buildCommand>make</buildCommand> - <buildArguments/> - <buildTarget>debug</buildTarget> - <stopOnError>false</stopOnError> - <useDefaultCommand>false</useDefaultCommand> - <runAllBuilders>true</runAllBuilders> - </target> </buildTargets> </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> - <storageModule moduleId="org.eclipse.cdt.core.pathentry"> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtNetwork" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtCore" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtXml" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtTest" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtDBus" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtSql" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtDeclarative" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtGui" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtScript" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtSvg" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtScriptTools" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtMultimedia" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtUiTools" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="Qt" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtWebKit" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtDesigner" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="Qt3Support" kind="inc" path="" system="true"/> - <pathentry base-path="/usr/local/Trolltech/QtEmbedded-4.7.1/include" include="QtHelp" kind="inc" path="" system="true"/> - </storageModule> </cconfiguration> </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <project id="src.null.2069411115" name="src"/> + </storageModule> </cproject> diff --git a/src/.project b/src/.project index 477155b..1afb784 100644 --- a/src/.project +++ b/src/.project @@ -6,41 +6,36 @@ </projects> <buildSpec> <buildCommand> - <name>com.trolltech.qtcppproject.QtMakefileGenerator</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.cdt.make.core.makeBuilder</name> + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> <triggers>clean,full,incremental,</triggers> <arguments> <dictionary> - <key>org.eclipse.cdt.core.errorOutputParser</key> - <value>org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.MakeErrorParser;</value> + <key>?name?</key> + <value></value> </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.append_environment</key> <value>true</value> </dictionary> <dictionary> - <key>org.eclipse.cdt.make.core.build.arguments</key> - <value></value> + <key>org.eclipse.cdt.make.core.autoBuildTarget</key> + <value>all</value> </dictionary> <dictionary> - <key>org.eclipse.cdt.make.core.build.command</key> - <value>make</value> + <key>org.eclipse.cdt.make.core.buildArguments</key> + <value></value> </dictionary> <dictionary> - <key>org.eclipse.cdt.make.core.build.target.auto</key> - <value>debug</value> + <key>org.eclipse.cdt.make.core.buildCommand</key> + <value>make</value> </dictionary> <dictionary> - <key>org.eclipse.cdt.make.core.build.target.clean</key> + <key>org.eclipse.cdt.make.core.cleanBuildTarget</key> <value>clean</value> </dictionary> <dictionary> - <key>org.eclipse.cdt.make.core.build.target.inc</key> - <value>debug</value> + <key>org.eclipse.cdt.make.core.contents</key> + <value>org.eclipse.cdt.make.core.activeConfigSettings</value> </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.enableAutoBuild</key> @@ -55,25 +50,27 @@ <value>true</value> </dictionary> <dictionary> - <key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key> - <value>true</value> - </dictionary> - <dictionary> - <key>org.eclipse.cdt.make.core.environment</key> - <value>PATH=/usr/local/Trolltech/QtEmbedded-4.7.1/bin:${env_var:PATH}:${env_var:PATH}|</value> + <key>org.eclipse.cdt.make.core.fullBuildTarget</key> + <value>all</value> </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.stopOnError</key> - <value>false</value> + <value>true</value> </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> - <value>false</value> + <value>true</value> </dictionary> </arguments> </buildCommand> <buildCommand> - <name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name> + <name>com.trolltech.qtcppproject.QtMakefileGenerator</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> + <triggers>full,incremental,</triggers> <arguments> </arguments> </buildCommand> @@ -81,8 +78,37 @@ <natures> <nature>org.eclipse.cdt.core.cnature</nature> <nature>org.eclipse.cdt.core.ccnature</nature> - <nature>org.eclipse.cdt.make.core.makeNature</nature> - <nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature> <nature>com.trolltech.qtcppproject.QtNature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> </natures> + <filteredResources> + <filter> + <id>1296135546369</id> + <name></name> + <type>6</type> + <matcher> + <id>org.eclipse.ui.ide.multiFilter</id> + <arguments>1.0-name-matches-false-false-*.o</arguments> + </matcher> + </filter> + <filter> + <id>1296135546371</id> + <name></name> + <type>6</type> + <matcher> + <id>org.eclipse.ui.ide.multiFilter</id> + <arguments>1.0-name-matches-false-false-ui_*.*</arguments> + </matcher> + </filter> + <filter> + <id>1296135546374</id> + <name></name> + <type>6</type> + <matcher> + <id>org.eclipse.ui.ide.multiFilter</id> + <arguments>1.0-name-matches-false-false-qrc_*.*</arguments> + </matcher> + </filter> + </filteredResources> </projectDescription> diff --git a/src/fbbrowser.cpp b/src/fbbrowser.cpp index 2e4fee6..4b2b66f 100644 --- a/src/fbbrowser.cpp +++ b/src/fbbrowser.cpp @@ -1,11 +1,13 @@ #include "fbbrowser.h" -#include <QtGui> + +#include <QFile> +#include <QFileInfo> #include <QtWebKit> -#include <QApplication> +// This function is not used at the moment. +// TODO: Fix function or find another way... void fbbrowser::httpReqFinished() { - // TODO: fix this up.. // This slot listens to readyRead() signal from our QNetworkReply. qDebug() << "finished() signal emmited!" << endl; if(reply->error() == QNetworkReply::NoError) @@ -15,6 +17,29 @@ void fbbrowser::httpReqFinished() } } +void fbbrowser::saveData() +{ + QFile outfile(filename); + if (!outfile.open(QIODevice::WriteOnly)) + { + qDebug() << "Couldnt open file! exiting..."; + exit(1); + } + outfile.write(qiod->readAll()); + outfile.close(); +} + +// This function requires the file name of the file to download. +void fbbrowser::download(const QString &file) +{ + // This function is in developement... + QUrl u = baseUrl.resolved(file); + req.setUrl(u); + rep = manager->get(req); + qiod = rep; + QObject::connect(rep, SIGNAL(finished()), this, SLOT(saveData())); +} + fbbrowser::fbbrowser(const QUrl & url) { view = new QWebView(this); @@ -22,33 +47,35 @@ 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); - reply = manager->get(request); - connect(reply, SIGNAL(finished()), this, SLOT(httpReqFinished())); - //connect(reply, SIGNAL(finished()), this, SLOT()); + reply = manager->get(request); + // connect(reply, SIGNAL(finished()), this, SLOT(httpReqFinished())); // Check if the reply is an error message. - qDebug() << "QNetworkReply error code: " << reply->error(); + qDebug() << "QNetworkReply error code is: " << reply->error(); // TODO: error differentiation - // 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")); - //} + // 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")); + } + // This part is just a test call of download()... + filename = "test.php"; + download(filename); //remove the window decoration this->setWindowFlags(Qt::SplashScreen); diff --git a/src/fbbrowser.h b/src/fbbrowser.h index 3d20249..d9ffc44 100644 --- a/src/fbbrowser.h +++ b/src/fbbrowser.h @@ -26,11 +26,21 @@ private: QNetworkReply *reply; QWebView *view; QNetworkAccessManager *manager; - //QApplication * app(int & argc, char ** argv); + + // Temporal stuff for the download function... + QNetworkRequest req; + QNetworkReply *rep; + QString filename; + QIODevice *qiod; + // Private download function. + void download(const QString & file); + + private slots: - void httpReqFinished(); + void httpReqFinished(); void addJSObject(); + void saveData(); signals: void signalQuitAll(); diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 6ed8eec..1f08454 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -1,6 +1,5 @@ #include "fbbrowser.h" -#include <QtGui> #include <QApplication> #include <iostream> #include <getopt.h> @@ -23,7 +22,7 @@ void printUsage() exit(1); } -// This function returns the path of the application as a string. +// This function returns the path of the application as a QString. QString getPath() { char result[ PATH_MAX ]; @@ -68,6 +67,7 @@ int main(int argc, char *argv[]) // Is this really needed, since we kill the app through the fbbrowser object? QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); // This part reads the URL to load from the arguments given through the commandline. + qDebug() << "Number of Arguments:" << argc << endl; QUrl url; if (argc > 1) url = QUrl(argv[1]); diff --git a/src/fbgui.h b/src/fbgui.h index c65a31f..6de7016 100644 --- a/src/fbgui.h +++ b/src/fbgui.h @@ -15,7 +15,7 @@ public: fbgui(); ~fbgui(); void printUsage(); - QString getPath(const char* c); + QString getPath(const char* c); //private: |
