Skip to content

Commit

Permalink
Clean up and simplify.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Monin committed Apr 16, 2008
1 parent 2bf00ad commit 5a2f5a7
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions src/view_dir_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#define VDLIST_INFO(_vd_, _part_) (((ViewDirInfoList *)(_vd_->info))->_part_)


static void vdlist_popup_destroy_cb(GtkWidget *widget, gpointer data);
static gint vdlist_auto_scroll_notify_cb(GtkWidget *widget, gint x, gint y, gpointer data);

/*
Expand Down Expand Up @@ -172,16 +171,15 @@ static void vdlist_pop_menu_slide_cb(GtkWidget *widget, gpointer data)
ViewDir *vd = data;
gchar *path;

if (!vd->layout || !vd->click_fd) return;
if (!vd->layout) return;
if (!vd->click_fd) return;

path = g_strdup(vd->click_fd->path);
path = vd->click_fd->path;

layout_set_path(vd->layout, path);
layout_select_none(vd->layout);
layout_image_slideshow_stop(vd->layout);
layout_image_slideshow_start(vd->layout);

g_free(path);
}

static void vdlist_pop_menu_slide_rec_cb(GtkWidget *widget, gpointer data)
Expand All @@ -190,16 +188,15 @@ static void vdlist_pop_menu_slide_rec_cb(GtkWidget *widget, gpointer data)
gchar *path;
GList *list;

if (!vd->layout || !vd->click_fd) return;
if (!vd->layout) return;
if (!vd->click_fd) return;

path = g_strdup(vd->click_fd->path);
path = vd->click_fd->path;

list = filelist_recursive(path);

layout_image_slideshow_stop(vd->layout);
layout_image_slideshow_start_from_list(vd->layout, list);

g_free(path);
}

static void vdlist_pop_menu_dupe(ViewDir *vd, gint recursive)
Expand Down Expand Up @@ -317,7 +314,7 @@ static GtkWidget *vdlist_pop_menu(ViewDir *vd, FileData *fd)

menu = popup_menu_short_lived();
g_signal_connect(G_OBJECT(menu), "destroy",
G_CALLBACK(vdlist_popup_destroy_cb), vd);
G_CALLBACK(vd_popup_destroy_cb), vd);

menu_item_add_stock_sensitive(menu, _("_Up to parent"), GTK_STOCK_GO_UP,
(vd->path && strcmp(vd->path, "/") != 0),
Expand Down Expand Up @@ -364,19 +361,6 @@ static GtkWidget *vdlist_pop_menu(ViewDir *vd, FileData *fd)
return menu;
}

static void vdlist_popup_destroy_cb(GtkWidget *widget, gpointer data)
{
ViewDir *vd = data;

vd_color_set(vd, vd->click_fd, FALSE);
vd->click_fd = NULL;
vd->popup = NULL;

vd_color_set(vd, vd->drop_fd, FALSE);
filelist_free(vd->drop_list);
vd->drop_list = NULL;
vd->drop_fd = NULL;
}

/*
*-----------------------------------------------------------------------------
Expand Down

0 comments on commit 5a2f5a7

Please sign in to comment.