Exemplo n.º 1
0
static void dock_manager_dbus_watcher_finalize (GObject* obj) {
	DockManagerDBusWatcher * self;
	self = DOCK_MANAGER_DBUS_WATCHER (obj);
	_g_hash_table_unref0 (self->priv->owned_names);
	_g_object_unref0 (self->priv->bus_object);
	_g_regex_unref0 (self->priv->unnamed_bus_object);
	G_OBJECT_CLASS (dock_manager_dbus_watcher_parent_class)->finalize (obj);
}
Exemplo n.º 2
0
void plank_services_logger_initialize (const gchar* app_name) {
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	GeeArrayList* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_if_fail (app_name != NULL);
	_tmp0_ = plank_services_logger_get_AppName ();
	_tmp1_ = _tmp0_;
	_tmp2_ = app_name;
	plank_services_logger_set_AppName (_tmp2_);
	plank_services_logger_is_writing = FALSE;
	_tmp3_ = gee_array_list_new (PLANK_SERVICES_LOGGER_TYPE_LOG_MESSAGE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
	_g_object_unref0 (plank_services_logger_log_queue);
	plank_services_logger_log_queue = _tmp3_;
	{
		GRegex* _tmp4_ = NULL;
		GRegex* _tmp5_ = NULL;
		GRegex* _tmp6_ = NULL;
		_tmp5_ = g_regex_new ("[(]?.*?([^/]*?)(\\.2)?\\.vala(:\\d+)[)]?:\\s*(.*)", 0, 0, &_inner_error_);
		_tmp4_ = _tmp5_;
		if (_inner_error_ != NULL) {
			goto __catch31_g_error;
		}
		_tmp6_ = _tmp4_;
		_tmp4_ = NULL;
		_g_regex_unref0 (plank_services_logger_re);
		plank_services_logger_re = _tmp6_;
		_g_regex_unref0 (_tmp4_);
	}
	goto __finally31;
	__catch31_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally31:
	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;
	}
	g_log_set_default_handler (_plank_services_logger_glib_log_func_glog_func, NULL);
}
Exemplo n.º 3
0
static void skk_encoding_converter_class_init (SkkEncodingConverterClass * klass) {
	GError * _inner_error_ = NULL;
	skk_encoding_converter_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (SkkEncodingConverterPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_skk_encoding_converter_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_skk_encoding_converter_set_property;
	G_OBJECT_CLASS (klass)->finalize = skk_encoding_converter_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SKK_ENCODING_CONVERTER_ENCODING, g_param_spec_string ("encoding", "encoding", "encoding", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	{
		GRegex* _tmp0_;
		GRegex* _tmp1_;
		_tmp0_ = g_regex_new ("-\\*-.*[ \t]coding:[ \t]*([^ \t;]+?)[ \t;].*-\\*-", 0, 0, &_inner_error_);
		_tmp1_ = _tmp0_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch1_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
		}
		_g_regex_unref0 (skk_encoding_converter_coding_cookie_regex);
		skk_encoding_converter_coding_cookie_regex = _tmp1_;
	}
	goto __finally1;
	__catch1_g_regex_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally1:
	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_);
	}
}
Exemplo n.º 4
0
static char* string_replace (const char* self, const char* old, const char* replacement) {
#line 139 "ease-import-oca-service.c"
	char* result = NULL;
	GError * _inner_error_ = NULL;
#line 1157 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1157 "glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1157 "glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 148 "ease-import-oca-service.c"
	{
		char* _tmp0_;
		GRegex* _tmp1_;
		GRegex* regex;
		char* _tmp2_;
#line 1159 "glib-2.0.vapi"
		regex = (_tmp1_ = g_regex_new (_tmp0_ = g_regex_escape_string (old, -1), 0, 0, &_inner_error_), _g_free0 (_tmp0_), _tmp1_);
#line 156 "ease-import-oca-service.c"
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch8_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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 1160 "glib-2.0.vapi"
		_tmp2_ = g_regex_replace_literal (regex, self, (gssize) (-1), 0, replacement, 0, &_inner_error_);
#line 167 "ease-import-oca-service.c"
		if (_inner_error_ != NULL) {
			_g_regex_unref0 (regex);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch8_g_regex_error;
			}
			_g_regex_unref0 (regex);
			g_critical ("file %s: line %d: unexpected 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;
		}
		result = _tmp2_;
		_g_regex_unref0 (regex);
#line 1160 "glib-2.0.vapi"
		return result;
#line 182 "ease-import-oca-service.c"
	}
	goto __finally8;
	__catch8_g_regex_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		{
#line 1162 "glib-2.0.vapi"
			g_assert_not_reached ();
#line 193 "ease-import-oca-service.c"
			_g_error_free0 (e);
		}
	}
	__finally8:
	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;
	}
}
Exemplo n.º 5
0
static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	{
		GRegex* regex = NULL;
		const gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		GRegex* _tmp3_ = NULL;
		GRegex* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		GRegex* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		_tmp0_ = old;
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		regex = _tmp4_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch2_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp6_ = regex;
		_tmp7_ = replacement;
		_tmp8_ = g_regex_replace_literal (_tmp6_, self, (gssize) (-1), 0, _tmp7_, 0, &_inner_error_);
		_tmp5_ = _tmp8_;
		if (_inner_error_ != NULL) {
			_g_regex_unref0 (regex);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch2_g_regex_error;
			}
			_g_regex_unref0 (regex);
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp9_ = _tmp5_;
		_tmp5_ = NULL;
		result = _tmp9_;
		_g_free0 (_tmp5_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally2;
	__catch2_g_regex_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally2:
	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;
	}
}
Exemplo n.º 6
0
static char* string_replace (const char* self, const char* old, const char* replacement) {
#line 163 "rygel-http-item-uri.c"
	char* result = NULL;
	GError * _inner_error_;
#line 1052 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1052 "glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1052 "glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 172 "rygel-http-item-uri.c"
	_inner_error_ = NULL;
	{
		char* _tmp0_;
		GRegex* _tmp1_;
		GRegex* regex;
		char* _tmp2_;
#line 1054 "glib-2.0.vapi"
		regex = (_tmp1_ = g_regex_new (_tmp0_ = g_regex_escape_string (old, -1), 0, 0, &_inner_error_), _g_free0 (_tmp0_), _tmp1_);
#line 181 "rygel-http-item-uri.c"
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch2_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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 1055 "glib-2.0.vapi"
		_tmp2_ = g_regex_replace_literal (regex, self, (gssize) (-1), 0, replacement, 0, &_inner_error_);
#line 192 "rygel-http-item-uri.c"
		if (_inner_error_ != NULL) {
			_g_regex_unref0 (regex);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch2_g_regex_error;
			}
			_g_regex_unref0 (regex);
			g_critical ("file %s: line %d: unexpected 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;
		}
		result = _tmp2_;
		_g_regex_unref0 (regex);
#line 1055 "glib-2.0.vapi"
		return result;
#line 207 "rygel-http-item-uri.c"
	}
	goto __finally2;
	__catch2_g_regex_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		{
#line 1057 "glib-2.0.vapi"
			g_assert_not_reached ();
#line 218 "rygel-http-item-uri.c"
			_g_error_free0 (e);
		}
	}
	__finally2:
	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;
	}
}
Exemplo n.º 7
0
static void dock_manager_preferences_bin_update_helpers (DockManagerPreferencesBin* self) {
	gint _tmp0_;
	DockManagerPreferencesBinHelperFilterType filter;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* search_filter;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	dock_manager_tile_view_clear (self->priv->tile_view);
	_tmp0_ = gtk_combo_box_get_active (self->priv->combobox);
	filter = (DockManagerPreferencesBinHelperFilterType) _tmp0_;
	_tmp1_ = dock_manager_search_entry_get_text (self->priv->search_entry);
	_tmp2_ = g_strdup (_tmp1_);
	search_filter = _tmp2_;
	{
		GList* helper_collection;
		GList* helper_it;
		helper_collection = self->priv->all_helpers;
		for (helper_it = helper_collection; helper_it != NULL; helper_it = helper_it->next) {
			DockManagerHelperInfo* helper;
			helper = (DockManagerHelperInfo*) helper_it->data;
			{
				gboolean _tmp3_ = FALSE;
				gboolean _tmp4_ = FALSE;
				gboolean _tmp5_ = FALSE;
				gboolean _tmp6_ = FALSE;
				DockManagerHelperTileObject* _tmp11_ = NULL;
				DockManagerHelperTileObject* h_tile;
				if (filter == DOCK_MANAGER_PREFERENCES_BIN_HELPER_FILTER_TYPE_USABLE) {
					_tmp3_ = !(*helper).app_available;
				} else {
					_tmp3_ = FALSE;
				}
				if (_tmp3_) {
					continue;
				}
				if (filter == DOCK_MANAGER_PREFERENCES_BIN_HELPER_FILTER_TYPE_ENABLED) {
					_tmp4_ = !(*helper).enabled;
				} else {
					_tmp4_ = FALSE;
				}
				if (_tmp4_) {
					continue;
				}
				if (filter == DOCK_MANAGER_PREFERENCES_BIN_HELPER_FILTER_TYPE_DISABLED) {
					_tmp5_ = (*helper).enabled;
				} else {
					_tmp5_ = FALSE;
				}
				if (_tmp5_) {
					continue;
				}
				if (search_filter != NULL) {
					_tmp6_ = g_strcmp0 (search_filter, "") != 0;
				} else {
					_tmp6_ = FALSE;
				}
				if (_tmp6_) {
					GRegex* _tmp7_ = NULL;
					GRegex* r;
					gboolean _tmp8_ = FALSE;
					gboolean _tmp9_;
					_tmp7_ = g_regex_new (search_filter, G_REGEX_CASELESS, 0, &_inner_error_);
					r = _tmp7_;
					if (_inner_error_ != NULL) {
						_g_free0 (search_filter);
						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;
					}
					_tmp9_ = g_regex_match (r, (*helper).description, 0, NULL);
					if (!_tmp9_) {
						gboolean _tmp10_;
						_tmp10_ = g_regex_match (r, (*helper).name, 0, NULL);
						_tmp8_ = !_tmp10_;
					} else {
						_tmp8_ = FALSE;
					}
					if (_tmp8_) {
						_g_regex_unref0 (r);
						continue;
					}
					_g_regex_unref0 (r);
				}
				_tmp11_ = dock_manager_helper_tile_object_new (helper);
				h_tile = _tmp11_;
				dock_manager_helper_tile_object_update_state (h_tile, (*helper).enabled, (*helper).running);
				dock_manager_tile_view_append_tile (self->priv->tile_view, (DockManagerAbstractTileObject*) h_tile);
				g_signal_connect_object ((DockManagerAbstractTileObject*) h_tile, "active-changed", (GCallback) __lambda3__dock_manager_abstract_tile_object_active_changed, self, 0);
				_g_object_unref0 (h_tile);
			}
		}
	}
	_g_free0 (search_filter);
}
Exemplo n.º 8
0
static GObject * dock_manager_dbus_watcher_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	DockManagerDBusWatcher * self;
	GHashTable* _tmp0_ = NULL;
	DBusGConnection* _tmp1_ = NULL;
	DBusGConnection* connection;
	DBusGProxy* _tmp2_ = NULL;
	GRegex* _tmp3_ = NULL;
	GRegex* _tmp4_;
	gint _tmp5_;
	gchar** _tmp6_ = NULL;
	gchar** all_names;
	gint all_names_length1;
	gint _all_names_size_;
	GError * _inner_error_ = NULL;
	parent_class = G_OBJECT_CLASS (dock_manager_dbus_watcher_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = DOCK_MANAGER_DBUS_WATCHER (obj);
	_tmp0_ = g_hash_table_new_full (g_str_hash, g_str_equal, _g_free0_, NULL);
	_g_hash_table_unref0 (self->priv->owned_names);
	self->priv->owned_names = _tmp0_;
	_tmp1_ = dbus_g_bus_get (DBUS_BUS_SESSION, &_inner_error_);
	connection = _tmp1_;
	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_);
	}
	_tmp2_ = dbus_g_proxy_new_for_name (connection, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus");
	_g_object_unref0 (self->priv->bus_object);
	self->priv->bus_object = _tmp2_;
	_dynamic_NameOwnerChanged1_connect (self->priv->bus_object, "NameOwnerChanged", (GCallback) _dock_manager_dbus_watcher_name_owner_changed_dynamic_NameOwnerChanged0_, self);
	_tmp3_ = g_regex_new ("^:\\d+.\\d+$", 0, 0, &_inner_error_);
	_tmp4_ = _tmp3_;
	if (_inner_error_ != NULL) {
		_dbus_g_connection_unref0 (connection);
		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_);
	}
	_g_regex_unref0 (self->priv->unnamed_bus_object);
	self->priv->unnamed_bus_object = _tmp4_;
	_tmp6_ = _dynamic_list_names1 (self->priv->bus_object, &_tmp5_, &_inner_error_);
	all_names = _tmp6_;
	all_names_length1 = _tmp5_;
	_all_names_size_ = _tmp5_;
	if (_inner_error_ != NULL) {
		_dbus_g_connection_unref0 (connection);
		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_);
	}
	{
		gchar** s_collection;
		int s_collection_length1;
		int s_it;
		s_collection = all_names;
		s_collection_length1 = all_names_length1;
		for (s_it = 0; s_it < all_names_length1; s_it = s_it + 1) {
			gchar* _tmp7_;
			gchar* s;
			_tmp7_ = g_strdup (s_collection[s_it]);
			s = _tmp7_;
			{
				gboolean _tmp8_;
				_tmp8_ = g_regex_match (self->priv->unnamed_bus_object, s, 0, NULL);
				if (_tmp8_ == FALSE) {
					gchar* _tmp9_;
					_tmp9_ = g_strdup (s);
					g_hash_table_insert (self->priv->owned_names, _tmp9_, GINT_TO_POINTER (1));
				}
				_g_free0 (s);
			}
		}
	}
	all_names = (_vala_array_free (all_names, all_names_length1, (GDestroyNotify) g_free), NULL);
	_dbus_g_connection_unref0 (connection);
	return obj;
}