summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-clipboard-monitor.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-05-02 01:09:20 +0200
committerraveit65 <[email protected]>2019-05-06 13:53:37 +0200
commita110c542bd7a16625f03c97e2fefa3be8da50c85 (patch)
tree7af078f9084b33eb0d5df7f3657a1f8049ff6b83 /libcaja-private/caja-clipboard-monitor.c
parent476f56a25be636970b336d525a7766b6d1eb3fff (diff)
downloadcaja-a110c542bd7a16625f03c97e2fefa3be8da50c85.tar.bz2
caja-a110c542bd7a16625f03c97e2fefa3be8da50c85.tar.xz
libcaja-private: reduce the scope of some variables
Diffstat (limited to 'libcaja-private/caja-clipboard-monitor.c')
-rw-r--r--libcaja-private/caja-clipboard-monitor.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libcaja-private/caja-clipboard-monitor.c b/libcaja-private/caja-clipboard-monitor.c
index ce8069f7..73c1fd08 100644
--- a/libcaja-private/caja-clipboard-monitor.c
+++ b/libcaja-private/caja-clipboard-monitor.c
@@ -78,10 +78,10 @@ destroy_clipboard_monitor (void)
CajaClipboardMonitor *
caja_clipboard_monitor_get (void)
{
- GtkClipboard *clipboard;
-
if (clipboard_monitor == NULL)
{
+ GtkClipboard *clipboard;
+
clipboard_monitor = CAJA_CLIPBOARD_MONITOR (g_object_new (CAJA_TYPE_CLIPBOARD_MONITOR, NULL));
eel_debug_call_at_shutdown (destroy_clipboard_monitor);
@@ -227,7 +227,7 @@ convert_file_list_to_string (CajaClipboardInfo *info,
gsize *len)
{
GString *uris;
- char *uri, *tmp;
+ char *tmp;
GFile *f;
guint i;
GList *l;
@@ -243,6 +243,8 @@ convert_file_list_to_string (CajaClipboardInfo *info,
for (i = 0, l = info->files; l != NULL; l = l->next, i++)
{
+ char *uri;
+
uri = caja_file_get_uri (l->data);
if (format_for_text)
@@ -286,9 +288,7 @@ caja_get_clipboard_callback (GtkClipboard *clipboard,
guint info,
gpointer user_data)
{
- char **uris;
GList *l;
- int i;
CajaClipboardInfo *clipboard_info;
GdkAtom target;
@@ -299,6 +299,9 @@ caja_get_clipboard_callback (GtkClipboard *clipboard,
if (gtk_targets_include_uri (&target, 1))
{
+ char **uris;
+ int i;
+
uris = g_malloc ((g_list_length (clipboard_info->files) + 1) * sizeof (char *));
i = 0;