summaryrefslogtreecommitdiffstats
path: root/fbbrowser/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fbbrowser/main.cpp')
-rw-r--r--fbbrowser/main.cpp15
1 files changed, 13 insertions, 2 deletions
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)