summaryrefslogtreecommitdiffstats
path: root/fbbrowser
diff options
context:
space:
mode:
authorJonathan Bauer2011-01-21 18:48:27 +0100
committerJonathan Bauer2011-01-21 18:48:27 +0100
commitc8c50a73ba476dbb4780e41a0b3ecfedf0aa1a55 (patch)
treeeac7e032794709f1369f22a092179040fde7a446 /fbbrowser
parentURL validity check removed, will be done in the error handling of the request... (diff)
downloadfbgui-c8c50a73ba476dbb4780e41a0b3ecfedf0aa1a55.tar.gz
fbgui-c8c50a73ba476dbb4780e41a0b3ecfedf0aa1a55.tar.xz
fbgui-c8c50a73ba476dbb4780e41a0b3ecfedf0aa1a55.zip
Added function for getting the application path...
Diffstat (limited to 'fbbrowser')
-rwxr-xr-xfbbrowser/fbbrowserbin518639 -> 522596 bytes
-rw-r--r--fbbrowser/main.cpp15
2 files changed, 13 insertions, 2 deletions
diff --git a/fbbrowser/fbbrowser b/fbbrowser/fbbrowser
index 63efad8..44ca59f 100755
--- a/fbbrowser/fbbrowser
+++ b/fbbrowser/fbbrowser
Binary files differ
diff --git a/fbbrowser/main.cpp b/fbbrowser/main.cpp
index 086f2c5..7795688 100644
--- a/fbbrowser/main.cpp
+++ b/fbbrowser/main.cpp
@@ -3,13 +3,24 @@
#include <QtGui>
#include <QApplication>
+QString getPath(const char* c)
+{
+ QString appPath = c;
+ // Locate last '/' in the full path and remove all the chars after it.
+ appPath.chop(appPath.length() - 1
+ - appPath.lastIndexOf("/", appPath.length()-1));
+ qDebug() << "Application path: " << appPath;
+ return appPath;
+}
+
int main(int argc, char *argv[])
{
- // This is the main object of a QT Application.
+ // This is the main object of a QT Application.
QApplication a(argc, argv);
// Is this really needed, since we kill the app through the fbbrowser object?
QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
-
+ // Get the application path.
+ QString appPath = getPath(argv[0]);
// This part reads the URL to load from the arguments given through the commandline.
QUrl url;
if (argc > 1)