[gedit] A bit of cleanup
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] A bit of cleanup
- Date: Thu, 3 Jun 2010 17:38:02 +0000 (UTC)
commit 388ded0ddc700e02c22c825a3b65f19fb10a2ca5
Author: Garrett Regier <alias301 gmail com>
Date: Thu Jun 3 10:32:18 2010 -0700
A bit of cleanup
gedit/gedit-document.c | 2 +-
gedit/gedit-session.c | 23 -----------------------
gedit/gedit-settings.c | 31 +++++++++++++------------------
gedit/gedit-window.h | 12 ++++++------
4 files changed, 20 insertions(+), 48 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 1921cac..18e58ad 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -503,7 +503,7 @@ gedit_document_class_init (GeditDocumentClass *klass)
g_object_class_install_property (object_class, PROP_LOCATION,
g_param_spec_object ("location",
- "LOCATION",
+ "Location",
"The document's location",
G_TYPE_FILE,
G_PARAM_READWRITE |
diff --git a/gedit/gedit-session.c b/gedit/gedit-session.c
index 989f47e..9a89696 100644
--- a/gedit/gedit-session.c
+++ b/gedit/gedit-session.c
@@ -386,29 +386,6 @@ static void
client_quit_cb (EggSMClient *client,
gpointer data)
{
-#if 0
- gedit_debug (DEBUG_SESSION);
-
- if (!client->save_yourself_emitted)
- gedit_file_close_all ();
-
- gedit_debug_message (DEBUG_FILE, "All files closed.");
-
- bonobo_mdi_destroy (BONOBO_MDI (gedit_mdi));
-
- gedit_debug_message (DEBUG_FILE, "Unref gedit_mdi.");
-
- g_object_unref (G_OBJECT (gedit_mdi));
-
- gedit_debug_message (DEBUG_FILE, "Unref gedit_mdi: DONE");
-
- gedit_debug_message (DEBUG_FILE, "Unref gedit_app_server.");
-
- bonobo_object_unref (gedit_app_server);
-
- gedit_debug_message (DEBUG_FILE, "Unref gedit_app_server: DONE");
-#endif
-
gtk_main_quit ();
}
diff --git a/gedit/gedit-settings.c b/gedit/gedit-settings.c
index 841cb98..52fe23e 100644
--- a/gedit/gedit-settings.c
+++ b/gedit/gedit-settings.c
@@ -918,20 +918,12 @@ gedit_settings_get_toolbar_style (GeditSettings *gs)
if (strcmp (str, "GEDIT_TOOLBAR_ICONS") == 0)
res = GEDIT_TOOLBAR_ICONS;
+ else if (strcmp (str, "GEDIT_TOOLBAR_ICONS_AND_TEXT") == 0)
+ res = GEDIT_TOOLBAR_ICONS_AND_TEXT;
+ else if (strcmp (str, "GEDIT_TOOLBAR_ICONS_BOTH_HORIZ") == 0)
+ res = GEDIT_TOOLBAR_ICONS_BOTH_HORIZ;
else
- {
- if (strcmp (str, "GEDIT_TOOLBAR_ICONS_AND_TEXT") == 0)
- {
- res = GEDIT_TOOLBAR_ICONS_AND_TEXT;
- }
- else
- {
- if (strcmp (str, "GEDIT_TOOLBAR_ICONS_BOTH_HORIZ") == 0)
- res = GEDIT_TOOLBAR_ICONS_BOTH_HORIZ;
- else
- res = GEDIT_TOOLBAR_SYSTEM;
- }
- }
+ res = GEDIT_TOOLBAR_SYSTEM;
g_free (str);
@@ -979,8 +971,10 @@ get_wrap_str (guint mode)
str = g_strdup ("GTK_WRAP_CHAR");
break;
- default: /* GTK_WRAP_WORD */
+ case GTK_WRAP_WORD:
+ default:
str = g_strdup ("GTK_WRAP_WORD");
+ break;
}
return str;
@@ -1004,12 +998,13 @@ gedit_settings_get_wrap_mode (GSettings *settings,
{
res = GTK_WRAP_NONE;
}
+ else if (strcmp (str, "GTK_WRAP_CHAR") == 0)
+ {
+ res = GTK_WRAP_CHAR;
+ }
else
{
- if (strcmp (str, "GTK_WRAP_CHAR") == 0)
- res = GTK_WRAP_CHAR;
- else
- res = GTK_WRAP_WORD;
+ res = GTK_WRAP_WORD;
}
g_free (str);
diff --git a/gedit/gedit-window.h b/gedit/gedit-window.h
index be86e4d..277c404 100644
--- a/gedit/gedit-window.h
+++ b/gedit/gedit-window.h
@@ -68,7 +68,7 @@ typedef struct _GeditWindowPrivate GeditWindowPrivate;
*/
typedef struct _GeditWindow GeditWindow;
-struct _GeditWindow
+struct _GeditWindow
{
GtkWindow window;
@@ -81,10 +81,10 @@ struct _GeditWindow
*/
typedef struct _GeditWindowClass GeditWindowClass;
-struct _GeditWindowClass
+struct _GeditWindowClass
{
GtkWindowClass parent_class;
-
+
/* Signals */
void (* tab_added) (GeditWindow *window,
GeditTab *tab);
@@ -104,7 +104,7 @@ GType gedit_window_get_type (void) G_GNUC_CONST;
GeditTab *gedit_window_create_tab (GeditWindow *window,
gboolean jump_to);
-
+
GeditTab *gedit_window_create_tab_from_location (GeditWindow *window,
GFile *location,
const GeditEncoding *encoding,
@@ -122,12 +122,12 @@ GeditTab *gedit_window_create_tab_from_stream (GeditWindow *window,
void gedit_window_close_tab (GeditWindow *window,
GeditTab *tab);
-
+
void gedit_window_close_all_tabs (GeditWindow *window);
void gedit_window_close_tabs (GeditWindow *window,
const GList *tabs);
-
+
GeditTab *gedit_window_get_active_tab (GeditWindow *window);
void gedit_window_set_active_tab (GeditWindow *window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]