summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2012-09-04 18:43:14 +0200
committerTomas Bzatek <tbzatek@redhat.com>2012-09-04 18:43:14 +0200
commit085c2885ff7f1acaf7a5238f85732d361ad55fc9 (patch)
tree5797765012419b438f5e7ff5312fe186884a8dcc
parent37d3eef5489d4c0d4ed227008a0494a9f14743e3 (diff)
downloadgvfs-085c2885ff7f1acaf7a5238f85732d361ad55fc9.tar.gz
gmountsource: Always use NULL-terminated arrays
GDBus calls require NULL-terminated string arrays, let's use them internally instead of array + n_elements couple. Also fix all users of g_mount_source_ask_question() and g_mount_source_show_processes(). This is a regression after gdbus port actually, the old code used to deal with string arrays differently. Related commit: 99d06e499f999459f1fc973c870415a004722d54 https://bugzilla.gnome.org/show_bug.cgi?id=683118
-rw-r--r--common/gmountsource.c8
-rw-r--r--common/gmountsource.h4
-rw-r--r--daemon/gvfsbackend.c2
-rw-r--r--daemon/gvfsbackendafc.c1
-rw-r--r--daemon/gvfsbackendsftp.c3
5 files changed, 1 insertions, 17 deletions
diff --git a/common/gmountsource.c b/common/gmountsource.c
index a2492377..e7f7d732 100644
--- a/common/gmountsource.c
+++ b/common/gmountsource.c
@@ -563,7 +563,6 @@ gboolean
g_mount_source_ask_question (GMountSource *source,
const char *message,
const char **choices,
- gint n_choices,
gboolean *aborted_out,
gint *choice_out)
{
@@ -579,7 +578,6 @@ g_mount_source_ask_question (GMountSource *source,
g_mount_source_ask_question_async (source,
message,
choices,
- n_choices,
ask_reply_sync,
&data);
@@ -609,7 +607,6 @@ void
g_mount_source_ask_question_async (GMountSource *source,
const char *message_string,
const char **choices,
- gint n_choices,
GAsyncReadyCallback callback,
gpointer user_data)
{
@@ -702,7 +699,6 @@ op_ask_question (GMountOperation *op,
g_mount_source_ask_question_async (mount_source,
message,
choices,
- g_strv_length ((gchar **) choices),
op_ask_question_reply,
g_object_ref (op));
g_signal_stop_emission_by_name (op, "ask_question");
@@ -769,7 +765,6 @@ g_mount_source_show_processes_async (GMountSource *source,
const char *message_string,
GArray *processes,
const char **choices,
- gint n_choices,
GAsyncReadyCallback callback,
gpointer user_data)
{
@@ -833,7 +828,6 @@ g_mount_source_show_processes (GMountSource *source,
const char *message,
GArray *processes,
const char **choices,
- gint n_choices,
gboolean *aborted_out,
gint *choice_out)
{
@@ -850,7 +844,6 @@ g_mount_source_show_processes (GMountSource *source,
message,
processes,
choices,
- n_choices,
ask_reply_sync,
&data);
@@ -920,7 +913,6 @@ op_show_processes (GMountOperation *op,
message,
processes,
choices,
- g_strv_length ((gchar **) choices),
op_show_processes_reply,
g_object_ref (op));
g_signal_stop_emission_by_name (op, "show_processes");
diff --git a/common/gmountsource.h b/common/gmountsource.h
index 58f7f7fe..7febdaa2 100644
--- a/common/gmountsource.h
+++ b/common/gmountsource.h
@@ -88,14 +88,12 @@ gboolean g_mount_source_ask_password_finish (GMountSource
gboolean g_mount_source_ask_question (GMountSource *mount_source,
const char *message,
const char **choices,
- gint n_choices,
gboolean *aborted,
gint *choice_out);
void g_mount_source_ask_question_async (GMountSource *mount_source,
const char *message,
const char **choices,
- gint n_choices,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -108,7 +106,6 @@ gboolean g_mount_source_show_processes (GMountSource
const char *message,
GArray *processes,
const char **choices,
- gint n_choices,
gboolean *aborted,
gint *choice_out);
@@ -116,7 +113,6 @@ void g_mount_source_show_processes_async (GMountSource
const char *message,
GArray *processes,
const char **choices,
- gint n_choices,
GAsyncReadyCallback callback,
gpointer user_data);
diff --git a/daemon/gvfsbackend.c b/daemon/gvfsbackend.c
index b6053a23..0c84c150 100644
--- a/daemon/gvfsbackend.c
+++ b/daemon/gvfsbackend.c
@@ -861,7 +861,6 @@ on_update_processes_timeout (gpointer user_data)
data->message,
processes,
data->choices,
- g_strv_length ((gchar **) data->choices),
NULL,
NULL);
}
@@ -982,7 +981,6 @@ g_vfs_backend_unmount_with_operation (GVfsBackend *backend,
data->message,
processes,
data->choices,
- g_strv_length ((gchar **) data->choices),
(GAsyncReadyCallback) on_show_processes_reply,
data);
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index ea6f91f5..704be77a 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -629,7 +629,6 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
ret = g_mount_source_ask_question (src,
message,
choices,
- 2,
&aborted,
&choice);
if (!ret || aborted || (choice == CHOICE_CANCEL))
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index fe2f4b91..b79b4bc1 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -1049,7 +1049,7 @@ handle_login (GVfsBackend *backend,
else if (g_str_has_prefix (buffer, "The authenticity of host '") ||
strstr (buffer, "Key fingerprint:") != NULL)
{
- const gchar *choices[] = {_("Log In Anyway"), _("Cancel Login")};
+ const gchar *choices[] = {_("Log In Anyway"), _("Cancel Login"), NULL};
const gchar *choice_string;
gchar *hostname = NULL;
gchar *fingerprint = NULL;
@@ -1071,7 +1071,6 @@ handle_login (GVfsBackend *backend,
if (!g_mount_source_ask_question (mount_source,
message,
choices,
- 2,
&aborted,
&choice) ||
aborted)