diff options
| -rw-r--r-- | src/fbgui.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 825af9c..1d84c11 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -23,11 +23,14 @@ void printUsage() exit(1); } +// This function returns the path of the application as a string. std::string getPath() { char result[ PATH_MAX ]; - size_t count = readlink("/proc/self/exe", result, PATH_MAX); - return std::string( result, (count > 0) ? count : 0); + + ssize_t length = readlink("/proc/self/exe", result, PATH_MAX); + //return result; + return std::string( result, (length > 0) ? length : 0); } int main(int argc, char *argv[]) @@ -60,8 +63,9 @@ int main(int argc, char *argv[]) opt = getopt_long(argc, argv, optString, longOpts, &longIndex); } // Get the application path and prints on screen. - std::string appPath = getPath(); - std::cout << "Application path: " << appPath << endl; + QString qs = QString::fromStdString(getPath()); + qDebug() << "Application Path: " << qs << endl; + // 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? |
