summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-mime-application-chooser.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2012-08-22 11:26:21 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2012-08-22 14:22:12 -0400
commit58b704ad8b473600d7f7ad57aa5535e5be5dbd24 (patch)
tree44309e7db0db61f847a859a0d8f678b4c8c23767 /libnautilus-private/nautilus-mime-application-chooser.c
parent216e50f40e816e7fcc0e1fdaf3a4c8e3e816b990 (diff)
downloadnautilus-58b704ad8b473600d7f7ad57aa5535e5be5dbd24.tar.gz
Don't show the open with tab if it is going to be useless
Diffstat (limited to 'libnautilus-private/nautilus-mime-application-chooser.c')
-rw-r--r--libnautilus-private/nautilus-mime-application-chooser.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/libnautilus-private/nautilus-mime-application-chooser.c b/libnautilus-private/nautilus-mime-application-chooser.c
index 41bb54d6a..b78bae26b 100644
--- a/libnautilus-private/nautilus-mime-application-chooser.c
+++ b/libnautilus-private/nautilus-mime-application-chooser.c
@@ -237,34 +237,6 @@ application_selected_cb (GtkAppChooserWidget *widget,
app_info_can_add (info, chooser->details->content_type));
}
-static char *
-get_extension (const char *basename)
-{
- char *p;
-
- p = strrchr (basename, '.');
-
- if (p && *(p + 1) != '\0') {
- return g_strdup (p + 1);
- } else {
- return NULL;
- }
-}
-
-static gchar *
-get_extension_from_file (NautilusFile *nfile)
-{
- char *name;
- char *extension;
-
- name = nautilus_file_get_name (nfile);
- extension = get_extension (name);
-
- g_free (name);
-
- return extension;
-}
-
static void
nautilus_mime_application_chooser_apply_labels (NautilusMimeApplicationChooser *chooser)
{
@@ -273,7 +245,7 @@ nautilus_mime_application_chooser_apply_labels (NautilusMimeApplicationChooser *
if (chooser->details->files != NULL) {
/* here we assume all files are of the same content type */
if (g_content_type_is_unknown (chooser->details->content_type)) {
- extension = get_extension_from_file (NAUTILUS_FILE (chooser->details->files->data));
+ extension = nautilus_file_get_extension (NAUTILUS_FILE (chooser->details->files->data));
/* the %s here is a file extension */
description = g_strdup_printf (_("%s document"), extension);
@@ -291,7 +263,7 @@ nautilus_mime_application_chooser_apply_labels (NautilusMimeApplicationChooser *
basename = g_file_get_basename (file);
if (g_content_type_is_unknown (chooser->details->content_type)) {
- extension = get_extension (basename);
+ extension = nautilus_file_get_extension (file);
/* the %s here is a file extension */
description = g_strdup_printf (_("%s document"), extension);