diff options
author | Antenore Gatta <antenore@simbiosi.org> | 2018-08-29 22:25:19 +0300 |
---|---|---|
committer | Antenore Gatta <antenore@simbiosi.org> | 2018-08-29 22:25:19 +0300 |
commit | 00e469aba85141cfc7bdcf70206ad138540d7b7a (patch) | |
tree | ecc212ec8079936739899998bf76ce6920bf4361 | |
parent | 61904a46d29ac8ccf07b010aac22c00a06dfc259 (diff) |
Force program name to app id
-rw-r--r-- | src/remmina.c | 3 | ||||
-rw-r--r-- | src/remmina_file_manager.c | 21 | ||||
-rw-r--r-- | src/remmina_pref.c | 16 | ||||
-rw-r--r-- | src/remmina_pref_dialog.c | 2 | ||||
-rw-r--r-- | src/remmina_ssh_plugin.c | 10 |
5 files changed, 27 insertions, 25 deletions
diff --git a/src/remmina.c b/src/remmina.c index cd25ed17c..0dc69df3e 100644 --- a/src/remmina.c +++ b/src/remmina.c @@ -292,6 +292,9 @@ int main(int argc, char* argv[]) app_id = g_application_id_is_valid(REMMINA_APP_ID) ? REMMINA_APP_ID : NULL; app = gtk_application_new(app_id, G_APPLICATION_HANDLES_COMMAND_LINE); +#if !GTK_CHECK_VERSION(4, 0, 0) /* This is not needed anymore starting from Gtk+ 4 */ + g_set_prgname(app_id); +#endif g_signal_connect(app, "startup", G_CALLBACK(remmina_on_startup), NULL); g_signal_connect(app, "command-line", G_CALLBACK(remmina_on_command_line), NULL); g_signal_connect(app, "handle-local-options", G_CALLBACK(remmina_on_local_cmdline), NULL); diff --git a/src/remmina_file_manager.c b/src/remmina_file_manager.c index 55ac2177c..d455a9381 100644 --- a/src/remmina_file_manager.c +++ b/src/remmina_file_manager.c @@ -53,16 +53,15 @@ static gchar *cachedir; gchar *remmina_file_get_datadir(void) { TRACE_CALL(__func__); - gchar *dir = g_strdup_printf(".%s", g_get_prgname()); + const gchar *dir = ".remmina"; int i; /* Legacy ~/.remmina */ remminadir = g_build_path("/", g_get_home_dir(), dir, NULL); - g_free(dir); if (g_file_test(remminadir, G_FILE_TEST_IS_DIR)) return remminadir; g_free(remminadir), remminadir = NULL; /* ~/.local/share/remmina */ - remminadir = g_build_path( "/", g_get_user_data_dir(), g_get_prgname(), NULL); + remminadir = g_build_path( "/", g_get_user_data_dir(), "remmina", NULL); if (g_file_test(remminadir, G_FILE_TEST_IS_DIR)) return remminadir; g_free(remminadir), remminadir = NULL; @@ -70,13 +69,13 @@ gchar *remmina_file_get_datadir(void) const gchar * const *dirs = g_get_system_data_dirs(); g_free(remminadir), remminadir = NULL; for (i = 0; dirs[i] != NULL; ++i) { - remminadir = g_build_path( "/", dirs[i], g_get_prgname(), NULL); + remminadir = g_build_path( "/", dirs[i], "remmina", NULL); if (g_file_test(remminadir, G_FILE_TEST_IS_DIR)) return remminadir; g_free(remminadir), remminadir = NULL; } /* The last case we use the home ~/.local/share/remmina */ - remminadir = g_build_path( "/", g_get_user_data_dir(), g_get_prgname(), NULL); + remminadir = g_build_path( "/", g_get_user_data_dir(), "remmina", NULL); return remminadir; } @@ -97,16 +96,16 @@ void remmina_file_manager_init(void) { TRACE_CALL(__func__); GDir *dir; - gchar *legacy = g_strdup_printf(".%s", g_get_prgname()); + const gchar *legacy = ".remmina"; const gchar *filename; int i; - remminadir = g_build_path( "/", g_get_user_data_dir(), g_get_prgname(), NULL); + remminadir = g_build_path( "/", g_get_user_data_dir(), "remmina", NULL); /* Create the XDG_USER_DATA directory */ g_mkdir_with_parents(remminadir, 0750); g_free(remminadir), remminadir = NULL; /* Create the XDG_CACHE_HOME directory */ - cachedir = g_build_path( "/", g_get_user_cache_dir(), g_get_prgname(), NULL); + cachedir = g_build_path( "/", g_get_user_cache_dir(), "remmina", NULL); g_mkdir_with_parents(cachedir, 0750); g_free(cachedir), cachedir = NULL; /* Empty legacy ~/.remmina */ @@ -117,7 +116,7 @@ void remmina_file_manager_init(void) remmina_file_manager_do_copy( g_build_path( "/", remminadir, filename, NULL), g_build_path( "/", g_get_user_data_dir(), - g_get_prgname(), filename, NULL)); + "remmina", filename, NULL)); } } @@ -125,14 +124,14 @@ void remmina_file_manager_init(void) const gchar * const *dirs = g_get_system_data_dirs(); g_free(remminadir), remminadir = NULL; for (i = 0; dirs[i] != NULL; ++i) { - remminadir = g_build_path( "/", dirs[i], g_get_prgname(), NULL); + remminadir = g_build_path( "/", dirs[i], "remmina", NULL); if (g_file_test(remminadir, G_FILE_TEST_IS_DIR)) { dir = g_dir_open(remminadir, 0, NULL); while ((filename = g_dir_read_name(dir)) != NULL) { remmina_file_manager_do_copy( g_build_path( "/", remminadir, filename, NULL), g_build_path( "/", g_get_user_data_dir(), - g_get_prgname(), filename, NULL)); + "remmina", filename, NULL)); } } g_free(remminadir), remminadir = NULL; diff --git a/src/remmina_pref.c b/src/remmina_pref.c index fedf81af1..4a1e16106 100644 --- a/src/remmina_pref.c +++ b/src/remmina_pref.c @@ -221,14 +221,14 @@ void remmina_pref_init(void) TRACE_CALL(__func__); GKeyFile *gkeyfile; gchar *remmina_dir; - const gchar *filename = g_strdup_printf("%s.pref", g_get_prgname()); - const gchar *colors_filename = g_strdup_printf("%s.colors", g_get_prgname()); + const gchar *filename = "remmina.pref"; + const gchar *colors_filename = "remmina.colors"; gchar *remmina_colors_file; GDir *dir; - gchar *legacy = g_strdup_printf(".%s", g_get_prgname()); + gchar *legacy = ".remmina"; int i; - remmina_dir = g_build_path( "/", g_get_user_config_dir(), g_get_prgname(), NULL); + remmina_dir = g_build_path( "/", g_get_user_config_dir(), "remmina", NULL); /* Create the XDG_CONFIG_HOME directory */ g_mkdir_with_parents(remmina_dir, 0750); @@ -241,21 +241,21 @@ void remmina_pref_init(void) remmina_pref_file_do_copy( g_build_path( "/", remmina_dir, filename, NULL), g_build_path( "/", g_get_user_config_dir(), - g_get_prgname(), filename, NULL)); + "remmina", filename, NULL)); } /* /usr/local/etc/remmina */ const gchar * const *dirs = g_get_system_config_dirs(); g_free(remmina_dir), remmina_dir = NULL; for (i = 0; dirs[i] != NULL; ++i) { - remmina_dir = g_build_path( "/", dirs[i], g_get_prgname(), NULL); + remmina_dir = g_build_path( "/", dirs[i], "remmina", NULL); if (g_file_test(remmina_dir, G_FILE_TEST_IS_DIR)) { dir = g_dir_open(remmina_dir, 0, NULL); while ((filename = g_dir_read_name(dir)) != NULL) { remmina_pref_file_do_copy( g_build_path( "/", remmina_dir, filename, NULL), g_build_path( "/", g_get_user_config_dir(), - g_get_prgname(), filename, NULL)); + "remmina", filename, NULL)); } g_free(remmina_dir), remmina_dir = NULL; } @@ -265,7 +265,7 @@ void remmina_pref_init(void) if (remmina_dir != NULL) g_free(remmina_dir), remmina_dir = NULL; remmina_dir = g_build_path( "/", g_get_user_config_dir(), - g_get_prgname(), NULL); + "remmina", NULL); remmina_pref_file = g_strdup_printf("%s/remmina.pref", remmina_dir); /* remmina.colors */ diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c index 5a374cbf6..5fe3f1457 100644 --- a/src/remmina_pref_dialog.c +++ b/src/remmina_pref_dialog.c @@ -101,7 +101,7 @@ void remmina_pref_on_color_scheme_selected(GtkWidget *widget, gpointer user_data sourcepath = gtk_file_chooser_get_filename(remmina_pref_dialog->button_term_cs); source = g_file_new_for_path(sourcepath); - remmina_dir = g_build_path( "/", g_get_user_config_dir(), g_get_prgname(), NULL); + remmina_dir = g_build_path( "/", g_get_user_config_dir(), "remmina", NULL); /* /home/foo/.config/remmina */ destpath = g_strdup_printf("%s/remmina.colors", remmina_dir); destination = g_file_new_for_path(destpath); diff --git a/src/remmina_ssh_plugin.c b/src/remmina_ssh_plugin.c index a42ac8cc4..c6afa7431 100644 --- a/src/remmina_ssh_plugin.c +++ b/src/remmina_ssh_plugin.c @@ -630,7 +630,7 @@ remmina_plugin_ssh_init(RemminaProtocolWidget *gp) */ const gchar *color_name = remmina_plugin_service->file_get_string(remminafile, "ssh_color_scheme"); - gchar *remmina_dir = g_build_path( "/", g_get_user_config_dir(), g_get_prgname(), "theme", NULL); + gchar *remmina_dir = g_build_path( "/", g_get_user_config_dir(), "remmina", "theme", NULL); gchar *remmina_colors_file = g_strdup_printf("%s/%s.colors", remmina_dir, color_name); g_free(remmina_dir); @@ -643,7 +643,7 @@ remmina_plugin_ssh_init(RemminaProtocolWidget *gp) unsigned int i = 0; for (i = 0; dirs[i] != NULL; ++i) { - remmina_dir = g_build_path("/", dirs[i], g_get_prgname(), "theme", NULL); + remmina_dir = g_build_path("/", dirs[i], "remmina", "theme", NULL); GDir *system_data_dir = g_dir_open(remmina_dir, 0, &error); // ignoring this error is ok, because the folder may not existing if (error) { @@ -820,7 +820,7 @@ remmina_plugin_ssh_init(RemminaProtocolWidget *gp) rf = g_file_new_for_path(remminafile->filename); if (remmina_plugin_service->file_get_string(remminafile, "sshlogfolder") == NULL) { - dir = g_build_path( "/", g_get_user_cache_dir(), g_get_prgname(), NULL); + dir = g_build_path( "/", g_get_user_cache_dir(), "remmina", NULL); }else { dir = remmina_plugin_service->file_get_string(remminafile, "sshlogfolder"); } @@ -1149,7 +1149,7 @@ remmina_ssh_plugin_load_terminal_palettes(gpointer *ssh_terminal_palette_new) unsigned int i = 0; for (i = 0; dirs[i] != NULL; ++i) { GDir *system_data_dir = NULL; - gchar *remmina_dir = g_build_path("/", dirs[i], g_get_prgname(), "theme", NULL); + gchar *remmina_dir = g_build_path("/", dirs[i], "remmina", "theme", NULL); system_data_dir = g_dir_open(remmina_dir, 0, &error); g_free(remmina_dir); // ignoring this error is ok, because the folder may not existing @@ -1175,7 +1175,7 @@ remmina_ssh_plugin_load_terminal_palettes(gpointer *ssh_terminal_palette_new) } /* ~/.config/remmina/colors */ - gchar *remmina_dir = g_build_path( "/", g_get_user_config_dir(), g_get_prgname(), "theme", NULL); + gchar *remmina_dir = g_build_path( "/", g_get_user_config_dir(), "remmina", "theme", NULL); GDir *user_data_dir; user_data_dir = g_dir_open(remmina_dir, 0, &error); g_free(remmina_dir); |