summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2008-08-02 11:00:07 +0000
committerChristian Persch <chpe@src.gnome.org>2008-08-02 11:00:07 +0000
commit4836abe602181cc92ce99ef7cb4a78ba9447a032 (patch)
treea624fc3742a2fd7dd37857c6127abc7e7ea4da7a
parentad7695f9ccd2435b034094ad03aa229b4d4ba60e (diff)
downloadgvfs-4836abe602181cc92ce99ef7cb4a78ba9447a032.tar.gz
Use g_set_error_literal where appropriate. Bug #539167.
svn path=/trunk/; revision=1847
-rw-r--r--ChangeLog29
-rw-r--r--client/gdaemonfile.c70
-rw-r--r--client/gdaemonfileinputstream.c50
-rw-r--r--client/gdaemonfileoutputstream.c40
-rw-r--r--client/gvfsdaemondbus.c10
-rw-r--r--common/gdbusutils.c6
-rw-r--r--common/gvfsdaemonprotocol.c8
-rw-r--r--daemon/gvfsbackendarchive.c8
-rw-r--r--daemon/gvfsbackendcdda.c10
-rw-r--r--daemon/gvfsbackenddav.c27
-rw-r--r--daemon/gvfsbackendftp.c108
-rw-r--r--daemon/gvfsbackendgphoto2.c12
-rw-r--r--daemon/gvfsbackendobexftp-cap-parser.c8
-rw-r--r--daemon/gvfsbackendobexftp-fl-parser.c8
-rw-r--r--daemon/gvfsbackendobexftp.c12
-rw-r--r--daemon/gvfsbackendsftp.c100
-rw-r--r--daemon/gvfsbackendsmb.c45
-rw-r--r--daemon/gvfsbackendsmbbrowse.c12
-rw-r--r--daemon/gvfsjob.c6
-rw-r--r--daemon/gvfsjobopenforwrite.c4
-rw-r--r--daemon/gvfsreadchannel.c2
-rw-r--r--daemon/gvfswritechannel.c2
-rw-r--r--daemon/mount.c10
-rw-r--r--daemon/soup-input-stream.c12
-rw-r--r--daemon/soup-output-stream.c12
25 files changed, 314 insertions, 297 deletions
diff --git a/ChangeLog b/ChangeLog
index f140bfb7..8c6b5cfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2008-08-02 Christian Persch <chpe@gnome.org>
+
+ * ChangeLog
+ * client/gdaemonfile.c
+ * client/gdaemonfileinputstream.c
+ * client/gdaemonfileoutputstream.c
+ * client/gvfsdaemondbus.c
+ * common/gdbusutils.c
+ * common/gvfsdaemonprotocol.c
+ * daemon/gvfsbackendarchive.c
+ * daemon/gvfsbackendcdda.c
+ * daemon/gvfsbackenddav.c
+ * daemon/gvfsbackendftp.c
+ * daemon/gvfsbackendgphoto2.c
+ * daemon/gvfsbackendobexftp-cap-parser.c
+ * daemon/gvfsbackendobexftp-fl-parser.c
+ * daemon/gvfsbackendobexftp.c
+ * daemon/gvfsbackendsftp.c
+ * daemon/gvfsbackendsmb.c
+ * daemon/gvfsbackendsmbbrowse.c
+ * daemon/gvfsjob.c
+ * daemon/gvfsjobopenforwrite.c
+ * daemon/gvfsreadchannel.c
+ * daemon/gvfswritechannel.c
+ * daemon/mount.c
+ * daemon/soup-input-stream.c
+ * daemon/soup-output-stream.c: Use g_set_error_literal where
+ appropriate. Bug #539167.
+
2008-07-29 David Zeuthen <davidz@redhat.com>
* client/gdaemonmount.c:
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index b5477db4..9e055c21 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -478,8 +478,8 @@ do_sync_2_path_call (GFile *file1,
{
g_mount_info_unref (mount_info1);
/* For copy this will cause the fallback code to be involved */
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- "%s", _("Operation not supported, files on different mounts"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ _("Operation not supported, files on different mounts"));
return NULL;
}
}
@@ -783,8 +783,8 @@ g_daemon_file_query_info (GFile *file,
if (!dbus_message_iter_init (reply, &iter) ||
(dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRUCT))
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid return value from get_info"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid return value from get_info"));
goto out;
}
@@ -992,8 +992,8 @@ g_daemon_file_read (GFile *file,
DBUS_TYPE_INVALID))
{
dbus_message_unref (reply);
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid return value from open"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid return value from open"));
return NULL;
}
@@ -1002,8 +1002,8 @@ g_daemon_file_read (GFile *file,
fd = _g_dbus_connection_get_fd_sync (connection, fd_id);
if (fd == -1)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Didn't get stream file descriptor"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Didn't get stream file descriptor"));
return NULL;
}
@@ -1051,8 +1051,8 @@ g_daemon_file_append_to (GFile *file,
DBUS_TYPE_INVALID))
{
dbus_message_unref (reply);
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid return value from open"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid return value from open"));
return NULL;
}
@@ -1061,8 +1061,8 @@ g_daemon_file_append_to (GFile *file,
fd = _g_dbus_connection_get_fd_sync (connection, fd_id);
if (fd == -1)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Didn't get stream file descriptor"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Didn't get stream file descriptor"));
return NULL;
}
@@ -1110,8 +1110,8 @@ g_daemon_file_create (GFile *file,
DBUS_TYPE_INVALID))
{
dbus_message_unref (reply);
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid return value from open"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid return value from open"));
return NULL;
}
@@ -1120,8 +1120,8 @@ g_daemon_file_create (GFile *file,
fd = _g_dbus_connection_get_fd_sync (connection, fd_id);
if (fd == -1)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Didn't get stream file descriptor"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Didn't get stream file descriptor"));
return NULL;
}
@@ -1172,8 +1172,8 @@ g_daemon_file_replace (GFile *file,
DBUS_TYPE_INVALID))
{
dbus_message_unref (reply);
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid return value from open"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid return value from open"));
return NULL;
}
@@ -1182,8 +1182,8 @@ g_daemon_file_replace (GFile *file,
fd = _g_dbus_connection_get_fd_sync (connection, fd_id);
if (fd == -1)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Didn't get stream file descriptor"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Didn't get stream file descriptor"));
return NULL;
}
@@ -1530,8 +1530,8 @@ g_daemon_file_query_filesystem_info (GFile *file,
if (!dbus_message_iter_init (reply, &iter) ||
(dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRUCT))
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid return value from get_filesystem_info"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid return value from get_filesystem_info"));
goto out;
}
@@ -1640,11 +1640,11 @@ g_daemon_file_find_enclosing_mount (GFile *file,
return G_MOUNT (mount);
}
- g_set_error (error, G_IO_ERROR,
- G_IO_ERROR_NOT_FOUND,
+ g_set_error_literal (error, G_IO_ERROR,
+ G_IO_ERROR_NOT_FOUND,
/* translators: this is an error message when there is no user visible "mount" object
corresponding to a particular path/uri */
- "%s", _("Could not find enclosing mount"));
+ _("Could not find enclosing mount"));
return NULL;
}
@@ -1715,8 +1715,8 @@ g_daemon_file_set_display_name (GFile *file,
G_DBUS_TYPE_CSTRING, &new_path,
0))
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid return value from query_filesystem_info"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid return value from query_filesystem_info"));
goto out;
}
@@ -1958,7 +1958,7 @@ g_daemon_file_copy (GFile *source,
if (!G_IS_DAEMON_FILE (destination))
{
/* Fall back to default move */
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "%s", "Move not supported");
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Move not supported");
return FALSE;
}
@@ -1975,8 +1975,8 @@ g_daemon_file_copy (GFile *source,
if (local_path == NULL)
{
/* This will cause the fallback code to be involved */
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- "%s", _("Operation not supported, files on different mounts"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ _("Operation not supported, files on different mounts"));
return FALSE;
}
}
@@ -2048,7 +2048,7 @@ g_daemon_file_move (GFile *source,
!G_IS_DAEMON_FILE (destination))
{
/* Fall back to default move */
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "%s", "Move not supported");
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Move not supported");
return FALSE;
}
@@ -2120,8 +2120,8 @@ g_daemon_file_monitor_dir (GFile* file,
{
g_mount_info_unref (mount_info);
dbus_message_unref (reply);
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid return value from monitor_dir"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid return value from monitor_dir"));
return NULL;
}
@@ -2169,8 +2169,8 @@ g_daemon_file_monitor_file (GFile* file,
{
g_mount_info_unref (mount_info);
dbus_message_unref (reply);
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid return value from monitor_file"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid return value from monitor_file"));
return NULL;
}
diff --git a/client/gdaemonfileinputstream.c b/client/gdaemonfileinputstream.c
index b89b76ce..8cdc3622 100644
--- a/client/gdaemonfileinputstream.c
+++ b/client/gdaemonfileinputstream.c
@@ -377,11 +377,10 @@ decode_reply (GString *buffer, GVfsDaemonSocketProtocolReply *reply_out)
static void
decode_error (GVfsDaemonSocketProtocolReply *reply, char *data, GError **error)
{
- g_set_error (error,
- g_quark_from_string (data),
- reply->arg1,
- "%s",
- data + strlen (data) + 1);
+ g_set_error_literal (error,
+ g_quark_from_string (data),
+ reply->arg1,
+ data + strlen (data) + 1);
}
@@ -513,10 +512,10 @@ iterate_read_state_machine (GDaemonFileInputStream *file, IOOperationData *io_op
if (io_op->io_cancelled)
{
op->ret_val = -1;
- g_set_error (&op->ret_error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- "%s", _("Operation was cancelled"));
+ g_set_error_literal (&op->ret_error,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ _("Operation was cancelled"));
return STATE_OP_DONE;
}
@@ -669,11 +668,10 @@ iterate_read_state_machine (GDaemonFileInputStream *file, IOOperationData *io_op
if (io_op->io_cancelled)
{
op->ret_val = -1;
- g_set_error (&op->ret_error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- "%s",
- _("Operation was cancelled"));
+ g_set_error_literal (&op->ret_error,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ _("Operation was cancelled"));
return STATE_OP_DONE;
}
@@ -778,11 +776,10 @@ iterate_close_state_machine (GDaemonFileInputStream *file, IOOperationData *io_o
if (io_op->io_cancelled)
{
op->ret_val = FALSE;
- g_set_error (&op->ret_error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- "%s",
- _("Operation was cancelled"));
+ g_set_error_literal (&op->ret_error,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ _("Operation was cancelled"));
return STATE_OP_DONE;
}
@@ -1029,11 +1026,10 @@ iterate_seek_state_machine (GDaemonFileInputStream *file, IOOperationData *io_op
if (io_op->io_cancelled)
{
op->ret_val = -1;
- g_set_error (&op->ret_error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- "%s",
- _("Operation was cancelled"));
+ g_set_error_literal (&op->ret_error,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ _("Operation was cancelled"));
return STATE_OP_DONE;
}
@@ -1207,8 +1203,8 @@ g_daemon_file_input_stream_seek (GFileInputStream *stream,
if (!file->can_seek)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- "%s", _("Seek not supported on stream"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ _("Seek not supported on stream"));
return FALSE;
}
@@ -1238,7 +1234,7 @@ g_daemon_file_input_stream_query_info (GFileInputStream *stream,
GCancellable *cancellable,
GError **error)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "%s", _("The query info operation is not supported"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, _("The query info operation is not supported"));
return NULL;
}
diff --git a/client/gdaemonfileoutputstream.c b/client/gdaemonfileoutputstream.c
index b816f136..32daea41 100644
--- a/client/gdaemonfileoutputstream.c
+++ b/client/gdaemonfileoutputstream.c
@@ -329,11 +329,10 @@ decode_reply (GString *buffer, GVfsDaemonSocketProtocolReply *reply_out)
static void
decode_error (GVfsDaemonSocketProtocolReply *reply, char *data, GError **error)
{
- g_set_error (error,
- g_quark_from_string (data),
- reply->arg1,
- "%s",
- data + strlen (data) + 1);
+ g_set_error_literal (error,
+ g_quark_from_string (data),
+ reply->arg1,
+ data + strlen (data) + 1);
}
@@ -453,11 +452,10 @@ iterate_write_state_machine (GDaemonFileOutputStream *file, IOOperationData *io_
if (io_op->io_cancelled)
{
op->ret_val = -1;
- g_set_error (&op->ret_error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- "%s",
- _("Operation was cancelled"));
+ g_set_error_literal (&op->ret_error,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ _("Operation was cancelled"));
return STATE_OP_DONE;
}
@@ -632,11 +630,10 @@ iterate_close_state_machine (GDaemonFileOutputStream *file, IOOperationData *io_
if (io_op->io_cancelled)
{
op->ret_val = FALSE;
- g_set_error (&op->ret_error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- "%s",
- _("Operation was cancelled"));
+ g_set_error_literal (&op->ret_error,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ _("Operation was cancelled"));
return STATE_OP_DONE;
}
@@ -828,11 +825,10 @@ iterate_seek_state_machine (GDaemonFileOutputStream *file, IOOperationData *io_o
if (io_op->io_cancelled)
{
op->ret_val = -1;
- g_set_error (&op->ret_error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- "%s",
- _("Operation was cancelled"));
+ g_set_error_literal (&op->ret_error,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ _("Operation was cancelled"));
return STATE_OP_DONE;
}
@@ -942,8 +938,8 @@ g_daemon_file_output_stream_seek (GFileOutputStream *stream,
if (!file->can_seek)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- "%s", _("Seek not supported on stream"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ _("Seek not supported on stream"));
return FALSE;
}
diff --git a/client/gvfsdaemondbus.c b/client/gvfsdaemondbus.c
index c062cbdc..aabb8dea 100644
--- a/client/gvfsdaemondbus.c
+++ b/client/gvfsdaemondbus.c
@@ -881,10 +881,10 @@ invalidate_local_connection (const char *dbus_id,
if (local)
g_hash_table_remove (local->connections, dbus_id);
- g_set_error (error,
- G_VFS_ERROR,
- G_VFS_ERROR_RETRY,
- "Cache invalid, retry (internally handled)");
+ g_set_error_literal (error,
+ G_VFS_ERROR,
+ G_VFS_ERROR_RETRY,
+ "Cache invalid, retry (internally handled)");
}
DBusConnection *
@@ -954,7 +954,7 @@ _g_dbus_connection_get_sync (const char *dbus_id,
if (bus == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Couldn't get main dbus connection: %s\n",
+ "Couldn't get main dbus connection: %s",
derror.message);
dbus_error_free (&derror);
return NULL;
diff --git a/common/gdbusutils.c b/common/gdbusutils.c
index 489d24ee..e55016dd 100644
--- a/common/gdbusutils.c
+++ b/common/gdbusutils.c
@@ -628,7 +628,7 @@ _g_error_from_dbus (DBusError *derror,
code = atoi (end);
}
- g_set_error (error, domain, code, "%s", derror->message);
+ g_set_error_literal (error, domain, code, derror->message);
}
/* TODO: Special case other types, like DBUS_ERROR_NO_MEMORY etc? */
else
@@ -1345,8 +1345,8 @@ _g_dbus_connection_call_async (DBusConnection *connection,
connection = dbus_bus_get (DBUS_BUS_SESSION, &derror);
if (connection == NULL)
{
- g_set_error (&data->io_error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Can't open dbus connection");
+ g_set_error_literal (&data->io_error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Can't open dbus connection");
g_idle_add (async_call_error_at_idle, data);
return;
}
diff --git a/common/gvfsdaemonprotocol.c b/common/gvfsdaemonprotocol.c
index 2715dce0..36331ed8 100644
--- a/common/gvfsdaemonprotocol.c
+++ b/common/gvfsdaemonprotocol.c
@@ -511,8 +511,8 @@ _g_dbus_get_file_info (DBusMessageIter *iter,
error:
g_object_unref (info);
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid file info format"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid file info format"));
return NULL;
}
@@ -528,8 +528,8 @@ _g_dbus_get_attribute_info_list (DBusMessageIter *iter,
if (dbus_message_iter_get_arg_type (iter) != DBUS_TYPE_ARRAY ||
dbus_message_iter_get_element_type (iter) != DBUS_TYPE_STRUCT)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid attribute info list content"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid attribute info list content"));
return NULL;
}
diff --git a/daemon/gvfsbackendarchive.c b/daemon/gvfsbackendarchive.c
index 71f32365..a721bec2 100644
--- a/daemon/gvfsbackendarchive.c
+++ b/daemon/gvfsbackendarchive.c
@@ -630,10 +630,10 @@ do_open_for_read (GVfsBackend * backend,
if (!gvfs_archive_in_error (archive))
{
- g_set_error (&archive->error,
- G_IO_ERROR,
- G_IO_ERROR_NOT_FOUND,
- _("File doesn't exist"));
+ g_set_error_literal (&archive->error,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_FOUND,
+ _("File doesn't exist"));
}
gvfs_archive_finish (archive);
}
diff --git a/daemon/gvfsbackendcdda.c b/daemon/gvfsbackendcdda.c
index 49eb2582..4768cd0a 100644
--- a/daemon/gvfsbackendcdda.c
+++ b/daemon/gvfsbackendcdda.c
@@ -220,7 +220,7 @@ do_mount (GVfsBackend *backend,
{
release_device (cdda_backend);
dbus_error_free (&dbus_error);
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot connect to the system bus"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot connect to the system bus"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return;
@@ -230,7 +230,7 @@ do_mount (GVfsBackend *backend,
if (cdda_backend->hal_ctx == NULL)
{
release_device (cdda_backend);
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot create libhal context"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot create libhal context"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return;
@@ -243,7 +243,7 @@ do_mount (GVfsBackend *backend,
{
release_device (cdda_backend);
dbus_error_free (&dbus_error);
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot initialize libhal"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot initialize libhal"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return;
@@ -258,7 +258,7 @@ do_mount (GVfsBackend *backend,
//g_warning ("host=%s", host);
if (host == NULL)
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "%s", _("No drive specified"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("No drive specified"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
release_device (cdda_backend);
@@ -329,7 +329,7 @@ try_mount (GVfsBackend *backend,
//g_warning ("tm host=%s", host);
if (host == NULL)
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "%s", _("No drive specified"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("No drive specified"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return TRUE;
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index 6855cc7b..de1aa603 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -499,7 +499,6 @@ parse_xml (SoupMessage *msg,
if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
{
-
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("HTTP Error: %s"), msg->reason_phrase);
return NULL;
@@ -516,8 +515,8 @@ parse_xml (SoupMessage *msg,
XML_PARSE_COMPACT);
if (doc == NULL)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Could not parse response"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Could not parse response"));
return NULL;
}
@@ -525,15 +524,15 @@ parse_xml (SoupMessage *msg,
if (*root == NULL || (*root)->children == NULL)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Empty response"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Empty response"));
return NULL;
}
if (strcmp ((char *) (*root)->name, name))
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Unexpected reply from server"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Unexpected reply from server"));
return NULL;
}
@@ -1130,10 +1129,10 @@ stat_location (GVfsBackend *backend,
if (status != 207)
{
- g_set_error (error,
- G_IO_ERROR,
- http_error_code_from_status (status),
- "%s", msg->reason_phrase);
+ g_set_error_literal (error,
+ G_IO_ERROR,
+ http_error_code_from_status (status),
+ msg->reason_phrase);
return FALSE;
}
@@ -1141,9 +1140,9 @@ stat_location (GVfsBackend *backend,
res = stat_location_finish (msg, target_type, num_children);
if (res == FALSE)
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Response invalid"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Response invalid"));
return res;
}
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index e5079374..b75e01ef 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -290,7 +290,7 @@ ftp_connection_set_error_from_response (FtpConnection *conn, guint response)
}
DEBUG ("error: %s\n", msg);
- g_set_error (&conn->error, G_IO_ERROR, code, "%s", msg);
+ g_set_error_literal (&conn->error, G_IO_ERROR, code, msg);
}
/**
@@ -360,8 +360,8 @@ ftp_connection_receive (FtpConnection *conn,
}
else
{
- g_set_error (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Invalid reply"));
+ g_set_error_literal (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid reply"));
return 0;
}
}
@@ -389,8 +389,8 @@ ftp_connection_receive (FtpConnection *conn,
break;
if (n_bytes > 0)
continue;
- g_set_error (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Invalid reply"));
+ g_set_error_literal (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid reply"));
/* fall through */
case SOUP_SOCKET_ERROR:
conn->read_buffer[conn->read_bytes] = 0;
@@ -408,8 +408,8 @@ ftp_connection_receive (FtpConnection *conn,
last_line[1] < '0' || last_line[1] > '9' ||
last_line[2] < '0' || last_line[2] > '9')
{
- g_set_error (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Invalid reply"));
+ g_set_error_literal (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid reply"));
return 0;
}
response = 100 * (last_line[0] - '0') +
@@ -421,8 +421,8 @@ ftp_connection_receive (FtpConnection *conn,
reply_state = MULTILINE;
else
{
- g_set_error (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Invalid reply"));
+ g_set_error_literal (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid reply"));
return 0;
}
}
@@ -528,8 +528,8 @@ ftp_connection_sendv (FtpConnection *conn,
case SOUP_SOCKET_EOF:
if (n_bytes == command->len)
break;
- g_set_error (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("broken transmission"));
+ g_set_error_literal (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("broken transmission"));
/* fall through */
case SOUP_SOCKET_ERROR:
g_string_free (command, TRUE);
@@ -671,10 +671,10 @@ ftp_connection_create (SoupAddress * addr,
if (!SOUP_STATUS_IS_SUCCESSFUL (status))
{
/* FIXME: better error messages depending on status please */
- g_set_error (&conn->error,
- G_IO_ERROR,
- G_IO_ERROR_HOST_NOT_FOUND,
- _("Could not connect to host"));
+ g_set_error_literal (&conn->error,
+ G_IO_ERROR,
+ G_IO_ERROR_HOST_NOT_FOUND,
+ _("Could not connect to host"));
}
ftp_connection_receive (conn, 0);
@@ -813,8 +813,8 @@ ftp_connection_ensure_data_connection (FtpConnection *conn)
}
if (*s == 0)
{
- g_set_error (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Invalid reply"));
+ g_set_error_literal (&conn->error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid reply"));
return FALSE;
}
ip = g_strdup_printf ("%u.%u.%u.%u", ip1, ip2, ip3, ip4);
@@ -831,10 +831,10 @@ have_address:
if (!SOUP_STATUS_IS_SUCCESSFUL (status))
{
/* FIXME: better error messages depending on status please */
- g_set_error (&conn->error,
- G_IO_ERROR,
- G_IO_ERROR_HOST_NOT_FOUND,
- _("Could not connect to host"));
+ g_set_error_literal (&conn->error,
+ G_IO_ERROR,
+ G_IO_ERROR_HOST_NOT_FOUND,
+ _("Could not connect to host"));
g_object_unref (conn->data);
conn->data = NULL;
return FALSE;
@@ -907,9 +907,9 @@ ftp_connection_cd (FtpConnection *conn, const FtpFile *file)
"CWD %s", file);
if (response == 550)
{
- g_set_error (&conn->error,
- G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY,
- _("The file is not a directory"));
+ g_set_error_literal (&conn->error,
+ G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY,
+ _("The file is not a directory"));
response = 0;
}
else if (STATUS_GROUP (response) == 5)
@@ -1358,8 +1358,8 @@ do_mount (GVfsBackend *backend,
&password_save) ||
aborted)
{
- g_set_error (&conn->error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "%s", _("Password dialog cancelled"));
+ g_set_error_literal (&conn->error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ _("Password dialog cancelled"));
break;
}
@@ -1524,9 +1524,9 @@ error_550_is_directory (FtpConnection *conn, const FtpFile *file)
if (STATUS_GROUP (response) == 2)
{
- g_set_error (&conn->error, G_IO_ERROR,
- G_IO_ERROR_IS_DIRECTORY,
- _("File is directory"));
+ g_set_error_literal (&conn->error, G_IO_ERROR,
+ G_IO_ERROR_IS_DIRECTORY,
+ _("File is directory"));
}
}
@@ -1693,10 +1693,10 @@ do_create (GVfsBackend *backend,
if (info)
{
g_object_unref (info);
- g_set_error (&conn->error,
- G_IO_ERROR,
- G_IO_ERROR_EXISTS,
- _("Target file already exists"));
+ g_set_error_literal (&conn->error,
+ G_IO_ERROR,
+ G_IO_ERROR_EXISTS,
+ _("Target file already exists"));
goto error;
}
file = ftp_filename_from_gvfs_path (conn, filename);
@@ -1824,8 +1824,8 @@ do_enumerate_directory (FtpConnection *conn)
{
if (size >= 16384)
{
- g_set_error (&conn->error, G_IO_ERROR, G_IO_ERROR_FILENAME_TOO_LONG,
- _("filename too long"));
+ g_set_error_literal (&conn->error, G_IO_ERROR, G_IO_ERROR_FILENAME_TOO_LONG,
+ _("filename too long"));
break;
}
size += 128;
@@ -2095,10 +2095,10 @@ do_query_info (GVfsBackend *backend,
g_object_unref (real);
}
else if (!ftp_connection_in_error (conn))
- g_set_error (&conn->error,
- G_IO_ERROR,
- G_IO_ERROR_NOT_FOUND,
- _("File doesn't exist"));
+ g_set_error_literal (&conn->error,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_FOUND,
+ _("File doesn't exist"));
g_vfs_backend_ftp_push_connection (ftp, conn);
}
@@ -2205,10 +2205,10 @@ do_set_display_name (GVfsBackend *backend,
now = ftp_filename_construct (conn, dir, display_name);
if (now == NULL)
{
- g_set_error (&conn->error,
- G_IO_ERROR,
- G_IO_ERROR_INVALID_FILENAME,
- _("Invalid filename"));
+ g_set_error_literal (&conn->error,
+ G_IO_ERROR,
+ G_IO_ERROR_INVALID_FILENAME,
+ _("Invalid filename"));
}
ftp_connection_send (conn,
RESPONSE_PASS_300 | RESPONSE_FAIL_200,
@@ -2258,10 +2258,10 @@ do_delete (GVfsBackend *backend,
if (files)
{
g_static_rw_lock_reader_unlock (&ftp->directory_cache_lock);
- g_set_error (&conn->error,
- G_IO_ERROR,
- G_IO_ERROR_NOT_EMPTY,
- "%s", g_strerror (ENOTEMPTY));
+ g_set_error_literal (&conn->error,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_EMPTY,
+ g_strerror (ENOTEMPTY));
}
else
ftp_connection_set_error_from_response (conn, response);
@@ -2340,9 +2340,9 @@ do_move (GVfsBackend *backend,
g_free (basename);
if (real == NULL)
- g_set_error (&conn->error,
- G_IO_ERROR, G_IO_ERROR_INVALID_FILENAME,
- _("Invalid destination filename"));
+ g_set_error_literal (&conn->error,
+ G_IO_ERROR, G_IO_ERROR_INVALID_FILENAME,
+ _("Invalid destination filename"));
else
{
g_free (destfile);
@@ -2359,10 +2359,10 @@ do_move (GVfsBackend *backend,
if (info)
{
g_object_unref (info);
- g_set_error (&conn->error,
- G_IO_ERROR,
- G_IO_ERROR_EXISTS,
- _("Target file already exists"));
+ g_set_error_literal (&conn->error,
+ G_IO_ERROR,
+ G_IO_ERROR_EXISTS,
+ _("Target file already exists"));
goto out;
}
}
diff --git a/daemon/gvfsbackendgphoto2.c b/daemon/gvfsbackendgphoto2.c
index 6f96ea4b..cc7b2a0d 100644
--- a/daemon/gvfsbackendgphoto2.c
+++ b/daemon/gvfsbackendgphoto2.c
@@ -1399,7 +1399,7 @@ do_mount (GVfsBackend *backend,
{
release_device (gphoto2_backend);
dbus_error_free (&dbus_error);
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot connect to the system bus"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot connect to the system bus"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return;
@@ -1411,7 +1411,7 @@ do_mount (GVfsBackend *backend,
if (gphoto2_backend->hal_ctx == NULL)
{
release_device (gphoto2_backend);
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot create libhal context"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot create libhal context"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return;
@@ -1424,7 +1424,7 @@ do_mount (GVfsBackend *backend,
{
release_device (gphoto2_backend);
dbus_error_free (&dbus_error);
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot initialize libhal"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot initialize libhal"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return;
@@ -1439,7 +1439,7 @@ do_mount (GVfsBackend *backend,
DEBUG (" host='%s'", host);
if (host == NULL || strlen (host) < 3 || host[0] != '[' || host[strlen (host) - 1] != ']')
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("No device specified"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("No device specified"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
release_device (gphoto2_backend);
@@ -1456,7 +1456,7 @@ do_mount (GVfsBackend *backend,
gphoto2_backend->context = gp_context_new ();
if (gphoto2_backend->context == NULL)
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot create gphoto2 context"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot create gphoto2 context"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
release_device (gphoto2_backend);
@@ -1624,7 +1624,7 @@ try_mount (GVfsBackend *backend,
DEBUG (" host=%s", host);
if (host == NULL)
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("No camera specified"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("No camera specified"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return TRUE;
diff --git a/daemon/gvfsbackendobexftp-cap-parser.c b/daemon/gvfsbackendobexftp-cap-parser.c
index 70ce4cf4..183195e7 100644
--- a/daemon/gvfsbackendobexftp-cap-parser.c
+++ b/daemon/gvfsbackendobexftp-cap-parser.c
@@ -441,10 +441,10 @@ ovu_caps_parser_parse (const gchar *buf,
caps = NULL;
if (*error == NULL) {
- g_set_error (error,
- G_MARKUP_ERROR,
- G_MARKUP_ERROR_INVALID_CONTENT,
- "Couldn't parse the incoming data");
+ g_set_error_literal (error,
+ G_MARKUP_ERROR,
+ G_MARKUP_ERROR_INVALID_CONTENT,
+ "Couldn't parse the incoming data");
}
cap_parser_free (data, TRUE);
diff --git a/daemon/gvfsbackendobexftp-fl-parser.c b/daemon/gvfsbackendobexftp-fl-parser.c
index 79576d8e..9c491688 100644
--- a/daemon/gvfsbackendobexftp-fl-parser.c
+++ b/daemon/gvfsbackendobexftp-fl-parser.c
@@ -367,10 +367,10 @@ gvfsbackendobexftp_fl_parser_parse (const gchar *buf, gint len, GList **elements
fl_parser_free_parser_data (data, TRUE);
if (*error == NULL) {
- g_set_error (error,
- G_MARKUP_ERROR,
- G_MARKUP_ERROR_INVALID_CONTENT,
- "Couldn't parse the incoming data");
+ g_set_error_literal (error,
+ G_MARKUP_ERROR,
+ G_MARKUP_ERROR_INVALID_CONTENT,
+ "Couldn't parse the incoming data");
}
return FALSE;
}
diff --git a/daemon/gvfsbackendobexftp.c b/daemon/gvfsbackendobexftp.c
index a6d5131b..23bea15f 100644
--- a/daemon/gvfsbackendobexftp.c
+++ b/daemon/gvfsbackendobexftp.c
@@ -483,9 +483,9 @@ _query_file_info_helper (GVfsBackend *backend,
if (found == FALSE)
{
- g_set_error (error, G_IO_ERROR,
- G_IO_ERROR_NOT_FOUND,
- "%s", g_strerror (ENOENT));
+ g_set_error_literal (error, G_IO_ERROR,
+ G_IO_ERROR_NOT_FOUND,
+ g_strerror (ENOENT));
}
g_free (basename);
@@ -1305,9 +1305,9 @@ do_delete (GVfsBackend *backend,
if (len != 0)
{
g_mutex_unlock (op_backend->mutex);
- g_set_error (&error, G_IO_ERROR,
- G_IO_ERROR_NOT_EMPTY,
- "%s", g_strerror (ENOTEMPTY));
+ g_set_error_literal (&error, G_IO_ERROR,
+ G_IO_ERROR_NOT_EMPTY,
+ g_strerror (ENOTEMPTY));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return;
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 31c9474b..ec4221bd 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -275,45 +275,45 @@ look_for_stderr_errors (GVfsBackend *backend, GError **error)
if (line == NULL)
{
/* Error (real or WOULDBLOCK) or EOF */
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("ssh program unexpectedly exited"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("ssh program unexpectedly exited"));
return;
}
if (strstr (line, "Permission denied") != NULL)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "%s", _("Permission denied"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ _("Permission denied"));
return;
}
else if (strstr (line, "Name or service not known") != NULL)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_HOST_NOT_FOUND,
- "%s", _("Hostname not known"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_HOST_NOT_FOUND,
+ _("Hostname not known"));
return;
}
else if (strstr (line, "No route to host") != NULL)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_HOST_NOT_FOUND,
- "%s", _("No route to host"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_HOST_NOT_FOUND,
+ _("No route to host"));
return;
}
else if (strstr (line, "Connection refused") != NULL)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "%s", _("Connection refused by server"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ _("Connection refused by server"));
return;
}
else if (strstr (line, "Host key verification failed") != NULL)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Host key verification failed"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Host key verification failed"));
return;
}
@@ -394,9 +394,9 @@ spawn_ssh (GVfsBackend *backend,
stdin_fd, stdout_fd, stderr_fd);
if (*tty_fd == -1)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Unable to spawn ssh program"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Unable to spawn ssh program"));
return FALSE;
}
#else
@@ -522,9 +522,9 @@ wait_for_reply (GVfsBackend *backend, int stdout_fd, GError **error)
if (ret <= 0)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
- "%s", _("Timed out when logging in"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
+ _("Timed out when logging in"));
return FALSE;
}
return TRUE;
@@ -774,9 +774,9 @@ handle_login (GVfsBackend *backend,
if (ret <= 0)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
- "%s", _("Timed out when logging in"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
+ _("Timed out when logging in"));
ret_val = FALSE;
break;
}
@@ -868,9 +868,9 @@ handle_login (GVfsBackend *backend,
&password_save) ||
aborted)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "%s", _("Password dialog cancelled"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ _("Password dialog cancelled"));
ret_val = FALSE;
break;
}
@@ -895,9 +895,9 @@ handle_login (GVfsBackend *backend,
op_backend->tmp_password = new_password;
new_password = NULL;
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
- "Invalid user name");
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+ "Invalid user name");
ret_val = FALSE;
break;
}
@@ -915,9 +915,9 @@ handle_login (GVfsBackend *backend,
&bytes_written,
NULL, NULL))
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "%s", _("Can't send password"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ _("Can't send password"));
ret_val = FALSE;
break;
}
@@ -953,9 +953,9 @@ handle_login (GVfsBackend *backend,
&choice) ||
aborted)
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "%s", _("Login dialog cancelled"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ _("Login dialog cancelled"));
g_free (message);
ret_val = FALSE;
break;
@@ -973,9 +973,9 @@ handle_login (GVfsBackend *backend,
&bytes_written,
NULL, NULL))
{
- g_set_error (error,
- G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "%s", _("Can't send host identity confirmation"));
+ g_set_error_literal (error,
+ G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+ _("Can't send host identity confirmation"));
ret_val = FALSE;
break;
}
@@ -1468,7 +1468,7 @@ do_mount (GVfsBackend *backend,
if (g_data_input_stream_read_byte (reply, NULL, NULL) != SSH_FXP_VERSION)
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "%s", _("Protocol error"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Protocol error"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return;
@@ -1491,7 +1491,7 @@ do_mount (GVfsBackend *backend,
if (!get_uid_sync (op_backend))
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "%s", _("Protocol error"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Protocol error"));
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
return;
@@ -2258,8 +2258,8 @@ close_deleted_file (GVfsBackendSftp *backend,
if (reply_type == SSH_FXP_STATUS)
res = error_from_status (job, reply, -1, -1, &error);
else
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid reply received"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid reply received"));
if (res)
{
@@ -2304,8 +2304,8 @@ close_moved_file (GVfsBackendSftp *backend,
if (reply_type == SSH_FXP_STATUS)
res = error_from_status (job, reply, -1, -1, &error);
else
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid reply received"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid reply received"));
if (res)
{
@@ -2379,8 +2379,8 @@ close_write_reply (GVfsBackendSftp *backend,
if (reply_type == SSH_FXP_STATUS)
res = error_from_status (job, reply, -1, -1, &error);
else
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid reply received"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid reply received"));
if (res)
{
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 5d1bfd28..7b5204e4 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1015,9 +1015,9 @@ do_replace (GVfsBackend *backend,
{
int errsv = errno;
- g_set_error (&error, G_IO_ERROR,
- g_io_error_from_errno (errsv),
- "%s", g_strerror (errsv));
+ g_set_error_literal (&error, G_IO_ERROR,
+ g_io_error_from_errno (errsv),
+ g_strerror (errsv));
goto error;
}
else if (file == NULL && errno == EEXIST)
@@ -1032,11 +1032,10 @@ do_replace (GVfsBackend *backend,
if (strcmp (etag, current_etag) != 0)
{
g_free (current_etag);
- g_set_error (&error,
- G_IO_ERROR,
- G_IO_ERROR_WRONG_ETAG,
- "%s",
- _("The file was externally modified"));
+ g_set_error_literal (&error,
+ G_IO_ERROR,
+ G_IO_ERROR_WRONG_ETAG,
+ _("The file was externally modified"));
goto error;
}
g_free (current_etag);
@@ -1064,17 +1063,15 @@ do_replace (GVfsBackend *backend,
if (!copy_file (op_backend, G_VFS_JOB (job), uri, backup_uri))
{
if (g_vfs_job_is_cancelled (G_VFS_JOB (job)))
- g_set_error (&error,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- "%s",
- _("Operation was cancelled"));
+ g_set_error_literal (&error,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ _("Operation was cancelled"));
else
- g_set_error (&error,
- G_IO_ERROR,
- G_IO_ERROR_CANT_CREATE_BACKUP,
- "%s",
- _("Backup file creation failed"));
+ g_set_error_literal (&error,
+ G_IO_ERROR,
+ G_IO_ERROR_CANT_CREATE_BACKUP,
+ _("Backup file creation failed"));
goto error;
}
g_free (backup_uri);
@@ -1087,9 +1084,9 @@ do_replace (GVfsBackend *backend,
{
int errsv = errno;
- g_set_error (&error, G_IO_ERROR,
- g_io_error_from_errno (errsv),
- "%s", g_strerror (errsv));
+ g_set_error_literal (&error, G_IO_ERROR,
+ g_io_error_from_errno (errsv),
+ g_strerror (errsv));
goto error;
}
}
@@ -1540,9 +1537,9 @@ do_enumerate (GVfsBackend *backend,
int errsv = errno;
error = NULL;
- g_set_error (&error, G_IO_ERROR,
- g_io_error_from_errno (errsv),
- "%s", g_strerror (errsv));
+ g_set_error_literal (&error, G_IO_ERROR,
+ g_io_error_from_errno (errsv),
+ g_strerror (errsv));
goto error;
}
diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c
index 0dc4f222..3ae0c87e 100644
--- a/daemon/gvfsbackendsmbbrowse.c
+++ b/daemon/gvfsbackendsmbbrowse.c
@@ -794,14 +794,14 @@ run_mount_mountable (GVfsBackendSmbBrowse *backend,
g_mount_spec_unref (mount_spec);
}
else
- g_set_error (&error,
- G_IO_ERROR, G_IO_ERROR_NOT_MOUNTABLE_FILE,
- "%s", _("The file is not a mountable"));
+ g_set_error_literal (&error,
+ G_IO_ERROR, G_IO_ERROR_NOT_MOUNTABLE_FILE,
+ _("The file is not a mountable"));
}
else
- g_set_error (&error,
- G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
- "%s", _("File doesn't exist"));
+ g_set_error_literal (&error,
+ G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+ _("File doesn't exist"));
g_mutex_unlock (backend->entries_lock);
diff --git a/daemon/gvfsjob.c b/daemon/gvfsjob.c
index 4f2ae45f..9aa168c2 100644
--- a/daemon/gvfsjob.c
+++ b/daemon/gvfsjob.c
@@ -289,9 +289,9 @@ g_vfs_job_failed_from_errno (GVfsJob *job,
{
GError *error = NULL;
- g_set_error (&error, G_IO_ERROR,
- g_io_error_from_errno (errno_arg),
- "%s", g_strerror (errno_arg));
+ g_set_error_literal (&error, G_IO_ERROR,
+ g_io_error_from_errno (errno_arg),
+ g_strerror (errno_arg));
g_vfs_job_failed_from_error (job, error);
g_error_free (error);
}
diff --git a/daemon/gvfsjobopenforwrite.c b/daemon/gvfsjobopenforwrite.c
index 21e492eb..f456f839 100644
--- a/daemon/gvfsjobopenforwrite.c
+++ b/daemon/gvfsjobopenforwrite.c
@@ -226,8 +226,8 @@ try (GVfsJob *job)
else
{
GError *error = NULL;
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
- "Wrong open for write type");
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+ "Wrong open for write type");
g_vfs_job_failed_from_error (job, error);
g_error_free (error);
return TRUE;
diff --git a/daemon/gvfsreadchannel.c b/daemon/gvfsreadchannel.c
index 225b92b4..c6e079b0 100644
--- a/daemon/gvfsreadchannel.c
+++ b/daemon/gvfsreadchannel.c
@@ -172,7 +172,7 @@ read_channel_handle_request (GVfsChannel *channel,
default:
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_FAILED,
- "Unknown stream command %"G_GUINT32_FORMAT"\n", command);
+ "Unknown stream command %"G_GUINT32_FORMAT, command);
break;
}
diff --git a/daemon/gvfswritechannel.c b/daemon/gvfswritechannel.c
index 6a2c8f33..e340914b 100644
--- a/daemon/gvfswritechannel.c
+++ b/daemon/gvfswritechannel.c
@@ -139,7 +139,7 @@ write_channel_handle_request (GVfsChannel *channel,
default:
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_FAILED,
- "Unknown stream command %"G_GUINT32_FORMAT"\n", command);
+ "Unknown stream command %"G_GUINT32_FORMAT, command);
break;
}
diff --git a/daemon/mount.c b/daemon/mount.c
index 519d8a66..75ef6be6 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -435,14 +435,14 @@ spawn_mount_message_function (DBusConnection *connection,
DBUS_TYPE_STRING, &error_message,
DBUS_TYPE_INVALID))
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s", _("Invalid arguments from spawned child"));
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Invalid arguments from spawned child"));
mount_finish (data, error);
g_error_free (error);
}
else if (!succeeded)
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "%s", error_message);
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, error_message);
mount_finish (data, error);
g_error_free (error);
}
@@ -472,8 +472,8 @@ spawn_mount (MountData *data)
error = NULL;
if (data->mountable->exec == NULL)
{
- g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "No exec key defined for mountpoint");
+ g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "No exec key defined for mountpoint");
mount_finish (data, error);
g_error_free (error);
}
diff --git a/daemon/soup-input-stream.c b/daemon/soup-input-stream.c
index b529388e..fd9cf8cf 100644
--- a/daemon/soup-input-stream.c
+++ b/daemon/soup-input-stream.c
@@ -381,8 +381,8 @@ set_error_if_http_failed (SoupMessage *msg, GError **error)
{
if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
{
- g_set_error (error, SOUP_HTTP_ERROR,
- msg->status_code, "%s", msg->reason_phrase);
+ g_set_error_literal (error, SOUP_HTTP_ERROR,
+ msg->status_code, msg->reason_phrase);
return TRUE;
}
return FALSE;
@@ -849,8 +849,8 @@ soup_input_stream_seek (GSeekable *seekable,
* We could find the Content-Length by doing a HEAD...
*/
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- "G_SEEK_END not currently supported");
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ "G_SEEK_END not currently supported");
return FALSE;
}
@@ -902,8 +902,8 @@ soup_input_stream_truncate (GSeekable *seekable,
GCancellable *cancellable,
GError **error)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- "Truncate not allowed on input stream");
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ "Truncate not allowed on input stream");
return FALSE;
}
diff --git a/daemon/soup-output-stream.c b/daemon/soup-output-stream.c
index 29e41590..86ff8a43 100644
--- a/daemon/soup-output-stream.c
+++ b/daemon/soup-output-stream.c
@@ -239,8 +239,8 @@ set_error_if_http_failed (SoupMessage *msg, GError **error)
{
if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
{
- g_set_error (error, SOUP_HTTP_ERROR,
- msg->status_code, "%s", msg->reason_phrase);
+ g_set_error_literal (error, SOUP_HTTP_ERROR,
+ msg->status_code, msg->reason_phrase);
return TRUE;
}
return FALSE;
@@ -256,8 +256,8 @@ soup_output_stream_write (GOutputStream *stream,
SoupOutputStreamPrivate *priv = SOUP_OUTPUT_STREAM_GET_PRIVATE (stream);
if (priv->size > 0 && priv->offset + count > priv->size) {
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NO_SPACE,
- "Write would exceed caller-defined file size");
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NO_SPACE,
+ "Write would exceed caller-defined file size");
return -1;
}
@@ -274,8 +274,8 @@ soup_output_stream_close (GOutputStream *stream,
SoupOutputStreamPrivate *priv = SOUP_OUTPUT_STREAM_GET_PRIVATE (stream);
if (priv->size > 0 && priv->offset != priv->size) {
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NO_SPACE,
- "File is incomplete");
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NO_SPACE,
+ "File is incomplete");
return -1;
}