[nautilus] content-bar: use const type for content types



commit d41f6bbba4c6affa2bae05ae424ea2c77f9278a0
Author: Carlos Soriano <csoriano gnome org>
Date:   Wed Mar 9 17:48:24 2016 +0100

    content-bar: use const type for content types
    
    This fixes warnings.

 libnautilus-private/nautilus-file-utilities.c |    6 +++---
 libnautilus-private/nautilus-file-utilities.h |    6 +++---
 src/nautilus-window-slot.c                    |    4 ++--
 src/nautilus-x-content-bar.c                  |    6 +++---
 src/nautilus-x-content-bar.h                  |    2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-utilities.c b/libnautilus-private/nautilus-file-utilities.c
index 94b3e9c..952d010 100644
--- a/libnautilus-private/nautilus-file-utilities.c
+++ b/libnautilus-private/nautilus-file-utilities.c
@@ -1031,7 +1031,7 @@ get_message_for_content_type (const char *content_type)
 }
 
 char *
-get_message_for_two_content_types (char **content_types)
+get_message_for_two_content_types (const char * const *content_types)
 {
        char *message;
 
@@ -1065,7 +1065,7 @@ get_message_for_two_content_types (char **content_types)
 }
 
 gboolean
-should_handle_content_type (char *content_type)
+should_handle_content_type (const char *content_type)
 {
         GAppInfo *default_app;
 
@@ -1077,7 +1077,7 @@ should_handle_content_type (char *content_type)
 }
 
 gboolean
-should_handle_content_types (char ** content_types)
+should_handle_content_types (const char * const * content_types)
 {
         int i;
 
diff --git a/libnautilus-private/nautilus-file-utilities.h b/libnautilus-private/nautilus-file-utilities.h
index 9b39ccc..d3016df 100644
--- a/libnautilus-private/nautilus-file-utilities.h
+++ b/libnautilus-private/nautilus-file-utilities.h
@@ -89,9 +89,9 @@ void nautilus_get_x_content_types_for_mount_async (GMount *mount,
                                                   GCancellable *cancellable,
                                                   gpointer user_data);
 char * get_message_for_content_type (const char *content_type);
-char * get_message_for_two_content_types (char **content_types);
-gboolean should_handle_content_type (char *content_type);
-gboolean should_handle_content_types (char **content_type);
+char * get_message_for_two_content_types (const char * const *content_types);
+gboolean should_handle_content_type (const char *content_type);
+gboolean should_handle_content_types (const char * const *content_type);
 
 gboolean nautilus_file_selection_equal (GList *selection_a, GList *selection_b);
 
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index c12453b..83b5405 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -1871,7 +1871,7 @@ typedef struct {
 } FindMountData;
 
 static void
-nautilus_window_slot_show_x_content_bar (NautilusWindowSlot *slot, GMount *mount, const char 
**x_content_types)
+nautilus_window_slot_show_x_content_bar (NautilusWindowSlot *slot, GMount *mount, const char * const 
*x_content_types)
 {
        GtkWidget *bar;
 
@@ -1899,7 +1899,7 @@ found_content_type_cb (const char **x_content_types,
        slot = data->slot;
 
        if (x_content_types != NULL && x_content_types[0] != NULL) {
-               nautilus_window_slot_show_x_content_bar (slot, data->mount, x_content_types);
+               nautilus_window_slot_show_x_content_bar (slot, data->mount, (const char* const *) 
x_content_types);
        }
 
        slot->details->find_mount_cancellable = NULL;
diff --git a/src/nautilus-x-content-bar.c b/src/nautilus-x-content-bar.c
index 5f9ef40..71723fe 100644
--- a/src/nautilus-x-content-bar.c
+++ b/src/nautilus-x-content-bar.c
@@ -80,7 +80,7 @@ content_bar_response_cb (GtkInfoBar *infobar,
 }
 
 static void
-nautilus_x_content_bar_set_x_content_types (NautilusXContentBar *bar, const char **x_content_types)
+nautilus_x_content_bar_set_x_content_types (NautilusXContentBar *bar, const char * const *x_content_types)
 {
        char *message = NULL;
        guint num_types;
@@ -118,7 +118,7 @@ nautilus_x_content_bar_set_x_content_types (NautilusXContentBar *bar, const char
                message = get_message_for_content_type (bar->priv->x_content_types[0]);
                break;
        case 2:
-               message = get_message_for_two_content_types (bar->priv->x_content_types);
+               message = get_message_for_two_content_types ((const char* const *) 
bar->priv->x_content_types);
                break;
        default:
                message = g_strdup (_("Open with:"));
@@ -302,7 +302,7 @@ nautilus_x_content_bar_init (NautilusXContentBar *bar)
 
 GtkWidget *
 nautilus_x_content_bar_new (GMount *mount,
-                           const char **x_content_types)
+                           const char * const *x_content_types)
 {
        return g_object_new (NAUTILUS_TYPE_X_CONTENT_BAR,
                             "message-type", GTK_MESSAGE_QUESTION,
diff --git a/src/nautilus-x-content-bar.h b/src/nautilus-x-content-bar.h
index 4b0d7e6..9065e51 100644
--- a/src/nautilus-x-content-bar.h
+++ b/src/nautilus-x-content-bar.h
@@ -53,7 +53,7 @@ typedef struct
 GType           nautilus_x_content_bar_get_type        (void) G_GNUC_CONST;
 
 GtkWidget      *nautilus_x_content_bar_new                (GMount              *mount,
-                                                           const char         **x_content_types);
+                                                           const char * const*  x_content_types);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]