summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-dnd.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-dnd.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-dnd.c')
-rw-r--r--libcaja-private/caja-dnd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libcaja-private/caja-dnd.c b/libcaja-private/caja-dnd.c
index 83ae648e..dfea8023 100644
--- a/libcaja-private/caja-dnd.c
+++ b/libcaja-private/caja-dnd.c
@@ -125,9 +125,9 @@ caja_drag_destroy_selection_list (GList *list)
GList *
caja_drag_uri_list_from_selection_list (const GList *selection_list)
{
- CajaDragSelectionItem *selection_item;
GList *uri_list;
const GList *l;
+ CajaDragSelectionItem *selection_item = NULL;
uri_list = NULL;
for (l = selection_list; l != NULL; l = l->next)
@@ -369,13 +369,14 @@ static gboolean
check_same_fs (CajaFile *file1,
CajaFile *file2)
{
- char *id1, *id2;
gboolean result;
result = FALSE;
if (file1 != NULL && file2 != NULL)
{
+ char *id1, *id2;
+
id1 = caja_file_get_filesystem_id (file1);
id2 = caja_file_get_filesystem_id (file2);
@@ -637,7 +638,6 @@ static void
add_one_compatible_uri (const char *uri, int x, int y, int w, int h, gpointer data)
{
GString *result;
- char *local_path;
result = (GString *) data;
@@ -654,6 +654,8 @@ add_one_compatible_uri (const char *uri, int x, int y, int w, int h, gpointer da
}
else
{
+ char *local_path;
+
local_path = g_filename_from_uri (uri, NULL, NULL);
/* Check for characters that confuse the old
@@ -1039,10 +1041,11 @@ gboolean
caja_drag_selection_includes_special_link (GList *selection_list)
{
GList *node;
- char *uri;
for (node = selection_list; node != NULL; node = node->next)
{
+ char *uri;
+
uri = ((CajaDragSelectionItem *) node->data)->uri;
if (eel_uri_is_desktop (uri))
@@ -1226,7 +1229,6 @@ slot_proxy_handle_drop (GtkWidget *widget,
CajaWindowSlotInfo *target_slot;
CajaView *target_view;
char *target_uri;
- GList *uri_list;
if (!drag_info->have_data ||
!drag_info->have_valid_data)
@@ -1268,6 +1270,8 @@ slot_proxy_handle_drop (GtkWidget *widget,
{
if (drag_info->info == CAJA_ICON_DND_MATE_ICON_LIST)
{
+ GList *uri_list;
+
uri_list = caja_drag_uri_list_from_selection_list (drag_info->data.selection_list);
g_assert (uri_list != NULL);