mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 20:35:49 +01:00
Merge branch 'cleanup-warnings-split-7' into 'main'
Cleanup warnings split 7 See merge request GNOME/glib!2496
This commit is contained in:
commit
7d4bc30e7d
@ -683,7 +683,7 @@ g_string_append_encoded (GString *string,
|
|||||||
const char *reserved_chars_allowed)
|
const char *reserved_chars_allowed)
|
||||||
{
|
{
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
static const gchar hex[16] = "0123456789ABCDEF";
|
static const gchar hex[] = "0123456789ABCDEF";
|
||||||
|
|
||||||
while ((c = *encoded) != 0)
|
while ((c = *encoded) != 0)
|
||||||
{
|
{
|
||||||
|
@ -7742,7 +7742,7 @@ g_file_replace_contents (GFile *file,
|
|||||||
{
|
{
|
||||||
GFileOutputStream *out;
|
GFileOutputStream *out;
|
||||||
gsize pos, remainder;
|
gsize pos, remainder;
|
||||||
gssize res;
|
gssize res = -1;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_FILE (file), FALSE);
|
g_return_val_if_fail (G_IS_FILE (file), FALSE);
|
||||||
|
@ -99,7 +99,7 @@ G_LOCK_DEFINE_STATIC (attribute_hash);
|
|||||||
static int namespace_id_counter = 0;
|
static int namespace_id_counter = 0;
|
||||||
static GHashTable *ns_hash = NULL;
|
static GHashTable *ns_hash = NULL;
|
||||||
static GHashTable *attribute_hash = NULL;
|
static GHashTable *attribute_hash = NULL;
|
||||||
static char ***attributes = NULL;
|
static char ***global_attributes = NULL;
|
||||||
|
|
||||||
/* Attribute ids are 32bit, we split it up like this:
|
/* Attribute ids are 32bit, we split it up like this:
|
||||||
* |------------|--------------------|
|
* |------------|--------------------|
|
||||||
@ -134,9 +134,9 @@ _lookup_namespace (const char *namespace)
|
|||||||
ns_info = g_new0 (NSInfo, 1);
|
ns_info = g_new0 (NSInfo, 1);
|
||||||
ns_info->id = ++namespace_id_counter;
|
ns_info->id = ++namespace_id_counter;
|
||||||
g_hash_table_insert (ns_hash, g_strdup (namespace), ns_info);
|
g_hash_table_insert (ns_hash, g_strdup (namespace), ns_info);
|
||||||
attributes = g_realloc (attributes, (ns_info->id + 1) * sizeof (char **));
|
global_attributes = g_realloc (global_attributes, (ns_info->id + 1) * sizeof (char **));
|
||||||
attributes[ns_info->id] = g_new (char *, 1);
|
global_attributes[ns_info->id] = g_new (char *, 1);
|
||||||
attributes[ns_info->id][0] = g_strconcat (namespace, "::*", NULL);
|
global_attributes[ns_info->id][0] = g_strconcat (namespace, "::*", NULL);
|
||||||
}
|
}
|
||||||
return ns_info;
|
return ns_info;
|
||||||
}
|
}
|
||||||
@ -164,12 +164,12 @@ _lookup_attribute (const char *attribute)
|
|||||||
g_free (ns);
|
g_free (ns);
|
||||||
|
|
||||||
id = ++ns_info->attribute_id_counter;
|
id = ++ns_info->attribute_id_counter;
|
||||||
attributes[ns_info->id] = g_realloc (attributes[ns_info->id], (id + 1) * sizeof (char *));
|
global_attributes[ns_info->id] = g_realloc (global_attributes[ns_info->id], (id + 1) * sizeof (char *));
|
||||||
attributes[ns_info->id][id] = g_strdup (attribute);
|
global_attributes[ns_info->id][id] = g_strdup (attribute);
|
||||||
|
|
||||||
attr_id = MAKE_ATTR_ID (ns_info->id, id);
|
attr_id = MAKE_ATTR_ID (ns_info->id, id);
|
||||||
|
|
||||||
g_hash_table_insert (attribute_hash, attributes[ns_info->id][id], GUINT_TO_POINTER (attr_id));
|
g_hash_table_insert (attribute_hash, global_attributes[ns_info->id][id], GUINT_TO_POINTER (attr_id));
|
||||||
|
|
||||||
return attr_id;
|
return attr_id;
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ get_attribute_for_id (int attribute)
|
|||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
G_LOCK (attribute_hash);
|
G_LOCK (attribute_hash);
|
||||||
s = attributes[GET_NS(attribute)][GET_ID(attribute)];
|
s = global_attributes[GET_NS (attribute)][GET_ID (attribute)];
|
||||||
G_UNLOCK (attribute_hash);
|
G_UNLOCK (attribute_hash);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -30,13 +30,13 @@
|
|||||||
|
|
||||||
static gboolean writable = FALSE;
|
static gboolean writable = FALSE;
|
||||||
static gboolean filesystem = FALSE;
|
static gboolean filesystem = FALSE;
|
||||||
static char *attributes = NULL;
|
static char *global_attributes = NULL;
|
||||||
static gboolean nofollow_symlinks = FALSE;
|
static gboolean nofollow_symlinks = FALSE;
|
||||||
|
|
||||||
static const GOptionEntry entries[] = {
|
static const GOptionEntry entries[] = {
|
||||||
{ "query-writable", 'w', 0, G_OPTION_ARG_NONE, &writable, N_("List writable attributes"), NULL },
|
{ "query-writable", 'w', 0, G_OPTION_ARG_NONE, &writable, N_("List writable attributes"), NULL },
|
||||||
{ "filesystem", 'f', 0, G_OPTION_ARG_NONE, &filesystem, N_("Get file system info"), NULL },
|
{ "filesystem", 'f', 0, G_OPTION_ARG_NONE, &filesystem, N_("Get file system info"), NULL },
|
||||||
{ "attributes", 'a', 0, G_OPTION_ARG_STRING, &attributes, N_("The attributes to get"), N_("ATTRIBUTES") },
|
{ "attributes", 'a', 0, G_OPTION_ARG_STRING, &global_attributes, N_("The attributes to get"), N_("ATTRIBUTES") },
|
||||||
{ "nofollow-symlinks", 'n', 0, G_OPTION_ARG_NONE, &nofollow_symlinks, N_("Don’t follow symbolic links"), NULL },
|
{ "nofollow-symlinks", 'n', 0, G_OPTION_ARG_NONE, &nofollow_symlinks, N_("Don’t follow symbolic links"), NULL },
|
||||||
G_OPTION_ENTRY_NULL
|
G_OPTION_ENTRY_NULL
|
||||||
};
|
};
|
||||||
@ -230,8 +230,8 @@ query_info (GFile *file)
|
|||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (attributes == NULL)
|
if (global_attributes == NULL)
|
||||||
attributes = "*";
|
global_attributes = "*";
|
||||||
|
|
||||||
flags = 0;
|
flags = 0;
|
||||||
if (nofollow_symlinks)
|
if (nofollow_symlinks)
|
||||||
@ -239,9 +239,9 @@ query_info (GFile *file)
|
|||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
if (filesystem)
|
if (filesystem)
|
||||||
info = g_file_query_filesystem_info (file, attributes, NULL, &error);
|
info = g_file_query_filesystem_info (file, global_attributes, NULL, &error);
|
||||||
else
|
else
|
||||||
info = g_file_query_info (file, attributes, flags, NULL, &error);
|
info = g_file_query_info (file, global_attributes, flags, NULL, &error);
|
||||||
|
|
||||||
if (info == NULL)
|
if (info == NULL)
|
||||||
{
|
{
|
||||||
|
@ -24,8 +24,7 @@
|
|||||||
|
|
||||||
#include "gio-tool.h"
|
#include "gio-tool.h"
|
||||||
|
|
||||||
|
static char *global_attributes = NULL;
|
||||||
static char *attributes = NULL;
|
|
||||||
static gboolean show_hidden = FALSE;
|
static gboolean show_hidden = FALSE;
|
||||||
static gboolean show_long = FALSE;
|
static gboolean show_long = FALSE;
|
||||||
static gboolean nofollow_symlinks = FALSE;
|
static gboolean nofollow_symlinks = FALSE;
|
||||||
@ -33,7 +32,7 @@ static gboolean print_display_names = FALSE;
|
|||||||
static gboolean print_uris = FALSE;
|
static gboolean print_uris = FALSE;
|
||||||
|
|
||||||
static const GOptionEntry entries[] = {
|
static const GOptionEntry entries[] = {
|
||||||
{ "attributes", 'a', 0, G_OPTION_ARG_STRING, &attributes, N_("The attributes to get"), N_("ATTRIBUTES") },
|
{ "attributes", 'a', 0, G_OPTION_ARG_STRING, &global_attributes, N_("The attributes to get"), N_("ATTRIBUTES") },
|
||||||
{ "hidden", 'h', 0, G_OPTION_ARG_NONE, &show_hidden, N_("Show hidden files"), NULL },
|
{ "hidden", 'h', 0, G_OPTION_ARG_NONE, &show_hidden, N_("Show hidden files"), NULL },
|
||||||
{ "long", 'l', 0, G_OPTION_ARG_NONE, &show_long, N_("Use a long listing format"), NULL },
|
{ "long", 'l', 0, G_OPTION_ARG_NONE, &show_long, N_("Use a long listing format"), NULL },
|
||||||
{ "nofollow-symlinks", 'n', 0, G_OPTION_ARG_NONE, &nofollow_symlinks, N_("Don’t follow symbolic links"), NULL},
|
{ "nofollow-symlinks", 'n', 0, G_OPTION_ARG_NONE, &nofollow_symlinks, N_("Don’t follow symbolic links"), NULL},
|
||||||
@ -121,7 +120,7 @@ list (GFile *file)
|
|||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
enumerator = g_file_enumerate_children (file,
|
enumerator = g_file_enumerate_children (file,
|
||||||
attributes,
|
global_attributes,
|
||||||
nofollow_symlinks ? G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS : 0,
|
nofollow_symlinks ? G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS : 0,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
@ -199,17 +198,15 @@ handle_list (int argc, char *argv[], gboolean do_help)
|
|||||||
|
|
||||||
g_option_context_free (context);
|
g_option_context_free (context);
|
||||||
|
|
||||||
if (attributes != NULL)
|
if (global_attributes != NULL)
|
||||||
show_long = TRUE;
|
show_long = TRUE;
|
||||||
|
|
||||||
attributes = g_strconcat (!print_display_names ? G_FILE_ATTRIBUTE_STANDARD_NAME "," : "",
|
global_attributes = g_strconcat (!print_display_names ? G_FILE_ATTRIBUTE_STANDARD_NAME "," : "",
|
||||||
print_display_names ? G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," : "",
|
print_display_names ? G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," : "",
|
||||||
G_FILE_ATTRIBUTE_STANDARD_TYPE ","
|
G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_SIZE "," G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN,
|
||||||
G_FILE_ATTRIBUTE_STANDARD_SIZE ","
|
global_attributes != NULL ? "," : "",
|
||||||
G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN,
|
global_attributes,
|
||||||
attributes != NULL ? "," : "",
|
NULL);
|
||||||
attributes,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
@ -232,7 +229,7 @@ handle_list (int argc, char *argv[], gboolean do_help)
|
|||||||
g_free (cwd);
|
g_free (cwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (attributes);
|
g_free (global_attributes);
|
||||||
|
|
||||||
return res ? 0 : 2;
|
return res ? 0 : 2;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ typedef enum {
|
|||||||
|
|
||||||
static int outstanding_mounts = 0;
|
static int outstanding_mounts = 0;
|
||||||
static GMainLoop *main_loop;
|
static GMainLoop *main_loop;
|
||||||
static GVolumeMonitor *volume_monitor;
|
static GVolumeMonitor *global_volume_monitor;
|
||||||
|
|
||||||
static gboolean mount_mountable = FALSE;
|
static gboolean mount_mountable = FALSE;
|
||||||
static gboolean mount_unmount = FALSE;
|
static gboolean mount_unmount = FALSE;
|
||||||
@ -488,7 +488,7 @@ stop_with_device_file (const char *device_file)
|
|||||||
GList *drives;
|
GList *drives;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
drives = g_volume_monitor_get_connected_drives (volume_monitor);
|
drives = g_volume_monitor_get_connected_drives (global_volume_monitor);
|
||||||
for (l = drives; l != NULL; l = l->next)
|
for (l = drives; l != NULL; l = l->next)
|
||||||
{
|
{
|
||||||
GDrive *drive = G_DRIVE (l->data);
|
GDrive *drive = G_DRIVE (l->data);
|
||||||
@ -906,15 +906,15 @@ list_monitor_items (void)
|
|||||||
/* populate gvfs network mounts */
|
/* populate gvfs network mounts */
|
||||||
iterate_gmain();
|
iterate_gmain();
|
||||||
|
|
||||||
drives = g_volume_monitor_get_connected_drives (volume_monitor);
|
drives = g_volume_monitor_get_connected_drives (global_volume_monitor);
|
||||||
list_drives (drives, 0);
|
list_drives (drives, 0);
|
||||||
g_list_free_full (drives, g_object_unref);
|
g_list_free_full (drives, g_object_unref);
|
||||||
|
|
||||||
volumes = g_volume_monitor_get_volumes (volume_monitor);
|
volumes = g_volume_monitor_get_volumes (global_volume_monitor);
|
||||||
list_volumes (volumes, 0, TRUE);
|
list_volumes (volumes, 0, TRUE);
|
||||||
g_list_free_full (volumes, g_object_unref);
|
g_list_free_full (volumes, g_object_unref);
|
||||||
|
|
||||||
mounts = g_volume_monitor_get_mounts (volume_monitor);
|
mounts = g_volume_monitor_get_mounts (global_volume_monitor);
|
||||||
list_mounts (mounts, 0, TRUE);
|
list_mounts (mounts, 0, TRUE);
|
||||||
g_list_free_full (mounts, g_object_unref);
|
g_list_free_full (mounts, g_object_unref);
|
||||||
}
|
}
|
||||||
@ -928,7 +928,7 @@ unmount_all_with_scheme (const char *scheme)
|
|||||||
/* populate gvfs network mounts */
|
/* populate gvfs network mounts */
|
||||||
iterate_gmain();
|
iterate_gmain();
|
||||||
|
|
||||||
mounts = g_volume_monitor_get_mounts (volume_monitor);
|
mounts = g_volume_monitor_get_mounts (global_volume_monitor);
|
||||||
for (l = mounts; l != NULL; l = l->next) {
|
for (l = mounts; l != NULL; l = l->next) {
|
||||||
GMount *mount = G_MOUNT (l->data);
|
GMount *mount = G_MOUNT (l->data);
|
||||||
GFile *root;
|
GFile *root;
|
||||||
@ -977,7 +977,7 @@ mount_with_id (const char *id)
|
|||||||
GList *volumes;
|
GList *volumes;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
volumes = g_volume_monitor_get_volumes (volume_monitor);
|
volumes = g_volume_monitor_get_volumes (global_volume_monitor);
|
||||||
for (l = volumes; l != NULL; l = l->next)
|
for (l = volumes; l != NULL; l = l->next)
|
||||||
{
|
{
|
||||||
GVolume *volume = G_VOLUME (l->data);
|
GVolume *volume = G_VOLUME (l->data);
|
||||||
@ -1167,17 +1167,17 @@ monitor_drive_eject_button (GVolumeMonitor *volume_monitor, GDrive *drive)
|
|||||||
static void
|
static void
|
||||||
monitor (void)
|
monitor (void)
|
||||||
{
|
{
|
||||||
g_signal_connect (volume_monitor, "mount-added", (GCallback) monitor_mount_added, NULL);
|
g_signal_connect (global_volume_monitor, "mount-added", (GCallback) monitor_mount_added, NULL);
|
||||||
g_signal_connect (volume_monitor, "mount-removed", (GCallback) monitor_mount_removed, NULL);
|
g_signal_connect (global_volume_monitor, "mount-removed", (GCallback) monitor_mount_removed, NULL);
|
||||||
g_signal_connect (volume_monitor, "mount-changed", (GCallback) monitor_mount_changed, NULL);
|
g_signal_connect (global_volume_monitor, "mount-changed", (GCallback) monitor_mount_changed, NULL);
|
||||||
g_signal_connect (volume_monitor, "mount-pre-unmount", (GCallback) monitor_mount_pre_unmount, NULL);
|
g_signal_connect (global_volume_monitor, "mount-pre-unmount", (GCallback) monitor_mount_pre_unmount, NULL);
|
||||||
g_signal_connect (volume_monitor, "volume-added", (GCallback) monitor_volume_added, NULL);
|
g_signal_connect (global_volume_monitor, "volume-added", (GCallback) monitor_volume_added, NULL);
|
||||||
g_signal_connect (volume_monitor, "volume-removed", (GCallback) monitor_volume_removed, NULL);
|
g_signal_connect (global_volume_monitor, "volume-removed", (GCallback) monitor_volume_removed, NULL);
|
||||||
g_signal_connect (volume_monitor, "volume-changed", (GCallback) monitor_volume_changed, NULL);
|
g_signal_connect (global_volume_monitor, "volume-changed", (GCallback) monitor_volume_changed, NULL);
|
||||||
g_signal_connect (volume_monitor, "drive-connected", (GCallback) monitor_drive_connected, NULL);
|
g_signal_connect (global_volume_monitor, "drive-connected", (GCallback) monitor_drive_connected, NULL);
|
||||||
g_signal_connect (volume_monitor, "drive-disconnected", (GCallback) monitor_drive_disconnected, NULL);
|
g_signal_connect (global_volume_monitor, "drive-disconnected", (GCallback) monitor_drive_disconnected, NULL);
|
||||||
g_signal_connect (volume_monitor, "drive-changed", (GCallback) monitor_drive_changed, NULL);
|
g_signal_connect (global_volume_monitor, "drive-changed", (GCallback) monitor_drive_changed, NULL);
|
||||||
g_signal_connect (volume_monitor, "drive-eject-button", (GCallback) monitor_drive_eject_button, NULL);
|
g_signal_connect (global_volume_monitor, "drive-eject-button", (GCallback) monitor_drive_eject_button, NULL);
|
||||||
|
|
||||||
g_print ("Monitoring events. Press Ctrl+C to quit.\n");
|
g_print ("Monitoring events. Press Ctrl+C to quit.\n");
|
||||||
|
|
||||||
@ -1219,7 +1219,7 @@ handle_mount (int argc, char *argv[], gboolean do_help)
|
|||||||
}
|
}
|
||||||
|
|
||||||
main_loop = g_main_loop_new (NULL, FALSE);
|
main_loop = g_main_loop_new (NULL, FALSE);
|
||||||
volume_monitor = g_volume_monitor_get ();
|
global_volume_monitor = g_volume_monitor_get ();
|
||||||
|
|
||||||
if (mount_list)
|
if (mount_list)
|
||||||
list_monitor_items ();
|
list_monitor_items ();
|
||||||
@ -1249,7 +1249,7 @@ handle_mount (int argc, char *argv[], gboolean do_help)
|
|||||||
{
|
{
|
||||||
show_help (context, _("No locations given"));
|
show_help (context, _("No locations given"));
|
||||||
g_option_context_free (context);
|
g_option_context_free (context);
|
||||||
g_object_unref (volume_monitor);
|
g_object_unref (global_volume_monitor);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1258,7 +1258,7 @@ handle_mount (int argc, char *argv[], gboolean do_help)
|
|||||||
if (outstanding_mounts > 0)
|
if (outstanding_mounts > 0)
|
||||||
g_main_loop_run (main_loop);
|
g_main_loop_run (main_loop);
|
||||||
|
|
||||||
g_object_unref (volume_monitor);
|
g_object_unref (global_volume_monitor);
|
||||||
|
|
||||||
return success ? 0 : 2;
|
return success ? 0 : 2;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include "gio-tool.h"
|
#include "gio-tool.h"
|
||||||
|
|
||||||
static char *etag = NULL;
|
static char *global_etag = NULL;
|
||||||
static gboolean backup = FALSE;
|
static gboolean backup = FALSE;
|
||||||
static gboolean create = FALSE;
|
static gboolean create = FALSE;
|
||||||
static gboolean append = FALSE;
|
static gboolean append = FALSE;
|
||||||
@ -54,7 +54,7 @@ static const GOptionEntry entries[] =
|
|||||||
/* Translators: The "etag" is a token allowing to verify whether a file has been modified */
|
/* Translators: The "etag" is a token allowing to verify whether a file has been modified */
|
||||||
{ "print-etag", 'v', 0, G_OPTION_ARG_NONE, &print_etag, N_("Print new etag at end"), NULL },
|
{ "print-etag", 'v', 0, G_OPTION_ARG_NONE, &print_etag, N_("Print new etag at end"), NULL },
|
||||||
/* Translators: The "etag" is a token allowing to verify whether a file has been modified */
|
/* Translators: The "etag" is a token allowing to verify whether a file has been modified */
|
||||||
{ "etag", 'e', 0, G_OPTION_ARG_STRING, &etag, N_("The etag of the file being overwritten"), N_("ETAG") },
|
{ "etag", 'e', 0, G_OPTION_ARG_STRING, &global_etag, N_("The etag of the file being overwritten"), N_("ETAG") },
|
||||||
G_OPTION_ENTRY_NULL
|
G_OPTION_ENTRY_NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ save (GFile *file)
|
|||||||
else if (append)
|
else if (append)
|
||||||
out = (GOutputStream *)g_file_append_to (file, flags, NULL, &error);
|
out = (GOutputStream *)g_file_append_to (file, flags, NULL, &error);
|
||||||
else
|
else
|
||||||
out = (GOutputStream *)g_file_replace (file, etag, backup, flags, NULL, &error);
|
out = (GOutputStream *)g_file_replace (file, global_etag, backup, flags, NULL, &error);
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
{
|
{
|
||||||
print_file_error (file, error->message);
|
print_file_error (file, error->message);
|
||||||
|
@ -25,12 +25,12 @@
|
|||||||
#include "gio-tool.h"
|
#include "gio-tool.h"
|
||||||
|
|
||||||
|
|
||||||
static gboolean force = FALSE;
|
static gboolean global_force = FALSE;
|
||||||
static gboolean empty = FALSE;
|
static gboolean empty = FALSE;
|
||||||
static gboolean restore = FALSE;
|
static gboolean restore = FALSE;
|
||||||
static gboolean list = FALSE;
|
static gboolean list = FALSE;
|
||||||
static const GOptionEntry entries[] = {
|
static const GOptionEntry entries[] = {
|
||||||
{ "force", 'f', 0, G_OPTION_ARG_NONE, &force, N_("Ignore nonexistent files, never prompt"), NULL },
|
{ "force", 'f', 0, G_OPTION_ARG_NONE, &global_force, N_("Ignore nonexistent files, never prompt"), NULL },
|
||||||
{ "empty", 0, 0, G_OPTION_ARG_NONE, &empty, N_("Empty the trash"), NULL },
|
{ "empty", 0, 0, G_OPTION_ARG_NONE, &empty, N_("Empty the trash"), NULL },
|
||||||
{ "list", 0, 0, G_OPTION_ARG_NONE, &list, N_("List files in the trash with their original locations"), NULL },
|
{ "list", 0, 0, G_OPTION_ARG_NONE, &list, N_("List files in the trash with their original locations"), NULL },
|
||||||
{ "restore", 0, 0, G_OPTION_ARG_NONE, &restore, N_("Restore a file from trash to its original location (possibly "
|
{ "restore", 0, 0, G_OPTION_ARG_NONE, &restore, N_("Restore a file from trash to its original location (possibly "
|
||||||
@ -258,7 +258,7 @@ handle_trash (int argc, char *argv[], gboolean do_help)
|
|||||||
print_file_error (file, _("Location given doesn't start with trash:///"));
|
print_file_error (file, _("Location given doesn't start with trash:///"));
|
||||||
retval = 1;
|
retval = 1;
|
||||||
}
|
}
|
||||||
else if (!restore_trash (file, force, NULL, &error))
|
else if (!restore_trash (file, global_force, NULL, &error))
|
||||||
{
|
{
|
||||||
print_file_error (file, error->message);
|
print_file_error (file, error->message);
|
||||||
retval = 1;
|
retval = 1;
|
||||||
@ -266,7 +266,7 @@ handle_trash (int argc, char *argv[], gboolean do_help)
|
|||||||
}
|
}
|
||||||
else if (!g_file_trash (file, NULL, &error))
|
else if (!g_file_trash (file, NULL, &error))
|
||||||
{
|
{
|
||||||
if (!force ||
|
if (!global_force ||
|
||||||
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||||
{
|
{
|
||||||
print_file_error (file, error->message);
|
print_file_error (file, error->message);
|
||||||
@ -279,7 +279,6 @@ handle_trash (int argc, char *argv[], gboolean do_help)
|
|||||||
}
|
}
|
||||||
else if (list)
|
else if (list)
|
||||||
{
|
{
|
||||||
GFile *file;
|
|
||||||
file = g_file_new_for_uri ("trash:");
|
file = g_file_new_for_uri ("trash:");
|
||||||
trash_list (file, NULL, &error);
|
trash_list (file, NULL, &error);
|
||||||
if (error)
|
if (error)
|
||||||
@ -292,7 +291,6 @@ handle_trash (int argc, char *argv[], gboolean do_help)
|
|||||||
}
|
}
|
||||||
else if (empty)
|
else if (empty)
|
||||||
{
|
{
|
||||||
GFile *file;
|
|
||||||
file = g_file_new_for_uri ("trash:");
|
file = g_file_new_for_uri ("trash:");
|
||||||
delete_trash_file (file, FALSE, TRUE);
|
delete_trash_file (file, FALSE, TRUE);
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
|
@ -517,7 +517,7 @@ g_io_modules_scan_all_in_directory_with_scope (const char *dirname,
|
|||||||
char *line = lines[i];
|
char *line = lines[i];
|
||||||
char *file;
|
char *file;
|
||||||
char *colon;
|
char *colon;
|
||||||
char **extension_points;
|
char **strv_extension_points;
|
||||||
|
|
||||||
if (line[0] == '#')
|
if (line[0] == '#')
|
||||||
continue;
|
continue;
|
||||||
@ -537,8 +537,8 @@ g_io_modules_scan_all_in_directory_with_scope (const char *dirname,
|
|||||||
cache = g_hash_table_new_full (g_str_hash, g_str_equal,
|
cache = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||||
g_free, (GDestroyNotify)g_strfreev);
|
g_free, (GDestroyNotify)g_strfreev);
|
||||||
|
|
||||||
extension_points = g_strsplit (colon, ",", -1);
|
strv_extension_points = g_strsplit (colon, ",", -1);
|
||||||
g_hash_table_insert (cache, file, extension_points);
|
g_hash_table_insert (cache, file, strv_extension_points);
|
||||||
}
|
}
|
||||||
g_strfreev (lines);
|
g_strfreev (lines);
|
||||||
}
|
}
|
||||||
@ -550,24 +550,24 @@ g_io_modules_scan_all_in_directory_with_scope (const char *dirname,
|
|||||||
GIOExtensionPoint *extension_point;
|
GIOExtensionPoint *extension_point;
|
||||||
GIOModule *module;
|
GIOModule *module;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
char **extension_points = NULL;
|
char **strv_extension_points = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
path = g_build_filename (dirname, name, NULL);
|
path = g_build_filename (dirname, name, NULL);
|
||||||
module = g_io_module_new (path);
|
module = g_io_module_new (path);
|
||||||
|
|
||||||
if (cache)
|
if (cache)
|
||||||
extension_points = g_hash_table_lookup (cache, name);
|
strv_extension_points = g_hash_table_lookup (cache, name);
|
||||||
|
|
||||||
if (extension_points != NULL &&
|
if (strv_extension_points != NULL &&
|
||||||
g_stat (path, &statbuf) == 0 &&
|
g_stat (path, &statbuf) == 0 &&
|
||||||
statbuf.st_ctime <= cache_time)
|
statbuf.st_ctime <= cache_time)
|
||||||
{
|
{
|
||||||
/* Lazy load/init the library when first required */
|
/* Lazy load/init the library when first required */
|
||||||
for (i = 0; extension_points[i] != NULL; i++)
|
for (i = 0; strv_extension_points[i] != NULL; i++)
|
||||||
{
|
{
|
||||||
extension_point =
|
extension_point =
|
||||||
g_io_extension_point_register (extension_points[i]);
|
g_io_extension_point_register (strv_extension_points[i]);
|
||||||
extension_point->lazy_load_modules =
|
extension_point->lazy_load_modules =
|
||||||
g_list_prepend (extension_point->lazy_load_modules,
|
g_list_prepend (extension_point->lazy_load_modules,
|
||||||
module);
|
module);
|
||||||
|
@ -353,7 +353,6 @@ _g_win32_extract_executable (const gunichar2 *commandline,
|
|||||||
gchar *dllpart_utf8;
|
gchar *dllpart_utf8;
|
||||||
gchar *dllpart_utf8_folded;
|
gchar *dllpart_utf8_folded;
|
||||||
gchar *function_utf8;
|
gchar *function_utf8;
|
||||||
gboolean folded;
|
|
||||||
const gunichar2 *space = g_utf16_wchr (function_begin, L' ');
|
const gunichar2 *space = g_utf16_wchr (function_begin, L' ');
|
||||||
|
|
||||||
if (space)
|
if (space)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user