[gnome-commander: 156/170] Add GAppInfo member to GnomeCmdApp type
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander: 156/170] Add GAppInfo member to GnomeCmdApp type
- Date: Wed, 23 Dec 2020 23:52:33 +0000 (UTC)
commit 6c78ac7c0d22e150581697119b9c44fd0589db99
Author: Uwe Scholz <u scholz83 gmx de>
Date: Tue Dec 22 23:53:09 2020 +0100
Add GAppInfo member to GnomeCmdApp type
src/dialogs/gnome-cmd-options-dialog.cc | 2 +-
src/gnome-cmd-app.cc | 18 ++++++++++--------
src/gnome-cmd-app.h | 4 +++-
src/gnome-cmd-data.cc | 2 +-
4 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-options-dialog.cc b/src/dialogs/gnome-cmd-options-dialog.cc
index 0dd39977..506d5867 100644
--- a/src/dialogs/gnome-cmd-options-dialog.cc
+++ b/src/dialogs/gnome-cmd-options-dialog.cc
@@ -1374,7 +1374,7 @@ static void on_add_app_dialog_ok (GtkButton *button, GtkWidget *dialog)
GnomeCmdApp *app = gnome_cmd_app_new_with_values (name, cmd, icon_path,
(AppTarget) target,
pattern_string,
- handles_uris, handles_multiple, requires_terminal);
+ handles_uris, handles_multiple, requires_terminal,
nullptr);
gnome_cmd_data.options.add_fav_app(app);
add_app_to_list (GTK_CLIST (clist), app);
gtk_widget_destroy (dialog);
diff --git a/src/gnome-cmd-app.cc b/src/gnome-cmd-app.cc
index e8c51d52..a1b21c2f 100644
--- a/src/gnome-cmd-app.cc
+++ b/src/gnome-cmd-app.cc
@@ -53,7 +53,8 @@ GnomeCmdApp *gnome_cmd_app_new_with_values (const gchar *name,
const gchar *pattern_string,
gboolean handles_uris,
gboolean handles_multiple,
- gboolean requires_terminal)
+ gboolean requires_terminal,
+ GAppInfo *gAppInfo)
{
GnomeCmdApp *app = gnome_cmd_app_new ();
@@ -66,6 +67,7 @@ GnomeCmdApp *gnome_cmd_app_new_with_values (const gchar *name,
gnome_cmd_app_set_handles_uris (app, handles_uris);
gnome_cmd_app_set_handles_multiple (app, handles_multiple);
gnome_cmd_app_set_requires_terminal (app, requires_terminal);
+ app->gAppInfo = gAppInfo;
return app;
}
@@ -134,7 +136,8 @@ GnomeCmdApp *gnome_cmd_app_new_from_vfs_app (GnomeVFSMimeApplication *vfs_app)
nullptr,
vfs_app->expects_uris ==
GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS,
vfs_app->can_open_multiple_files,
- vfs_app->requires_terminal);
+ vfs_app->requires_terminal,
+ nullptr);
g_free (icon);
return rel_value;
}
@@ -144,17 +147,15 @@ GnomeCmdApp *gnome_cmd_app_new_from_app_info (GAppInfo *gAppInfo)
{
g_return_val_if_fail (gAppInfo != nullptr, nullptr);
- GtkIconTheme *theme = gtk_icon_theme_get_default ();
-
- GnomeCmdApp *rel_value = gnome_cmd_app_new_with_values (g_app_info_get_name (gAppInfo),
+ return gnome_cmd_app_new_with_values (g_app_info_get_name (gAppInfo),
g_app_info_get_commandline (gAppInfo),
get_default_application_icon_path(gAppInfo),
APP_TARGET_ALL_FILES,
nullptr,
g_app_info_supports_uris (gAppInfo),
true,
- false);
- return rel_value;
+ false,
+ gAppInfo);
}
@@ -167,7 +168,8 @@ GnomeCmdApp *gnome_cmd_app_dup (GnomeCmdApp *app)
app->pattern_string,
app->handles_uris,
app->handles_multiple,
- app->requires_terminal);
+ app->requires_terminal,
+ app->gAppInfo);
}
diff --git a/src/gnome-cmd-app.h b/src/gnome-cmd-app.h
index 75a6d406..4e19be97 100644
--- a/src/gnome-cmd-app.h
+++ b/src/gnome-cmd-app.h
@@ -38,6 +38,7 @@ struct GnomeCmdApp
gchar *name;
gchar *cmd;
gchar *icon_path;
+ GAppInfo *gAppInfo;
AppTarget target;
gchar *pattern_string;
@@ -62,7 +63,8 @@ GnomeCmdApp *gnome_cmd_app_new_with_values (const gchar *name,
const gchar *pattern_string,
gboolean handles_uris,
gboolean handles_multiple,
- gboolean requires_terminal);
+ gboolean requires_terminal,
+ GAppInfo *gAppInfo);
GnomeCmdApp *gnome_cmd_app_dup (GnomeCmdApp *app);
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index af73f583..fb683a60 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -2425,7 +2425,7 @@ void GnomeCmdData::load_fav_apps()
gnome_cmd_data.options.fav_apps,
gnome_cmd_app_new_with_values (
name, command, iconPath, (AppTarget) target, pattern,
- handlesUris, handlesMutiple, requiresTerminal));
+ handlesUris, handlesMutiple, requiresTerminal, nullptr));
g_variant_unref(favApp);
g_free (name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]