gnome-terminal r3373 - trunk/src



Author: chpe
Date: Thu Mar 19 13:48:21 2009
New Revision: 3373
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=3373&view=rev

Log:
Don't use 0 as error domain

Modified:
   trunk/src/terminal-options.c
   trunk/src/terminal-options.h

Modified: trunk/src/terminal-options.c
==============================================================================
--- trunk/src/terminal-options.c	(original)
+++ trunk/src/terminal-options.c	Thu Mar 19 13:48:21 2009
@@ -496,7 +496,8 @@
 
   if (options->config_file)
     {
-      g_set_error (error, 0, 0, "X"); /* FIXME */
+      g_set_error_literal (error, TERMINAL_OPTION_ERROR, TERMINAL_OPTION_ERROR_EXCLUSIVE_OPTIONS,
+                           "Options \"--load-config\" and \"--save-config\" are mutually exclusive");
       return FALSE;
     }
 
@@ -770,7 +771,8 @@
 
   if (!g_key_file_has_group (key_file, TERMINAL_CONFIG_GROUP))
     {
-      g_set_error_literal (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND,
+      g_set_error_literal (error, TERMINAL_OPTION_ERROR,
+                           TERMINAL_OPTION_ERROR_INVALID_CONFIG_FILE,
                            _("Not a valid terminal config file."));
       return FALSE;
     }
@@ -782,7 +784,8 @@
       compat_version <= 0 ||
       compat_version > TERMINAL_CONFIG_COMPAT_VERSION)
     {
-      g_set_error_literal (error, 0 /* FIXME */, 0,
+      g_set_error_literal (error, TERMINAL_OPTION_ERROR,
+                           TERMINAL_OPTION_ERROR_INCOMPATIBLE_CONFIG_FILE,
                            _("Incompatible terminal config file version."));
       return FALSE;
     }

Modified: trunk/src/terminal-options.h
==============================================================================
--- trunk/src/terminal-options.h	(original)
+++ trunk/src/terminal-options.h	Thu Mar 19 13:48:21 2009
@@ -81,6 +81,14 @@
 
 } InitialWindow;
 
+#define TERMINAL_OPTION_ERROR (g_quark_from_static_string ("terminal-option-error"))
+
+typedef enum {
+  TERMINAL_OPTION_ERROR_EXCLUSIVE_OPTIONS,
+  TERMINAL_OPTION_ERROR_INVALID_CONFIG_FILE,
+  TERMINAL_OPTION_ERROR_INCOMPATIBLE_CONFIG_FILE
+} TerminalOptionError;
+
 TerminalOptions *terminal_options_parse (const char *working_directory,
                                          const char *display_name,
                                          const char *startup_id,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]