RygelFolderPrefSection* rygel_folder_pref_section_construct (GType object_type, GtkBuilder* builder, RygelConfiguration* config) {
	RygelFolderPrefSection * self;
	GtkTextView* _tmp1_;
	GtkTextView* _tmp0_;
	GtkTextBuffer* _tmp3_;
	GtkTextBuffer* _tmp2_;
	GeeArrayList* folders;
	char* text;
	g_return_val_if_fail (builder != NULL, NULL);
	g_return_val_if_fail (config != NULL, NULL);
	self = (RygelFolderPrefSection*) rygel_plugin_pref_section_construct (object_type, builder, config, RYGEL_FOLDER_PREF_SECTION_NAME);
	_tmp1_ = NULL;
	_tmp0_ = NULL;
	self->priv->text_view = (_tmp1_ = (_tmp0_ = GTK_TEXT_VIEW (gtk_builder_get_object (builder, RYGEL_FOLDER_PREF_SECTION_FOLDERS_TEXTVIEW)), (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_)), (self->priv->text_view == NULL) ? NULL : (self->priv->text_view = (g_object_unref (self->priv->text_view), NULL)), _tmp1_);
	g_assert (self->priv->text_view != NULL);
	_tmp3_ = NULL;
	_tmp2_ = NULL;
	self->priv->text_buffer = (_tmp3_ = (_tmp2_ = GTK_TEXT_BUFFER (gtk_builder_get_object (builder, RYGEL_FOLDER_PREF_SECTION_FOLDERS_TEXTBUFFER)), (_tmp2_ == NULL) ? NULL : g_object_ref (_tmp2_)), (self->priv->text_buffer == NULL) ? NULL : (self->priv->text_buffer = (g_object_unref (self->priv->text_buffer), NULL)), _tmp3_);
	g_assert (self->priv->text_buffer != NULL);
	folders = rygel_configuration_get_string_list (config, ((RygelPreferencesSection*) self)->name, RYGEL_FOLDER_PREF_SECTION_FOLDERS_KEY);
	text = g_strdup ("");
	{
		GeeIterator* _folder_it;
		_folder_it = gee_iterable_iterator ((GeeIterable*) folders);
		while (gee_iterator_next (_folder_it)) {
			char* folder;
			char* _tmp5_;
			char* _tmp4_;
			folder = (char*) gee_iterator_get (_folder_it);
			_tmp5_ = NULL;
			_tmp4_ = NULL;
			text = (_tmp5_ = g_strconcat (text, _tmp4_ = g_strconcat (folder, "\n", NULL), NULL), text = (g_free (text), NULL), _tmp5_);
			_tmp4_ = (g_free (_tmp4_), NULL);
			folder = (g_free (folder), NULL);
		}
		(_folder_it == NULL) ? NULL : (_folder_it = (g_object_unref (_folder_it), NULL));
	}
	gtk_text_buffer_set_text (self->priv->text_buffer, text, -1);
	(folders == NULL) ? NULL : (folders = (g_object_unref (folders), NULL));
	text = (g_free (text), NULL);
	return self;
}
Пример #2
0
RygelTrackerPrefSection* rygel_tracker_pref_section_construct (GType object_type, GtkBuilder* builder, RygelUserConfig* config) {
#line 145 "rygel-tracker-pref-section.c"
	GError * _inner_error_;
	RygelTrackerPrefSection * self;
	GtkCheckButton* _tmp0_;
	GtkCheckButton* _tmp1_;
	GtkCheckButton* _tmp2_;
#line 40 "rygel-tracker-pref-section.vala"
	g_return_val_if_fail (builder != NULL, NULL);
#line 40 "rygel-tracker-pref-section.vala"
	g_return_val_if_fail (config != NULL, NULL);
#line 155 "rygel-tracker-pref-section.c"
	_inner_error_ = NULL;
#line 41 "rygel-tracker-pref-section.vala"
	self = (RygelTrackerPrefSection*) rygel_plugin_pref_section_construct (object_type, builder, config, RYGEL_TRACKER_PREF_SECTION_NAME);
#line 43 "rygel-tracker-pref-section.vala"
	self->priv->videos_check = (_tmp0_ = _g_object_ref0 (GTK_CHECK_BUTTON (gtk_builder_get_object (builder, RYGEL_TRACKER_PREF_SECTION_VIDEOS_CHECK))), _g_object_unref0 (self->priv->videos_check), _tmp0_);
#line 44 "rygel-tracker-pref-section.vala"
	g_assert (self->priv->videos_check != NULL);
#line 45 "rygel-tracker-pref-section.vala"
	self->priv->music_check = (_tmp1_ = _g_object_ref0 (GTK_CHECK_BUTTON (gtk_builder_get_object (builder, RYGEL_TRACKER_PREF_SECTION_MUSIC_CHECK))), _g_object_unref0 (self->priv->music_check), _tmp1_);
#line 46 "rygel-tracker-pref-section.vala"
	g_assert (self->priv->music_check != NULL);
#line 47 "rygel-tracker-pref-section.vala"
	self->priv->pictures_check = (_tmp2_ = _g_object_ref0 (GTK_CHECK_BUTTON (gtk_builder_get_object (builder, RYGEL_TRACKER_PREF_SECTION_PICTURES_CHECK))), _g_object_unref0 (self->priv->pictures_check), _tmp2_);
#line 48 "rygel-tracker-pref-section.vala"
	g_assert (self->priv->pictures_check != NULL);
#line 50 "rygel-tracker-pref-section.vala"
	gee_abstract_collection_add ((GeeAbstractCollection*) ((RygelPluginPrefSection*) self)->widgets, (GtkWidget*) self->priv->videos_check);
#line 51 "rygel-tracker-pref-section.vala"
	gee_abstract_collection_add ((GeeAbstractCollection*) ((RygelPluginPrefSection*) self)->widgets, (GtkWidget*) self->priv->music_check);
#line 52 "rygel-tracker-pref-section.vala"
	gee_abstract_collection_add ((GeeAbstractCollection*) ((RygelPluginPrefSection*) self)->widgets, (GtkWidget*) self->priv->pictures_check);
#line 54 "rygel-tracker-pref-section.vala"
	gtk_toggle_button_set_active ((GtkToggleButton*) self->priv->videos_check, TRUE);
#line 55 "rygel-tracker-pref-section.vala"
	gtk_toggle_button_set_active ((GtkToggleButton*) self->priv->music_check, TRUE);
#line 56 "rygel-tracker-pref-section.vala"
	gtk_toggle_button_set_active ((GtkToggleButton*) self->priv->pictures_check, TRUE);
#line 183 "rygel-tracker-pref-section.c"
	{
		gboolean _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
#line 59 "rygel-tracker-pref-section.vala"
		_tmp3_ = rygel_configuration_get_bool ((RygelConfiguration*) config, ((RygelPreferencesSection*) self)->name, RYGEL_TRACKER_PREF_SECTION_VIDEOS_KEY, &_inner_error_);
#line 190 "rygel-tracker-pref-section.c"
		if (_inner_error_ != NULL) {
			goto __catch12_g_error;
		}
#line 59 "rygel-tracker-pref-section.vala"
		gtk_toggle_button_set_active ((GtkToggleButton*) self->priv->videos_check, _tmp3_);
#line 60 "rygel-tracker-pref-section.vala"
		_tmp4_ = rygel_configuration_get_bool ((RygelConfiguration*) config, ((RygelPreferencesSection*) self)->name, RYGEL_TRACKER_PREF_SECTION_MUSIC_KEY, &_inner_error_);
#line 198 "rygel-tracker-pref-section.c"
		if (_inner_error_ != NULL) {
			goto __catch12_g_error;
		}
#line 60 "rygel-tracker-pref-section.vala"
		gtk_toggle_button_set_active ((GtkToggleButton*) self->priv->music_check, _tmp4_);
#line 61 "rygel-tracker-pref-section.vala"
		_tmp5_ = rygel_configuration_get_bool ((RygelConfiguration*) config, ((RygelPreferencesSection*) self)->name, RYGEL_TRACKER_PREF_SECTION_PICTURES_KEY, &_inner_error_);
#line 206 "rygel-tracker-pref-section.c"
		if (_inner_error_ != NULL) {
			goto __catch12_g_error;
		}
#line 61 "rygel-tracker-pref-section.vala"
		gtk_toggle_button_set_active ((GtkToggleButton*) self->priv->pictures_check, _tmp5_);
#line 212 "rygel-tracker-pref-section.c"
	}
	goto __finally12;
	__catch12_g_error:
	{
		GError * err;
		err = _inner_error_;
		_inner_error_ = NULL;
		{
			_g_error_free0 (err);
		}
	}
	__finally12:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
#line 66 "rygel-tracker-pref-section.vala"
	rygel_plugin_pref_section_reset_widgets_sensitivity ((RygelPluginPrefSection*) self);
#line 232 "rygel-tracker-pref-section.c"
	return self;
}