Commit e2cb67b7 authored by Cosimo Cecchi's avatar Cosimo Cecchi
Browse files

prefs: don't listen to menus-have-tearoff GSettings key

This has been deprecated/obsolete for a while now.
parent aa0ad831
......@@ -45,13 +45,11 @@
/* desktop-wide settings */
#define GNOME_MONOSPACE_FONT_NAME "monospace-font-name"
#define GNOME_MENUS_HAVE_TEAROFF "menus-have-tearoff"
static LogviewPrefs *singleton = NULL;
enum {
SYSTEM_FONT_CHANGED,
HAVE_TEAROFF_CHANGED,
LAST_SIGNAL
};
......@@ -106,30 +104,10 @@ logview_prefs_class_init (LogviewPrefsClass *klass)
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
signals[HAVE_TEAROFF_CHANGED] = g_signal_new ("have-tearoff-changed",
G_OBJECT_CLASS_TYPE (oclass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (LogviewPrefsClass, have_tearoff_changed),
NULL, NULL,
g_cclosure_marshal_VOID__BOOLEAN,
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
g_type_class_add_private (klass, sizeof (LogviewPrefsPrivate));
}
static void
have_tearoff_changed_cb (GSettings *settings,
gchar *key,
gpointer data)
{
LogviewPrefs *prefs = data;
gboolean add_tearoffs;
add_tearoffs = g_settings_get_boolean (settings, key);
g_signal_emit (prefs, signals[HAVE_TEAROFF_CHANGED], 0, add_tearoffs, NULL);
}
static void
monospace_font_changed_cb (GSettings *settings,
gchar *key,
......@@ -310,8 +288,6 @@ logview_prefs_init (LogviewPrefs *self)
g_signal_connect (priv->interface_prefs, "changed::" GNOME_MONOSPACE_FONT_NAME,
G_CALLBACK (monospace_font_changed_cb), self);
g_signal_connect (priv->interface_prefs, "changed::" GNOME_MENUS_HAVE_TEAROFF,
G_CALLBACK (have_tearoff_changed_cb), self);
load_filters (self);
}
......@@ -365,14 +341,6 @@ logview_prefs_get_monospace_font_name (LogviewPrefs *prefs)
return (g_settings_get_string (prefs->priv->interface_prefs, GNOME_MONOSPACE_FONT_NAME));
}
gboolean
logview_prefs_get_have_tearoff (LogviewPrefs *prefs)
{
g_assert (LOGVIEW_IS_PREFS (prefs));
return (g_settings_get_boolean (prefs->priv->interface_prefs, GNOME_MENUS_HAVE_TEAROFF));
}
/* the elements should be freed with g_free () */
gchar **
......
......@@ -50,8 +50,6 @@ struct _LogviewPrefsClass {
/* signals */
void (* system_font_changed) (LogviewPrefs *prefs,
const char *font_name);
void (* have_tearoff_changed) (LogviewPrefs *prefs,
gboolean have_tearoff);
void (* filters_changed) (LogviewPrefs *prefs);
};
......@@ -65,7 +63,6 @@ void logview_prefs_store_window_size (LogviewPrefs *prefs,
void logview_prefs_get_stored_window_size (LogviewPrefs *prefs,
int *width, int *height);
char * logview_prefs_get_monospace_font_name (LogviewPrefs *prefs);
gboolean logview_prefs_get_have_tearoff (LogviewPrefs *prefs);
void logview_prefs_store_log (LogviewPrefs *prefs,
GFile *file);
void logview_prefs_remove_stored_log (LogviewPrefs *prefs,
......
......@@ -1100,16 +1100,6 @@ font_changed_cb (LogviewPrefs *prefs,
logview_set_font (window, font_name);
}
static void
tearoff_changed_cb (LogviewPrefs *prefs,
gboolean have_tearoffs,
gpointer user_data)
{
LogviewWindow *window = user_data;
gtk_ui_manager_set_add_tearoffs (window->priv->ui_manager, have_tearoffs);
}
static void
style_set_cb (GtkWidget *widget,
GtkStyle *prev,
......@@ -1300,9 +1290,6 @@ logview_window_init (LogviewWindow *logview)
return;
}
gtk_ui_manager_set_add_tearoffs (priv->ui_manager,
logview_prefs_get_have_tearoff (priv->prefs));
w = gtk_ui_manager_get_widget (priv->ui_manager, "/LogviewMenu");
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
gtk_widget_show (w);
......@@ -1414,8 +1401,6 @@ logview_window_init (LogviewWindow *logview)
G_CALLBACK (window_size_changed_cb), logview);
g_signal_connect (priv->prefs, "system-font-changed",
G_CALLBACK (font_changed_cb), logview);
g_signal_connect (priv->prefs, "have-tearoff-changed",
G_CALLBACK (tearoff_changed_cb), logview);
g_signal_connect (priv->manager, "active-changed",
G_CALLBACK (active_log_changed_cb), logview);
g_signal_connect (logview, "style-set",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment