enlightenment_filemanager now opens files as well.

unfortunately the e_fm code requires a window and icon, we have none
so there is some duplication of code.



SVN revision: 73301
This commit is contained in:
Gustavo Sverzut Barbieri 2012-07-04 19:11:23 +00:00
parent 7e255f8ad9
commit 6471c1be23
1 changed files with 8 additions and 2 deletions

View File

@ -37,6 +37,7 @@ fm_open(const char *path)
{ {
DBusMessage *msg; DBusMessage *msg;
Eina_Bool sent; Eina_Bool sent;
const char *method;
char *p; char *p;
if (path[0] == '/') if (path[0] == '/')
@ -71,10 +72,15 @@ fm_open(const char *path)
return; return;
} }
if (ecore_file_is_dir(p))
method = "OpenDirectory";
else
method = "OpenFile";
msg = dbus_message_new_method_call msg = dbus_message_new_method_call
("org.enlightenment.FileManager", ("org.enlightenment.FileManager",
"/org/enlightenment/FileManager", "/org/enlightenment/FileManager",
"org.enlightenment.FileManager", "OpenDirectory"); "org.enlightenment.FileManager", method);
if (!msg) if (!msg)
{ {
fputs("ERROR: Could not create DBus Message\n", stderr); fputs("ERROR: Could not create DBus Message\n", stderr);
@ -101,7 +107,7 @@ fm_open(const char *path)
static const Ecore_Getopt options = { static const Ecore_Getopt options = {
"enlightenment_filemanager", "enlightenment_filemanager",
"%prog [options] [folder1] ... [folderN]", "%prog [options] [file-or-folder1] ... [file-or-folderN]",
PACKAGE_VERSION, PACKAGE_VERSION,
"(C) 2012 Gustavo Sverzut Barbieri and others", "(C) 2012 Gustavo Sverzut Barbieri and others",
"BSD 2-Clause", "BSD 2-Clause",