Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » Linux "start" equivalent (Need to launch an executable?)
Re: Linux "start" equivalent [message #44080 is a reply to message #44077] Tue, 23 December 2014 09:51 Go to previous messageGo to previous message
rainbowsally is currently offline  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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problems with OfficeAutomation (Solved)
Next Topic: Docking files in bazaar and uppsrc differ
Goto Forum:
  


Current Time: Sun May 05 01:54:55 CEST 2024

Total time taken to generate the page: 0.03076 seconds