Lines Matching refs:info
70 static gboolean g_desktop_app_info_ensure_saved (GDesktopAppInfo *info,
143 GDesktopAppInfo *info;
145 info = G_DESKTOP_APP_INFO (object);
147 g_free (info->desktop_id);
148 g_free (info->filename);
149 g_free (info->name);
150 g_free (info->comment);
151 g_free (info->icon_name);
152 if (info->icon)
153 g_object_unref (info->icon);
154 g_strfreev (info->only_show_in);
155 g_strfreev (info->not_show_in);
156 g_free (info->try_exec);
157 g_free (info->exec);
158 g_free (info->binary);
159 g_free (info->path);
206 GDesktopAppInfo *info;
246 info = g_object_new (G_TYPE_DESKTOP_APP_INFO, NULL);
247 info->filename = NULL;
249 info->name = g_key_file_get_locale_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NAME, NULL, NULL);
250 info->comment = g_key_file_get_locale_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_COMMENT, NULL, NULL);
251 info->nodisplay = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, NULL) != FALSE;
252 info->icon_name = g_key_file_get_locale_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, NULL, NULL);
253 info->only_show_in = g_key_file_get_string_list (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN, NULL, NULL);
254 info->not_show_in = g_key_file_get_string_list (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN, NULL, NULL);
255 info->try_exec = try_exec;
256 info->exec = g_key_file_get_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_EXEC, NULL);
257 info->path = g_key_file_get_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_PATH, NULL);
258 info->terminal = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_TERMINAL, NULL) != FALSE;
259 info->startup_notify = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY, NULL) != FALSE;
260 info->no_fuse = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, "X-GIO-NoFuse", NULL) != FALSE;
261 info->hidden = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_HIDDEN, NULL) != FALSE;
263 info->icon = NULL;
264 if (info->icon_name)
266 if (g_path_is_absolute (info->icon_name))
270 file = g_file_new_for_path (info->icon_name);
271 info->icon = g_file_icon_new (file);
279 if ((p = strrchr (info->icon_name, '.')) != NULL &&
285 info->icon = g_themed_icon_new (info->icon_name);
289 if (info->exec)
290 info->binary = binary_from_exec (info->exec);
292 if (info->path && info->path[0] == '\0')
294 g_free (info->path);
295 info->path = NULL;
298 return info;
313 GDesktopAppInfo *info = NULL;
322 info = g_desktop_app_info_new_from_keyfile (key_file);
323 if (info)
324 info->filename = g_strdup (filename);
329 return info;
408 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
413 new_info->filename = g_strdup (info->filename);
414 new_info->desktop_id = g_strdup (info->desktop_id);
416 new_info->name = g_strdup (info->name);
417 new_info->comment = g_strdup (info->comment);
418 new_info->nodisplay = info->nodisplay;
419 new_info->icon_name = g_strdup (info->icon_name);
420 if (info->icon)
421 new_info->icon = g_object_ref (info->icon);
422 new_info->only_show_in = g_strdupv (info->only_show_in);
423 new_info->not_show_in = g_strdupv (info->not_show_in);
424 new_info->try_exec = g_strdup (info->try_exec);
425 new_info->exec = g_strdup (info->exec);
426 new_info->binary = g_strdup (info->binary);
427 new_info->path = g_strdup (info->path);
428 new_info->hidden = info->hidden;
429 new_info->terminal = info->terminal;
430 new_info->startup_notify = info->startup_notify;
452 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
454 return info->desktop_id;
460 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
462 if (info->name == NULL)
464 return info->name;
469 * @info: a #GDesktopAppInfo.
477 g_desktop_app_info_get_is_hidden (GDesktopAppInfo *info)
479 return info->hidden;
485 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
487 return info->comment;
493 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
495 return info->binary;
501 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
503 return info->exec;
509 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
511 return info->icon;
564 GDesktopAppInfo *info,
582 if (!info->no_fuse)
667 if (info->icon_name)
670 g_string_append (exec, info->icon_name);
675 if (info->name)
676 g_string_append (exec, info->name);
680 if (info->filename)
681 g_string_append (exec, info->filename);
696 expand_application_parameters (GDesktopAppInfo *info,
703 const char *p = info->exec;
707 if (info->exec == NULL)
718 expand_macro (p[1], expanded_exec, info, uris);
732 expand_macro ('f', expanded_exec, info, uris);
979 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
997 if (!expand_application_parameters (info, &uris,
1001 if (info->terminal && !prepend_terminal_to_vector (&argc, &argv))
1018 if (info->startup_notify)
1049 if (!g_spawn_async (info->path, /* working directory */
1088 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
1090 return info->exec &&
1091 ((strstr (info->exec, "%u") != NULL) ||
1092 (strstr (info->exec, "%U") != NULL));
1098 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
1100 return info->exec &&
1101 ((strstr (info->exec, "%f") != NULL) ||
1102 (strstr (info->exec, "%F") != NULL));
1169 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
1174 if (info->nodisplay)
1181 if (info->only_show_in)
1187 for (i = 0; info->only_show_in[i] != NULL; i++)
1189 if (strcmp (info->only_show_in[i], desktop_env) == 0)
1199 if (info->not_show_in && desktop_env)
1201 for (i = 0; info->not_show_in[i] != NULL; i++)
1203 if (strcmp (info->not_show_in[i], desktop_env) == 0)
1436 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
1438 if (!g_desktop_app_info_ensure_saved (info, error))
1441 return update_mimeapps_list (info->desktop_id, content_type, TRUE, FALSE, FALSE, error);
1525 "<mime-info xmlns=\"http://www.freedesktop.org/standards/shared-mime-info\">\n"
1530 "</mime-info>\n", mimetype, extension, extension);
1553 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
1555 if (!g_desktop_app_info_ensure_saved (G_DESKTOP_APP_INFO (info), error))
1558 return update_mimeapps_list (info->desktop_id, content_type, FALSE, TRUE, FALSE, error);
1572 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
1574 if (!g_desktop_app_info_ensure_saved (G_DESKTOP_APP_INFO (info), error))
1577 return update_mimeapps_list (info->desktop_id, content_type, FALSE, FALSE, TRUE, error);
1581 g_desktop_app_info_ensure_saved (GDesktopAppInfo *info,
1592 if (info->filename != NULL)
1613 if (info->terminal)
1618 G_KEY_FILE_DESKTOP_KEY_EXEC, info->exec);
1621 G_KEY_FILE_DESKTOP_KEY_NAME, info->name);
1624 G_KEY_FILE_DESKTOP_KEY_COMMENT, info->comment);
1632 desktop_id = g_strdup_printf ("userapp-%s-XXXXXX.desktop", info->name);
1663 info->filename = filename;
1664 info->desktop_id = desktop_id;
1674 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
1676 if (info->filename)
1678 if (strstr (info->filename, "/userapp-"))
1679 return g_access (info->filename, W_OK) == 0;
1688 GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
1690 if (info->filename)
1692 if (g_remove (info->filename) == 0)
1694 update_mimeapps_list (info->desktop_id, NULL, FALSE, FALSE, FALSE, NULL);
1696 g_free (info->filename);
1697 info->filename = NULL;
1698 g_free (info->desktop_id);
1699 info->desktop_id = NULL;
1727 GDesktopAppInfo *info;
1729 info = g_object_new (G_TYPE_DESKTOP_APP_INFO, NULL);
1731 info->filename = NULL;
1732 info->desktop_id = NULL;
1734 info->terminal = flags & G_APP_INFO_CREATE_NEEDS_TERMINAL;
1735 info->startup_notify = FALSE;
1736 info->hidden = FALSE;
1738 info->exec = g_strconcat (commandline, " %u", NULL);
1740 info->exec = g_strconcat (commandline, " %f", NULL);
1741 info->nodisplay = TRUE;
1742 info->binary = binary_from_exec (info->exec);
1745 info->name = g_strdup (application_name);
1752 info->name = basename;
1753 if (info->name == NULL)
1754 info->name = g_strdup ("custom");
1756 info->comment = g_strdup_printf (_("Custom definition for %s"), info->name);
1758 return G_APP_INFO (info);
1787 app_info_in_list (GAppInfo *info,
1792 if (g_app_info_equal (info, list->data))
1814 GDesktopAppInfo *info;
1825 info = g_desktop_app_info_new (desktop_entry);
1826 if (info)
1828 if (app_info_in_list (G_APP_INFO (info), infos))
1829 g_object_unref (info);
1831 infos = g_list_prepend (infos, info);
1873 GAppInfo *info;
1879 info = NULL;
1884 info = (GAppInfo *)g_desktop_app_info_new (desktop_entry);
1885 if (info)
1887 if (must_support_uris && !g_app_info_supports_uris (info))
1889 g_object_unref (info);
1890 info = NULL;
1900 return info;