Revision: 1468
http://geeqie.svn.sourceforge.net/geeqie/?rev=1468&view=rev
Author: zas_
Date: 2009-03-02 21:06:32 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
Random tidy up.
Modified Paths:
--------------
trunk/src/layout.c
Modified: trunk/src/layout.c
===================================================================
--- trunk/src/layout.c 2009-03-02 21:05:57 UTC (rev 1467)
+++ trunk/src/layout.c 2009-03-02 21:06:32 UTC (rev 1468)
@@ -104,9 +104,9 @@
{
LayoutWindow *lw = work->data;
work = work->next;
+
if (lw->image->image_fd == imd->image_fd)
return lw;
-
}
return NULL;
@@ -126,14 +126,11 @@
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) < 0) return;
buf = g_strdup(gtk_entry_get_text(GTK_ENTRY(lw->path_entry)));
- if (!buf || (lw->dir_fd && strcmp(buf, lw->dir_fd->path) == 0))
+ if (!lw->dir_fd || strcmp(buf, lw->dir_fd->path) != 0)
{
- g_free(buf);
- return;
+ layout_set_path(lw, buf);
}
- layout_set_path(lw, buf);
-
g_free(buf);
}
@@ -141,12 +138,10 @@
{
LayoutWindow *lw = data;
gchar *buf;
- gchar *base;
buf = g_strdup(path);
parse_out_relatives(buf);
- base = remove_level_from_path(buf);
-
+
if (isdir(buf))
{
if ((!lw->dir_fd || strcmp(lw->dir_fd->path, buf) != 0) &&
layout_set_path(lw, buf))
@@ -158,12 +153,17 @@
strlen(gtk_entry_get_text(GTK_ENTRY(lw->path_entry))));
}
}
- else if (lw->dir_fd && strcmp(lw->dir_fd->path, base) == 0)
+ else if (lw->dir_fd)
{
- layout_list_scroll_to_subpart(lw, filename_from_path(buf));
- }
+ gchar *base = remove_level_from_path(buf);
- g_free(base);
+ if (strcmp(lw->dir_fd->path, base) == 0)
+ {
+ layout_list_scroll_to_subpart(lw,
filename_from_path(buf));
+ }
+ g_free(base);
+ }
+
g_free(buf);
}
@@ -194,16 +194,8 @@
if (!lw || !lw->back_button) return;
if (!layout_valid(&lw)) return;
- if (n >= 2)
- {
- /* Enable back button */
- gtk_widget_set_sensitive(lw->back_button, TRUE);
- }
- else
- {
- /* Disable back button */
- gtk_widget_set_sensitive(lw->back_button, FALSE);
- }
+ /* Enable back button if it makes sense */
+ gtk_widget_set_sensitive(lw->back_button, (n > 1));
}
static GtkWidget *layout_tool_setup(LayoutWindow *lw)
@@ -1022,17 +1014,20 @@
if (!lw->dir_fd) return;
if (lw->path_entry) gtk_entry_set_text(GTK_ENTRY(lw->path_entry),
lw->dir_fd->path);
- if (lw->vd) vd_set_fd(lw->vd, lw->dir_fd);
+ if (lw->vd) vd_set_fd(lw->vd, lw->dir_fd);
if (lw->vf) vf_set_fd(lw->vf, lw->dir_fd);
}
gint layout_set_path(LayoutWindow *lw, const gchar *path)
{
FileData *fd;
+ gint ret;
+
if (!path) return FALSE;
+
fd = file_data_new_simple(path);
- gint ret = layout_set_fd(lw, fd);
+ ret = layout_set_fd(lw, fd);
file_data_unref(fd);
return ret;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn