1
1

2000-03-13 Miguel de Icaza <miguel@helixcode.com>

* gaction.c (gmc_open_filename): Usae open.flags to determine
	whether we need a terminal.
	(gmc_open_filename): Fix the logic to make it work properly with
	.desktop and .kdelnk files.
Этот коммит содержится в:
Miguel de Icaza 2000-03-18 13:07:12 +00:00
родитель e0d1cc5c2c
Коммит 073044cd9c
2 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,10 @@
2000-03-13 Miguel de Icaza <miguel@helixcode.com>
* gaction.c (gmc_open_filename): Usae open.flags to determine
whether we need a terminal.
(gmc_open_filename): Fix the logic to make it work properly with
.desktop and .kdelnk files.
2000-02-03 Pavel Machek <pavel@artax.karlin.mff.cuni.cz> 2000-02-03 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
* gicon.c (gicon_init): make missing icons back fatal (prevents * gicon.c (gicon_init): make missing icons back fatal (prevents

Просмотреть файл

@ -115,6 +115,7 @@ gmc_open_filename (char *fname, GList *args)
mime_type = gnome_mime_type_or_default_of_file (fname, NULL); mime_type = gnome_mime_type_or_default_of_file (fname, NULL);
else else
mime_type = gnome_mime_type_or_default (fname, NULL); mime_type = gnome_mime_type_or_default (fname, NULL);
/* /*
* We accept needs_terminal as -1, which means our caller * We accept needs_terminal as -1, which means our caller
* did not want to do the work * did not want to do the work
@ -122,12 +123,13 @@ gmc_open_filename (char *fname, GList *args)
if (gnome_metadata_get (fname, "flags", &size, &buf) == 0){ if (gnome_metadata_get (fname, "flags", &size, &buf) == 0){
needs_terminal = (strstr (buf, "needsterminal") != 0); needs_terminal = (strstr (buf, "needsterminal") != 0);
g_free (buf); g_free (buf);
buf = NULL;
} else if (mime_type) } else if (mime_type)
needs_terminal = gnome_mime_needsterminal (mime_type, NULL); needs_terminal = gnome_mime_needsterminal (mime_type, "open.flags");
if (gnome_metadata_get (fname, "fm-open", &size, &buf) != 0) { if (gnome_metadata_get (fname, "fm-open", &size, &buf) != 0)
gnome_metadata_get (fname, "open", &size, &buf); gnome_metadata_get (fname, "open", &size, &buf);
}
if (buf) { if (buf) {
if (gmc_check_exec_string (buf)) if (gmc_check_exec_string (buf))
gmc_execute (fname, buf, needs_terminal); gmc_execute (fname, buf, needs_terminal);
@ -136,6 +138,7 @@ gmc_open_filename (char *fname, GList *args)
g_free (buf); g_free (buf);
return 1; return 1;
} }
if (!mime_type) if (!mime_type)
return 0; return 0;
@ -152,10 +155,12 @@ gmc_open_filename (char *fname, GList *args)
return 1; return 1;
} }
if (strcmp (mime_type, "application/x-gnome-app-info") == 0){ if ((strcmp (mime_type, "application/x-gnome-app-info") == 0) ||
(strcmp (mime_type, "application/x-kde-app-info") == 0)){
GnomeDesktopEntry *entry; GnomeDesktopEntry *entry;
entry = gnome_desktop_entry_load (fname); entry = gnome_desktop_entry_load (fname);
if (entry){ if (entry){
gnome_desktop_entry_launch (entry); gnome_desktop_entry_launch (entry);
gnome_desktop_entry_free (entry); gnome_desktop_entry_free (entry);
@ -165,6 +170,7 @@ gmc_open_filename (char *fname, GList *args)
return 1; return 1;
} }
} }
/* We just struck out. Prompt the user. */ /* We just struck out. Prompt the user. */
return 0; return 0;
} }