static void
error_dialog (GtkFileChooserWidget *impl,
const char *msg,
- GFile *file,
GError *error)
{
if (error)
{
- char *uri = NULL;
- char *text;
-
- if (file)
- uri = g_file_get_uri (file);
- text = g_strdup_printf (msg, uri);
- error_message (impl, text, error->message);
- g_free (text);
- g_free (uri);
+ error_message (impl, msg, error->message);
g_error_free (error);
}
}
{
error_dialog (impl,
_("The folder could not be created"),
- file, error);
+ error);
}
/* Shows an error about not being able to create a folder because a file with
_("The folder could not be created, as a file with the same "
"name already exists. Try using a different name for the "
"folder, or rename the file first."),
- file, error);
+ error);
}
static void
GFile *parent_file)
{
GError *error;
+ char *uri, *msg;
error = NULL;
g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY,
_("You need to choose a valid filename."));
- error_dialog (impl,
- _("Cannot create a file under %s as it is not a folder"),
- parent_file, error);
+ uri = g_file_get_uri (parent_file);
+ msg = g_strdup_printf (_("Cannot create a file under %s as it is not a folder"), uri);
+ g_free (uri);
+ error_dialog (impl, msg, error);
+ g_free (msg);
}
static void
error_building_filename_dialog (GtkFileChooserWidget *impl,
GError *error)
{
- error_dialog (impl, _("Invalid file name"),
- NULL, error);
+ error_dialog (impl, _("Invalid file name"), error);
}
/* Shows an error dialog when we cannot switch to a folder */
GFile *file,
GError *error)
{
- error_dialog (impl, _("The folder contents could not be displayed"),
- file, error);
+ error_dialog (impl, _("The folder contents could not be displayed"), error);
}
static void
GFile *file,
GError *error)
{
- error_dialog (impl, _("The file could not be deleted"), file, error);
+ error_dialog (impl, _("The file could not be deleted"), error);
}
static void
GFile *file,
GError *error)
{
- error_dialog (impl, _("The file could not be moved to the Trash"), file, error);
+ error_dialog (impl, _("The file could not be moved to the Trash"), error);
}
/* Changes folders, displaying an error dialog if this fails */
{
if (!g_file_move (priv->rename_file_source_file, child, G_FILE_COPY_NONE,
NULL, NULL, NULL, &error))
- error_dialog (impl, _("The file could not be renamed"), child, error);
+ error_dialog (impl, _("The file could not be renamed"), error);
g_object_unref (child);
}
{
error_dialog (impl,
_("Could not select file"),
- file, error);
+ error);
}
static void