From 5808c2cc7b9e8e74710113f5904e9aa93f41f2bf Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 27 Jan 2011 13:24:10 +0100 Subject: getPath(): using qDebug() instead of std::cout --- src/fbgui.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/fbgui.cpp') 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? -- cgit v1.2.3-55-g7522