[nautilus] nautilus-global-preferences: use 'extern' properly



commit 96554c2020b19c11eb065b24c9fc5457626c8bc2
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Jul 12 12:43:57 2013 -0400

    nautilus-global-preferences: use 'extern' properly
    
    Variables in header files should have 'extern' on them and be defined
    from a single .c file, otherwise you get a copy of the variable every
    time you #include the header.
    
    -fcommon masks this problem, but building with -fno-common fails because
    of it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704117

 libnautilus-private/nautilus-global-preferences.c |   11 +++++++++++
 libnautilus-private/nautilus-global-preferences.h |   20 ++++++++++----------
 2 files changed, 21 insertions(+), 10 deletions(-)
---
diff --git a/libnautilus-private/nautilus-global-preferences.c 
b/libnautilus-private/nautilus-global-preferences.c
index f259e6c..921e11b 100644
--- a/libnautilus-private/nautilus-global-preferences.c
+++ b/libnautilus-private/nautilus-global-preferences.c
@@ -34,6 +34,17 @@
 #include <eel/eel-string.h>
 #include <glib/gi18n.h>
 
+GSettings *nautilus_preferences;
+GSettings *nautilus_icon_view_preferences;
+GSettings *nautilus_list_view_preferences;
+GSettings *nautilus_desktop_preferences;
+GSettings *nautilus_window_state;
+GSettings *gtk_filechooser_preferences;
+GSettings *gnome_lockdown_preferences;
+GSettings *gnome_background_preferences;
+GSettings *gnome_interface_preferences;
+GSettings *gnome_privacy_preferences;
+
 /*
  * Public functions
  */
diff --git a/libnautilus-private/nautilus-global-preferences.h 
b/libnautilus-private/nautilus-global-preferences.h
index d6791b3..7f4ede5 100644
--- a/libnautilus-private/nautilus-global-preferences.h
+++ b/libnautilus-private/nautilus-global-preferences.h
@@ -164,16 +164,16 @@ typedef enum
 void nautilus_global_preferences_init                      (void);
 char *nautilus_global_preferences_get_default_folder_viewer_preference_as_iid (void);
 
-GSettings *nautilus_preferences;
-GSettings *nautilus_icon_view_preferences;
-GSettings *nautilus_list_view_preferences;
-GSettings *nautilus_desktop_preferences;
-GSettings *nautilus_window_state;
-GSettings *gtk_filechooser_preferences;
-GSettings *gnome_lockdown_preferences;
-GSettings *gnome_background_preferences;
-GSettings *gnome_interface_preferences;
-GSettings *gnome_privacy_preferences;
+extern GSettings *nautilus_preferences;
+extern GSettings *nautilus_icon_view_preferences;
+extern GSettings *nautilus_list_view_preferences;
+extern GSettings *nautilus_desktop_preferences;
+extern GSettings *nautilus_window_state;
+extern GSettings *gtk_filechooser_preferences;
+extern GSettings *gnome_lockdown_preferences;
+extern GSettings *gnome_background_preferences;
+extern GSettings *gnome_interface_preferences;
+extern GSettings *gnome_privacy_preferences;
 
 G_END_DECLS
 


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