diff options
| author | Jonathan Bauer | 2011-01-21 18:48:27 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2011-01-21 18:48:27 +0100 |
| commit | c8c50a73ba476dbb4780e41a0b3ecfedf0aa1a55 (patch) | |
| tree | eac7e032794709f1369f22a092179040fde7a446 /fbbrowser/main.cpp | |
| parent | URL validity check removed, will be done in the error handling of the request... (diff) | |
| download | fbgui-c8c50a73ba476dbb4780e41a0b3ecfedf0aa1a55.tar.gz fbgui-c8c50a73ba476dbb4780e41a0b3ecfedf0aa1a55.tar.xz fbgui-c8c50a73ba476dbb4780e41a0b3ecfedf0aa1a55.zip | |
Added function for getting the application path...
Diffstat (limited to 'fbbrowser/main.cpp')
| -rw-r--r-- | fbbrowser/main.cpp | 15 |
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) |
