summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-03-26 15:36:48 -0700
committerStefano Karapetsas <[email protected]>2013-03-26 15:36:48 -0700
commit1531a0802ed66cb5eb86ebe062aa26ea87b793d9 (patch)
tree3ee90d91bf3bbecd48bf1bb3d8b4f33f599c4cfb
parent7140bd291b202d6cc87264f949d687a26a4e0f25 (diff)
parent4f7f15a07beb0a1e0a5eea6e02c6ce0f0ff9aec7 (diff)
downloadmate-terminal-1531a0802ed66cb5eb86ebe062aa26ea87b793d9.tar.bz2
mate-terminal-1531a0802ed66cb5eb86ebe062aa26ea87b793d9.tar.xz
Merge pull request #21 from rezso/master
check schema installation before using it
-rw-r--r--src/terminal-screen.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index b71bdb4..049add3 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <sys/wait.h>
+#include <gio/gio.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
@@ -1360,6 +1361,8 @@ get_child_environment (TerminalScreen *screen,
GHashTableIter iter;
GPtrArray *retval;
guint i;
+ const char * const *list_schemas;
+ gboolean schema_exists;
window = gtk_widget_get_toplevel (term);
g_assert (window != NULL);
@@ -1400,7 +1403,18 @@ get_child_environment (TerminalScreen *screen,
g_hash_table_replace (env_table, g_strdup ("DISPLAY"), g_strdup (gdk_display_get_name (gtk_widget_get_display (window))));
#endif
- terminal_util_add_proxy_env (env_table);
+ list_schemas = g_settings_list_schemas();
+ schema_exists = FALSE;
+ for (i = 0; list_schemas[i] != NULL; i++) {
+ if (g_strcmp0 (list_schemas[i], "org.gnome.system.proxy") == 0)
+ {
+ schema_exists = TRUE;
+ break;
+ }
+ }
+ if (schema_exists == TRUE) {
+ terminal_util_add_proxy_env (env_table);
+ }
retval = g_ptr_array_sized_new (g_hash_table_size (env_table));
g_hash_table_iter_init (&iter, env_table);