# # # patch "guitone/src/util/OpenFile.cpp" # from [5e480e3dd2be390e27077fa28108c625bc78fee2] # to [0c0d9d5b5469e14bd99300192911167776b673a9] # ============================================================ --- guitone/src/util/OpenFile.cpp 5e480e3dd2be390e27077fa28108c625bc78fee2 +++ guitone/src/util/OpenFile.cpp 0c0d9d5b5469e14bd99300192911167776b673a9 @@ -15,20 +15,32 @@ bool OpenFile::open(QWidget *widget, con #ifdef Q_WS_X11 Q_UNUSED(widget); - // Assume we have KDE - string s("kfmclient exec \""); - s += filename.toUtf8().data(); - s += "\""; - retval = (system(s.c_str()) == 0); - // If that doesn't work, try the Gnome version - // If this still doesn't work, then we're clueless - if (!retval) + // due to a weird behaviour in kfmclient (always return 1 for any + // exec command) we need to find out by hand if kfmclient resides in the + // current path + if (system("which kfmclient") == 0) { + qDebug("OpenFile::open: using kfmclient"); + string s("kfmclient exec \""); + s += filename.toUtf8().data(); + s += "\""; + // just cross your fingers + system(s.c_str()); + retval = true; + } + else + if (system("which gnome-open") == 0) + { + qDebug("OpenFile::open: using gnome-open"); string s("gnome-open \""); s += filename.toUtf8().data(); s += "\""; retval = (system(s.c_str()) == 0); } + else + { + qDebug("OpenFile::open: neither kfmclient nor gnome-open found"); + } #endif #ifdef Q_WS_MACX