Commit 9c17697b authored by Christian Persch's avatar Christian Persch

Use g_set_error_literal where appropriate. Patch from bug #535947.

svn path=/trunk/; revision=7051
parent 9c50d657
2008-06-16 Christian Persch <chpe@gnome.org>
* glib/gbookmarkfile.c
* glib/gconvert.c
* glib/gfileutils.c
* glib/giochannel.c
* glib/giounix.c
* glib/giowin32.c
* glib/gkeyfile.c
* glib/gregex.c
* glib/gshell.c
* glib/gspawn-win32.c
* glib/gutf8.c: Use g_set_error_literal where appropriate. Patch from
bug #535947.
2008-06-16 Christian Persch <chpe@gnome.org>
* docs/reference/glib/glib-sections.txt:
......
2008-06-16 Christian Persch <chpe@gnome.org>
* gio/gappinfo.c
* gio/gbufferedinputstream.c
* gio/gcancellable.c
* gio/gdatainputstream.c
* gio/gdesktopappinfo.c
* gio/gfile.c
* gio/gfileenumerator.c
* gio/gfileinputstream.c
* gio/gfileoutputstream.c
* gio/ginputstream.c
* gio/glocaldirectorymonitor.c
* gio/glocalfile.c
* gio/glocalfileenumerator.c
* gio/glocalfileinfo.c
* gio/glocalfilemonitor.c
* gio/glocalfileoutputstream.c
* gio/gmemoryinputstream.c
* gio/gmemoryoutputstream.c
* gio/goutputstream.c
* gio/gwin32appinfo.c: Use g_set_error_literal where appropriate. Patch from
bug #535947.
2008-06-16 Tor Lillqvist <tml@novell.com>
Bug 538362 - Get Win32 icons back in the file chooser
......
......@@ -271,7 +271,8 @@ g_app_info_set_as_default_for_extension (GAppInfo *appinfo,
if (iface->set_as_default_for_extension)
return (* iface->set_as_default_for_extension) (appinfo, extension, error);
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "g_app_info_set_as_default_for_extension not supported yet");
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"g_app_info_set_as_default_for_extension not supported yet");
return FALSE;
}
......@@ -302,9 +303,9 @@ g_app_info_add_supports_type (GAppInfo *appinfo,
if (iface->add_supports_type)
return (* iface->add_supports_type) (appinfo, content_type, error);
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"g_app_info_add_supports_type not supported yet");
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"g_app_info_add_supports_type not supported yet");
return FALSE;
}
......@@ -360,9 +361,9 @@ g_app_info_remove_supports_type (GAppInfo *appinfo,
if (iface->remove_supports_type)
return (* iface->remove_supports_type) (appinfo, content_type, error);
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"g_app_info_remove_supports_type not supported yet");
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"g_app_info_remove_supports_type not supported yet");
return FALSE;
}
......
......@@ -865,8 +865,8 @@ g_buffered_input_stream_read_byte (GBufferedInputStream *stream,
if (g_input_stream_is_closed (input_stream))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED,
_("Stream is already closed"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CLOSED,
_("Stream is already closed"));
return -1;
}
......
......@@ -289,10 +289,10 @@ g_cancellable_set_error_if_cancelled (GCancellable *cancellable,
{
if (g_cancellable_is_cancelled (cancellable))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_CANCELLED,
_("Operation was cancelled"));
g_set_error_literal (error,
G_IO_ERROR,
G_IO_ERROR_CANCELLED,
_("Operation was cancelled"));
return TRUE;
}
......
......@@ -305,8 +305,8 @@ read_data (GDataInputStream *stream,
return FALSE;
if (res == 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Unexpected early end-of-stream"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Unexpected early end-of-stream"));
return FALSE;
}
}
......
......@@ -584,8 +584,8 @@ expand_application_parameters (GDesktopAppInfo *info,
if (info->exec == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Desktop file didn't specify Exec field"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Desktop file didn't specify Exec field"));
return FALSE;
}
......@@ -878,8 +878,8 @@ g_desktop_app_info_launch_uris (GAppInfo *appinfo,
if (info->terminal && !prepend_terminal_to_vector (&argc, &argv))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Unable to find terminal required for application"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Unable to find terminal required for application"));
goto out;
}
......
......@@ -806,9 +806,9 @@ g_file_enumerate_children (GFile *file,
if (iface->enumerate_children == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return NULL;
}
......@@ -1034,9 +1034,9 @@ g_file_query_info (GFile *file,
if (iface->query_info == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return NULL;
}
......@@ -1167,9 +1167,9 @@ g_file_query_filesystem_info (GFile *file,
if (iface->query_filesystem_info == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return NULL;
}
......@@ -1285,7 +1285,7 @@ g_file_find_enclosing_mount (GFile *file,
if (iface->find_enclosing_mount == NULL)
{
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 trying to find the
* enclosing (user visible) mount of a file, but none exists. */
_("Containing mount does not exist"));
......@@ -1398,9 +1398,9 @@ g_file_read (GFile *file,
if (iface->read_fn == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return NULL;
}
......@@ -1451,9 +1451,9 @@ g_file_append_to (GFile *file,
if (iface->append_to == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return NULL;
}
......@@ -1507,9 +1507,9 @@ g_file_create (GFile *file,
if (iface->create == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return NULL;
}
......@@ -1589,9 +1589,9 @@ g_file_replace (GFile *file,
if (iface->replace == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return NULL;
}
......@@ -1929,8 +1929,8 @@ copy_symlink (GFile *destination,
if (file_type == G_FILE_TYPE_DIRECTORY)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_IS_DIRECTORY,
_("Can't copy over directory"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_IS_DIRECTORY,
_("Can't copy over directory"));
return FALSE;
}
}
......@@ -1989,16 +1989,16 @@ open_source_for_copy (GFile *source,
{
if (file_type == G_FILE_TYPE_DIRECTORY)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_MERGE,
_("Can't copy directory over directory"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_WOULD_MERGE,
_("Can't copy directory over directory"));
return NULL;
}
/* continue to would_recurse error */
}
else
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS,
_("Target file exists"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_EXISTS,
_("Target file exists"));
return NULL;
}
}
......@@ -2015,8 +2015,8 @@ open_source_for_copy (GFile *source,
g_error_free (my_error);
}
g_set_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_RECURSE,
_("Can't recursively copy directory"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_WOULD_RECURSE,
_("Can't recursively copy directory"));
return NULL;
}
......@@ -2646,9 +2646,9 @@ g_file_move (GFile *source,
if (flags & G_FILE_COPY_NO_FALLBACK_FOR_MOVE)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return FALSE;
}
......@@ -2697,9 +2697,9 @@ g_file_make_directory (GFile *file,
if (iface->make_directory == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return FALSE;
}
......@@ -2815,9 +2815,9 @@ g_file_make_symbolic_link (GFile *file,
if (*symlink_value == '\0')
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_INVALID_ARGUMENT,
_("Invalid symlink value given"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_INVALID_ARGUMENT,
_("Invalid symlink value given"));
return FALSE;
}
......@@ -2825,9 +2825,9 @@ g_file_make_symbolic_link (GFile *file,
if (iface->make_symbolic_link == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return FALSE;
}
......@@ -2865,9 +2865,9 @@ g_file_delete (GFile *file,
if (iface->delete_file == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return FALSE;
}
......@@ -2908,9 +2908,9 @@ g_file_trash (GFile *file,
if (iface->trash == NULL)
{
g_set_error (error,
G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Trash not supported"));
g_set_error_literal (error,
G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Trash not supported"));
return FALSE;
}
......@@ -3189,9 +3189,9 @@ g_file_set_attribute (GFile *file,
if (iface->set_attribute == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return FALSE;
}
......@@ -3837,9 +3837,9 @@ g_file_monitor_directory (GFile *file,
if (iface->monitor_dir == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Operation not supported"));
return NULL;
}
......@@ -4999,9 +4999,9 @@ g_file_query_default_handler (GFile *file,
if (appinfo != NULL)
return appinfo;
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("No application is registered as handling this file"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("No application is registered as handling this file"));
return NULL;
}
......
......@@ -198,15 +198,15 @@ g_file_enumerator_next_file (GFileEnumerator *enumerator,
if (enumerator->priv->closed)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED,
_("Enumerator is closed"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CLOSED,
_("Enumerator is closed"));
return NULL;
}
if (enumerator->priv->pending)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_PENDING,
_("File enumerator has outstanding operation"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING,
_("File enumerator has outstanding operation"));
return NULL;
}
......@@ -264,8 +264,8 @@ g_file_enumerator_close (GFileEnumerator *enumerator,
if (enumerator->priv->pending)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_PENDING,
_("File enumerator has outstanding operation"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING,
_("File enumerator has outstanding operation"));
return FALSE;
}
......
......@@ -150,8 +150,8 @@ g_file_input_stream_query_info (GFileInputStream *stream,
if (class->query_info)
info = class->query_info (stream, attributes, cancellable, error);
else
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Stream doesn't support query_info"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Stream doesn't support query_info"));
if (cancellable)
g_cancellable_pop_current (cancellable);
......@@ -332,8 +332,8 @@ g_file_input_stream_seek (GFileInputStream *stream,
if (!class->seek)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("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;
}
......@@ -376,8 +376,8 @@ g_file_input_stream_seekable_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;
}
......@@ -417,8 +417,8 @@ query_info_async_thread (GSimpleAsyncResult *res,
if (class->query_info)
info = class->query_info (G_FILE_INPUT_STREAM (object), data->attributes, cancellable, &error);
else
g_set_error (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Stream doesn't support query_info"));
g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Stream doesn't support query_info"));
if (info == NULL)
{
......
......@@ -164,8 +164,8 @@ g_file_output_stream_query_info (GFileOutputStream *stream,
if (class->query_info)
info = class->query_info (stream, attributes, cancellable, error);
else
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Stream doesn't support query_info"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Stream doesn't support query_info"));
if (cancellable)
g_cancellable_pop_current (cancellable);
......@@ -377,8 +377,8 @@ g_file_output_stream_seek (GFileOutputStream *stream,
if (!class->seek)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("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;
}
......@@ -453,8 +453,8 @@ g_file_output_stream_truncate (GFileOutputStream *stream,
if (!class->truncate_fn)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Truncate not supported on stream"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Truncate not supported on stream"));
return FALSE;
}
......@@ -519,8 +519,8 @@ query_info_async_thread (GSimpleAsyncResult *res,
if (class->query_info)
info = class->query_info (G_FILE_OUTPUT_STREAM (object), data->attributes, cancellable, &error);
else
g_set_error (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Stream doesn't support query_info"));
g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Stream doesn't support query_info"));
if (info == NULL)
{
......
......@@ -189,8 +189,8 @@ g_input_stream_read (GInputStream *stream,
if (class->read_fn == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Input stream doesn't implement read"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Input stream doesn't implement read"));
return -1;
}
......@@ -888,14 +888,14 @@ g_input_stream_set_pending (GInputStream *stream, GError **error)
if (stream->priv->closed)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED,
_("Stream is already closed"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CLOSED,
_("Stream is already closed"));
return FALSE;
}
if (stream->priv->pending)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_PENDING,
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING,
/* Translators: This is an error you get if there is already an
* operation running against this stream when you try to start
* one */
......
......@@ -266,7 +266,8 @@ _g_local_directory_monitor_new (const char *dirname,
if (type != G_TYPE_INVALID)
monitor = G_FILE_MONITOR (g_object_new (type, "dirname", dirname, NULL));
else
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Unable to find default local directory monitor type"));
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Unable to find default local directory monitor type"));
/* This is non-null on first pass here. Unref the class now.
* This is to avoid unloading the module and then loading it
......
......@@ -1054,7 +1054,7 @@ g_local_file_find_enclosing_mount (GFile *file,
if (g_lstat (local->filename, &buf) != 0)
{
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 trying to
* find the enclosing (user visible) mount of a file, but
* none exists. */
......@@ -1065,7 +1065,7 @@ g_local_file_find_enclosing_mount (GFile *file,
mountpoint = find_mountpoint_for (local->filename, buf.st_dev);
if (mountpoint == NULL)
{
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 trying to
* find the enclosing (user visible) mount of a file, but
* none exists. */
......@@ -1078,7 +1078,7 @@ g_local_file_find_enclosing_mount (GFile *file,
if (mount)
return 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 trying to find
* the enclosing (user visible) mount of a file, but none
* exists. */
......@@ -1100,9 +1100,9 @@ g_local_file_set_display_name (GFile *file,
parent = g_file_get_parent (file);
if (parent == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_FAILED,
_("Can't rename root directory"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_FAILED,
_("Can't rename root directory"));
return NULL;
}
......@@ -1118,9 +1118,9 @@ g_local_file_set_display_name (GFile *file,
if (!(g_lstat (new_local->filename, &statbuf) == -1 &&
errno == ENOENT))
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_EXISTS,
_("Can't rename file, filename already exist"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_EXISTS,
_("Can't rename file, filename already exist"));
return NULL;
}
......@@ -1131,9 +1131,9 @@ g_local_file_set_display_name (GFile *file,
if (errsv == EINVAL)
/* We can't get a rename file into itself error herer,
so this must be an invalid filename, on e.g. FAT */
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_INVALID_FILENAME,
_("Invalid filename"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_INVALID_FILENAME,
_("Invalid filename"));
else
g_set_error (error, G_IO_ERROR,
g_io_error_from_errno (errsv),
......@@ -1264,9 +1264,9 @@ g_local_file_read (GFile *file,
if (fstat(fd, &buf) == 0 && S_ISDIR (buf.st_mode))
{
close (fd);
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_IS_DIRECTORY,
_("Can't open directory"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_IS_DIRECTORY,
_("Can't open directory"));
return NULL;
}
......@@ -1732,9 +1732,9 @@ g_local_file_trash (GFile *file,
topdir = find_topdir_for (local->filename);
if (topdir == NULL)
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Unable to find toplevel directory for trash"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Unable to find toplevel directory for trash"));
return FALSE;
}
......@@ -1811,9 +1811,9 @@ g_local_file_trash (GFile *file,
if (trashdir == NULL)
{
g_free (topdir);
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Unable to find or create trash directory"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Unable to find or create trash directory"));
return FALSE;
}
}
......@@ -1831,9 +1831,9 @@ g_local_file_trash (GFile *file,
g_free (topdir);
g_free (infodir);
g_free (filesdir);
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Unable to find or create trash directory"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Unable to find or create trash directory"));
return FALSE;
}
......@@ -1995,9 +1995,9 @@ g_local_file_make_directory (GFile *file,
if (errsv == EINVAL)
/* This must be an invalid filename, on e.g. FAT */
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_INVALID_FILENAME,
_("Invalid filename"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_INVALID_FILENAME,
_("Invalid filename"));
else
g_set_error (error, G_IO_ERROR,
g_io_error_from_errno (errsv),
......@@ -2024,9 +2024,9 @@ g_local_file_make_symbolic_link (GFile *file,
if (errsv == EINVAL)
/* This must be an invalid filename, on e.g. FAT */
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_INVALID_FILENAME,
_("Invalid filename"));
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_INVALID_FILENAME,
_("Invalid filename"));
else
g_set_error (error, G_IO_ERROR,
g_io_error_from_errno (errsv),
......@@ -2036,7 +2036,7 @@ g_local_file_make_symbolic_link (GFile *file,
}
return TRUE;
#else
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Symlinks not supported");
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Symlinks not supported");
return FALSE;
#endif
}
......@@ -2052,7 +2052,7 @@ g_local_file_copy (GFile *source,
GError **error)
{
/* Fall back to default copy */
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Copy not supported");
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Copy not supported");
return FALSE;
}
......@@ -2076,7 +2076,7 @@ g_local_file_move (GFile *source,
!G_IS_LOCAL_FILE (destination))
{
/* Fall back to default move */
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Move not supported");
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Move not supported");
return FALSE;
}
......@@ -2110,24 +2110,24 @@ g_local_file_move (GFile *source,
if (S_ISDIR (statbuf.st_mode))
{
if (source_is_dir)
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_WOULD_MERGE,
_("Can't move directory over directory"));
g_set_error_literal (error,
G_IO_ERROR,
G_IO_ERROR_WOULD_MERGE,
_("Can't move directory over directory"));
else
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_IS_DIRECTORY,
_("Can't copy over directory"));
g_set_error_literal (error,
G_IO_ERROR,
G_IO_ERROR_IS_DIRECTORY,
_("Can't copy over directory"));
return FALSE;
}
}
else
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_EXISTS,
_("Target file exists"));
g_set_error_literal (error,