diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fbgui.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 1d84c11..6ed8eec 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -24,13 +24,11 @@ void printUsage() } // This function returns the path of the application as a string. -std::string getPath() +QString getPath() { char result[ PATH_MAX ]; - - ssize_t length = readlink("/proc/self/exe", result, PATH_MAX); - //return result; - return std::string( result, (length > 0) ? length : 0); + readlink("/proc/self/exe", result, PATH_MAX); + return QString(result); } int main(int argc, char *argv[]) @@ -63,8 +61,7 @@ int main(int argc, char *argv[]) opt = getopt_long(argc, argv, optString, longOpts, &longIndex); } // Get the application path and prints on screen. - QString qs = QString::fromStdString(getPath()); - qDebug() << "Application Path: " << qs << endl; + qDebug() << "Application Path: " << getPath(); // This is the main object of a QT Application. QApplication a(argc, argv); |
