[rhythmbox] library: handle settings changes before preferences widgets exist



commit bb5c77015354e4c9ae456edcf70b5368af778ad3
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sun May 5 11:57:42 2013 +1000

    library: handle settings changes before preferences widgets exist

 sources/rb-library-source.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/sources/rb-library-source.c b/sources/rb-library-source.c
index a4f3ccb..33f3905 100644
--- a/sources/rb-library-source.c
+++ b/sources/rb-library-source.c
@@ -587,7 +587,9 @@ update_layout_filename (RBLibrarySource *source)
        }
        g_free (value);
 
-       gtk_combo_box_set_active (GTK_COMBO_BOX (source->priv->layout_filename_menu), active);
+       if (source->priv->layout_filename_menu != NULL) {
+               gtk_combo_box_set_active (GTK_COMBO_BOX (source->priv->layout_filename_menu), active);
+       }
 
        update_layout_example_label (source);
 }
@@ -735,6 +737,9 @@ update_preferred_media_type (RBLibrarySource *source)
        gboolean done;
        char *str;
 
+       if (source->priv->profile_model == NULL)
+               return;
+
        done = FALSE;
        str = g_settings_get_string (source->priv->encoding_settings, "media-type");
        if (gtk_tree_model_get_iter_first (source->priv->profile_model, &iter)) {
@@ -1437,6 +1442,10 @@ update_layout_example_label (RBLibrarySource *source)
        RhythmDBEntryType *entry_type;
        RhythmDBEntry *sample_entry;
 
+       if (source->priv->layout_example_label == NULL) {
+               return;
+       }
+
        media_type = g_settings_get_string (source->priv->encoding_settings, "media-type");
 
        file_pattern = g_settings_get_string (source->priv->settings, "layout-filename");


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