rainbowsally Messages: 29 Registered: December 2014
Promising Member
Hi koldo.
koldo wrote on Mon, 22 December 2014 21:06
Hello rainbowsally
This is the implementation of LaunchFile() in Functions4U:
bool LaunchFile(const char *_file) {
String file = UnixPath(_file);
int ret;
if (GetDesktopManagerNew() == "gnome")
ret = system("gnome-open \"" + String(file) + "\"");
else if (GetDesktopManagerNew() == "kde")
ret = system("kfmclient exec \"" + String(file) + "\" &");
else if (GetDesktopManagerNew() == "enlightenment") {
String mime = GetExtExecutable(GetFileExt(file));
String program = mime.Left(mime.Find(".")); // Left side of mime executable is the program to run
ret = system(program + " \"" + String(file) + "\" &");
} else
ret = system("xdg-open \"" + String(file) + "\"");
return (ret >= 0);
}
Please post the details of the system where you find the problems.
I'm using Linux Mint/KDE (but also have XFCE, no gnome at present).
I think you'll find that Fuctions4U is written by a Windows user guessing at how to make it work in Linux.
First of all, the /etc/mime.cfg or whatever it is doesn't exist in Mint nor in Open[sic]SUSE, and even if it did it would ignore the USER's preferences.
I hate launching Dolphin when I need Konqueror, for example.
It's just a suggestion. Both "start.exe %s" and "xdg-open %s..." could greatly simplify the code and it would work better.