From 058dcb3222e60b7cf27d42db9cbe39089e2a4b54 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 25 May 2002 14:45:45 +0000 Subject: [PATCH] r1509: Show MIME rules works again. --- ROX-Filer/Help/TODO | 2 ++ ROX-Filer/src/type.c | 36 ++++++++++++++---------------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/ROX-Filer/Help/TODO b/ROX-Filer/Help/TODO index e4cb5375..de697be8 100644 --- a/ROX-Filer/Help/TODO +++ b/ROX-Filer/Help/TODO @@ -17,6 +17,8 @@ Panel sometimes won't accept drops (sawfish bug). Using spring-opening with a missing directory has grab problems (Gkt+ problem?). +rox.mimeinfo + FEATURES FOR 1.3 diff --git a/ROX-Filer/src/type.c b/ROX-Filer/src/type.c index b4e49233..ea6ac6f3 100644 --- a/ROX-Filer/src/type.c +++ b/ROX-Filer/src/type.c @@ -930,32 +930,24 @@ gboolean can_set_run_action(DirItem *item) !(item->mime_type == special_exec); } -#if 0 -/* Open all /type directories and display a message */ -static void open_choices_dirs(gchar *type, gchar *what) +/* To edit the MIME types, open a filer window for /MIME-info */ +static void edit_mime_types(guchar *unused) { - guchar *dir; - GPtrArray *list; - int i; - - dir = choices_find_path_save("", type, TRUE); - g_free(dir); - list = choices_list_dirs(type); + const gchar *path; + struct stat info; - for (i = list->len - 1; i >= 0; i--) - filer_opendir(list->pdata[i], NULL); + mkdir(make_path(home_dir, ".mime")->str, 0700); + path = make_path(home_dir, ".mime/mime-info")->str; + mkdir(path, 0700); + filer_opendir(path, NULL); - choices_free_list(list); -} -#endif + path = "/usr/local/share/mime/mime-info"; + if (mc_stat(path, &info) == 0) + filer_opendir(path, NULL); -/* To edit the MIME types, open a filer window for /MIME-info */ -static void edit_mime_types(guchar *unused) -{ - delayed_error("XXX: This feature is currently under repair"); - /* - open_choices_dirs("MIME-info", "the files defining MIME types"); - */ + path = "/usr/share/mime/mime-info"; + if (mc_stat(path, &info) == 0) + filer_opendir(path, NULL); } static void reread_mime_files(guchar *unused) -- 2.11.4.GIT