Logo Search packages:      
Sourcecode: avahi version File versions  Download package

void aui_service_dialog_set_service_type_name ( AuiServiceDialog d,
const gchar *  type,
const gchar *  name 
)

Overwrite the pretty name shown in the service type column.

Since:
0.6.22

Definition at line 1252 of file avahi-ui.c.

                                                                                                         {
    GtkTreeModel *m = NULL;
    GtkTreeIter iter;

    g_return_if_fail(AUI_IS_SERVICE_DIALOG(d));
    g_return_if_fail(NULL != type);
    g_return_if_fail(NULL != name);

    if (NULL == d->priv->service_type_names)
        d->priv->service_type_names = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);

    g_hash_table_insert(d->priv->service_type_names, g_strdup(type), g_strdup(name));

    if (d->priv->service_list_store)
        m = GTK_TREE_MODEL(d->priv->service_list_store);

    if (m && gtk_tree_model_get_iter_first(m, &iter)) {
        do {
            char *stored_type = NULL;

            gtk_tree_model_get(m, &iter, SERVICE_COLUMN_TYPE, &stored_type, -1);

            if (stored_type && g_str_equal(stored_type, type))
                gtk_list_store_set(d->priv->service_list_store, &iter, SERVICE_COLUMN_PRETTY_TYPE, name, -1);
        } while (gtk_tree_model_iter_next(m, &iter));
    }
}


Generated by  Doxygen 1.6.0   Back to index