示例#1
0
void preferences_save (Preferences* self) {
	GeeMap* _tmp0_;
	GeeMapIterator* _tmp1_ = NULL;
	GeeMapIterator* iter;
	GeeMapIterator* _tmp2_;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->current;
	_tmp1_ = gee_map_map_iterator (_tmp0_);
	iter = _tmp1_;
	_tmp2_ = iter;
	_tmp3_ = gee_map_iterator_first (_tmp2_);
	if (_tmp3_) {
		{
			gboolean _tmp4_;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp5_;
				IBusConfig* _tmp8_;
				GeeMapIterator* _tmp9_;
				gpointer _tmp10_ = NULL;
				gchar* _tmp11_;
				GeeMapIterator* _tmp12_;
				gpointer _tmp13_ = NULL;
				GVariant* _tmp14_;
				_tmp5_ = _tmp4_;
				if (!_tmp5_) {
					GeeMapIterator* _tmp6_;
					gboolean _tmp7_ = FALSE;
					_tmp6_ = iter;
					_tmp7_ = gee_map_iterator_next (_tmp6_);
					if (!_tmp7_) {
						break;
					}
				}
				_tmp4_ = FALSE;
				_tmp8_ = self->priv->config;
				_tmp9_ = iter;
				_tmp10_ = gee_map_iterator_get_key (_tmp9_);
				_tmp11_ = (gchar*) _tmp10_;
				_tmp12_ = iter;
				_tmp13_ = gee_map_iterator_get_value (_tmp12_);
				_tmp14_ = (GVariant*) _tmp13_;
				ibus_config_set_value (_tmp8_, "engine/skk", _tmp11_, _tmp14_);
				_g_variant_unref0 (_tmp14_);
				_g_free0 (_tmp11_);
			}
		}
	}
	_g_object_unref0 (iter);
}
示例#2
0
/**
 * cinnamon_contact_system_initial_search:
 * @cinnamon: A #CinnamonContactSystem
 * @terms: (element-type utf8): List of terms, logical AND
 *
 * Search through contacts for the given search terms.
 *
 * Returns: (transfer container) (element-type utf8): List of contact
 * identifiers
 */
GSList *
cinnamon_contact_system_initial_search (CinnamonContactSystem *self,
                                     GSList             *terms)
{
  FolksIndividual *individual;
  GSList *results = NULL;
  GeeMap *individuals = NULL;
  ContactSearchResult *result;
  GeeMapIterator *iter;
  gpointer key;
  guint weight;
  GSList *normalized_terms = normalize_terms (terms);

  g_return_val_if_fail (CINNAMON_IS_CONTACT_SYSTEM (self), NULL);

  individuals = folks_individual_aggregator_get_individuals (self->priv->aggregator);

  iter = gee_map_map_iterator (individuals);

  while (gee_map_iterator_next (iter))
    {
      individual = gee_map_iterator_get_value (iter);
      weight = do_match (self, individual, normalized_terms);

      if (weight != 0)
        {
          key = gee_map_iterator_get_key (iter);

          result = g_slice_new (ContactSearchResult);
          result->key = (gchar *) key;
          result->weight = weight;

          results = g_slist_append (results, result);
        }

      g_object_unref (individual);
    }

  return sort_and_prepare_results (results);
}
示例#3
0
TpfPersonaStore *
empathy_dup_persona_store_for_connection (TpConnection *connection)
{
  FolksBackendStore *backend_store;
  FolksBackend *backend;
  TpfPersonaStore *result = NULL;

  backend_store = folks_backend_store_dup ();
  backend = folks_backend_store_dup_backend_by_name (backend_store,
      "telepathy");
  if (backend != NULL)
    {
      GeeMap *stores_map;
      GeeMapIterator *iter;

      stores_map = folks_backend_get_persona_stores (backend);
      iter = gee_map_map_iterator (stores_map);
      while (gee_map_iterator_next (iter))
        {
          TpfPersonaStore *persona_store = gee_map_iterator_get_value (iter);
          TpAccount *account;
          TpConnection *conn_cur;

          account = tpf_persona_store_get_account (persona_store);
          conn_cur = tp_account_get_connection (account);
          if (conn_cur == connection)
            result = g_object_ref (persona_store);

          g_clear_object (&persona_store);
        }
      g_clear_object (&iter);
    }

  g_object_unref (backend);
  g_object_unref (backend_store);

  return result;
}