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); }
Report message to a moderator