comparison src/editors.c @ 2870:49bd0d974e88

Merge.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 12 Dec 2018 21:56:30 +0200
parents 86dad5529aed 1656d2341e2f
children
comparison
equal deleted inserted replaced
2836:c79d70e18076 2870:49bd0d974e88
183 const gchar *key = filename_from_path(path); 183 const gchar *key = filename_from_path(path);
184 gchar **categories, **only_show_in, **not_show_in; 184 gchar **categories, **only_show_in, **not_show_in;
185 gchar *try_exec; 185 gchar *try_exec;
186 GtkTreeIter iter; 186 GtkTreeIter iter;
187 gboolean category_geeqie = FALSE; 187 gboolean category_geeqie = FALSE;
188 GList *work;
189 gboolean disabled;
188 190
189 if (g_hash_table_lookup(editors, key)) return FALSE; /* the file found earlier wins */ 191 if (g_hash_table_lookup(editors, key)) return FALSE; /* the file found earlier wins */
190 192
191 key_file = g_key_file_new(); 193 key_file = g_key_file_new();
192 if (!g_key_file_load_from_file(key_file, path, 0, NULL)) 194 if (!g_key_file_load_from_file(key_file, path, 0, NULL))
351 353
352 g_key_file_free(key_file); 354 g_key_file_free(key_file);
353 355
354 if (editor->ignored) return TRUE; 356 if (editor->ignored) return TRUE;
355 357
358 work = options->disabled_plugins;
359
360 disabled = FALSE;
361 while (work)
362 {
363 if (g_strcmp0(path, work->data) == 0)
364 {
365 disabled = TRUE;
366 break;
367 }
368 work = work->next;
369 }
370
371 editor->disabled = disabled;
372
356 gtk_list_store_append(desktop_file_list, &iter); 373 gtk_list_store_append(desktop_file_list, &iter);
357 gtk_list_store_set(desktop_file_list, &iter, 374 gtk_list_store_set(desktop_file_list, &iter,
358 DESKTOP_FILE_COLUMN_KEY, key, 375 DESKTOP_FILE_COLUMN_KEY, key,
376 DESKTOP_FILE_COLUMN_DISABLED, editor->disabled,
359 DESKTOP_FILE_COLUMN_NAME, editor->name, 377 DESKTOP_FILE_COLUMN_NAME, editor->name,
360 DESKTOP_FILE_COLUMN_HIDDEN, editor->hidden ? _("yes") : _("no"), 378 DESKTOP_FILE_COLUMN_HIDDEN, editor->hidden ? _("yes") : _("no"),
361 DESKTOP_FILE_COLUMN_WRITABLE, access_file(path, W_OK), 379 DESKTOP_FILE_COLUMN_WRITABLE, access_file(path, W_OK),
362 DESKTOP_FILE_COLUMN_PATH, path, -1); 380 DESKTOP_FILE_COLUMN_PATH, path, -1);
363 381
382 { 400 {
383 gtk_list_store_clear(desktop_file_list); 401 gtk_list_store_clear(desktop_file_list);
384 } 402 }
385 else 403 else
386 { 404 {
387 desktop_file_list = gtk_list_store_new(DESKTOP_FILE_COLUMN_COUNT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING); 405 desktop_file_list = gtk_list_store_new(DESKTOP_FILE_COLUMN_COUNT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING);
388 } 406 }
389 if (editors) 407 if (editors)
390 { 408 {
391 g_hash_table_destroy(editors); 409 g_hash_table_destroy(editors);
392 } 410 }
468 if (strcmp(editor->key, CMD_COPY) == 0 || 486 if (strcmp(editor->key, CMD_COPY) == 0 ||
469 strcmp(editor->key, CMD_MOVE) == 0 || 487 strcmp(editor->key, CMD_MOVE) == 0 ||
470 strcmp(editor->key, CMD_RENAME) == 0 || 488 strcmp(editor->key, CMD_RENAME) == 0 ||
471 strcmp(editor->key, CMD_DELETE) == 0 || 489 strcmp(editor->key, CMD_DELETE) == 0 ||
472 strcmp(editor->key, CMD_FOLDER) == 0) return; 490 strcmp(editor->key, CMD_FOLDER) == 0) return;
491
492 if (editor->disabled)
493 {
494 return;
495 }
473 496
474 *listp = g_list_prepend(*listp, editor); 497 *listp = g_list_prepend(*listp, editor);
475 } 498 }
476 499
477 static gint editor_sort(gconstpointer a, gconstpointer b) 500 static gint editor_sort(gconstpointer a, gconstpointer b)