Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ROX-Filer/Options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
<item label='Type' value='1'/>
<item label='Date' value='2'/>
<item label='Size' value='3'/>
<item label='Owner' value='4'/>
<item label='Group' value='5'/>
</menu>
</vbox><vbox>
<toggle name='display_show_hidden' label='Show hidden files'>If this is on then files whose names start with a dot are shown too, otherwise they are hidden.</toggle>
Expand Down Expand Up @@ -81,7 +83,7 @@ indicator'>If this is on then files which have one or more extended attributes s
</frame>
<frame label='List View'>
<toggle name='display_show_headers' label='Show column headings'>If this is on then column headings will be shown in the list view.</toggle>
<toggle name='display_show_full_type' label='Show full type'>If this is on then the full description of each object's type will be show rather than a short summary of its basic type.</toggle>
<toggle name='display_show_full_type' label='Show full type'>If this is on then the full description of each object's type will be shown rather than a short summary of its basic type.</toggle>
</frame>
</section>
<section title='Tools/Minibuffer'>
Expand Down
6 changes: 4 additions & 2 deletions ROX-Filer/src/abox.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,17 +476,19 @@ void abox_add_filename(ABox *abox, const gchar *path)
{
GtkTreeModel *model;
GtkTreeIter iter;
gchar *dir;
gchar *dir, *base;

model = gtk_tree_view_get_model(GTK_TREE_VIEW(abox->results));

gtk_list_store_append(GTK_LIST_STORE(model), &iter);

dir = g_path_get_dirname(path);
base = g_path_get_basename(path);
gtk_list_store_set(GTK_LIST_STORE(model), &iter,
0, g_basename(path),
0, base,
1, dir, -1);
g_free(dir);
g_free(base);
}

/* Clear search results area */
Expand Down
29 changes: 23 additions & 6 deletions ROX-Filer/src/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,14 +956,18 @@ static void do_delete(const char *src_path, const char *unused)
send_error();
else
{
gchar *base;

send_check_path(safe_path);
if (strcmp(g_basename(safe_path), ".DirIcon") == 0)
base = g_path_get_basename(safe_path);
if (strcmp(base, ".DirIcon") == 0)
{
gchar *dir;
dir = g_path_get_dirname(safe_path);
send_check_path(dir);
g_free(dir);
}
g_free(base);
}

g_free(safe_path);
Expand Down Expand Up @@ -1021,6 +1025,7 @@ static void do_eject(const char *path)
*/
static void do_find(const char *path, const char *unused)
{
gchar *base;
FindInfo info;

check_flags();
Expand Down Expand Up @@ -1060,10 +1065,12 @@ static void do_find(const char *path, const char *unused)
info.fullpath = path;
time(&info.now); /* XXX: Not for each check! */

info.leaf = g_basename(path);
base = g_path_get_basename(path);
info.leaf = base;
info.prune = FALSE;
if (find_test_condition(find_condition, &info))
printf_send("=%s", path);
g_free(base);

if (S_ISDIR(info.stats.st_mode) && !info.prune)
{
Expand Down Expand Up @@ -1695,6 +1702,7 @@ static void usage_cb(gpointer data)
for (i=0; paths; paths = paths->next, i++)
{
guchar *path = (guchar *) paths->data;
gchar *base;

send_dir(path);

Expand All @@ -1707,9 +1715,10 @@ static void usage_cb(gpointer data)
}
do_usage(path, NULL);

base = g_path_get_basename(path);
printf_send("'%s: %s\n",
g_basename(path),
format_double_size(size_tally));
base, format_double_size(size_tally));
g_free(base);
total_size += size_tally;
}
printf_send("%%-1");
Expand Down Expand Up @@ -1885,8 +1894,12 @@ static void chmod_cb(gpointer data)
if (mc_stat(path, &info) != 0)
send_error();
else if (S_ISLNK(info.st_mode))
{
gchar *base = g_path_get_basename(path);
printf_send(_("!'%s' is a symbolic link\n"),
g_basename(path));
base);
g_free(base);
}
else
do_chmod(path, NULL);
}
Expand Down Expand Up @@ -1916,8 +1929,12 @@ static void settype_cb(gpointer data)
if (mc_stat(path, &info) != 0)
send_error();
else if (S_ISLNK(info.st_mode))
{
gchar *base = g_path_get_basename(path);
printf_send(_("!'%s' is a symbolic link\n"),
g_basename(path));
base);
g_free(base);
}
else
do_settype(path, NULL);
}
Expand Down
2 changes: 0 additions & 2 deletions ROX-Filer/src/collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1428,8 +1428,6 @@ void collection_qsort(Collection *collection,
wink_on_map_data = collection->items[wink_on_map].data;
collection->wink_on_map = -1;
}
else
wink = -1;

wink = collection->wink_item;
if (wink >= 0 && wink < items)
Expand Down
12 changes: 7 additions & 5 deletions ROX-Filer/src/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,22 +313,22 @@ void dir_check_this(const guchar *path)
FSCACHE_LOOKUP_PEEK, NULL);
if (dir)
{
dir_recheck(dir, real_path, g_basename(path));
gchar *base = g_path_get_basename(path);
dir_recheck(dir, real_path, base);
g_free(base);
g_object_unref(dir);
}

g_free(real_path);
}

#ifdef USE_NOTIFY
#ifdef USE_DNOTIFY
static void drop_notify(gpointer key, gpointer value, gpointer data)
{
#ifdef USE_INOTIFY
inotify_rm_watch(inotify_fd, GPOINTER_TO_INT(key));
#endif
#ifdef USE_DNOTIFY
close(GPOINTER_TO_INT(key));
#endif
}
#endif

Expand Down Expand Up @@ -359,7 +359,9 @@ void dir_force_update_path(const gchar *path)
NULL);
if (dir)
{
dir_force_update_item(dir, g_basename(path));
gchar *base = g_path_get_basename(path);
dir_force_update_item(dir, base);
g_free(base);
g_object_unref(dir);
}

Expand Down
8 changes: 5 additions & 3 deletions ROX-Filer/src/filer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ void filer_open_parent(FilerWindow *filer_window)

void change_to_parent(FilerWindow *filer_window)
{
char *dir;
gchar *dir, *base;
const char *current = filer_window->sym_path;

if (current[0] == '/' && current[1] == '\0')
Expand All @@ -1297,8 +1297,10 @@ void change_to_parent(FilerWindow *filer_window)
g_strdup(filer_window->real_path));

dir = g_path_get_dirname(current);
filer_change_to(filer_window, dir, g_basename(current));
base = g_path_get_basename(current);
filer_change_to(filer_window, dir, base);
g_free(dir);
g_free(base);
}

/* Removes trailing /s from path (modified in place) */
Expand Down Expand Up @@ -1506,7 +1508,7 @@ FilerWindow *filer_opendir(const char *path, FilerWindow *src_win,
filer_window->display_style_wanted = UNKNOWN_STYLE;
filer_window->thumb_queue = NULL;
filer_window->max_thumbs = 0;
filer_window->sort_type = -1;
filer_window->sort_type = SORT_UNKNOWN;

filer_window->filter = FILER_SHOW_ALL;
filer_window->filter_string = NULL;
Expand Down
3 changes: 2 additions & 1 deletion ROX-Filer/src/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ typedef enum { /* Values used in options */
SORT_DATE = 2,
SORT_SIZE = 3,
SORT_OWNER = 4,
SORT_GROUP = 5
SORT_GROUP = 5,
SORT_UNKNOWN = -1,
} SortType;

/* Each DirItem has a base type with indicates what kind of object it is.
Expand Down
8 changes: 5 additions & 3 deletions ROX-Filer/src/gtksavebox.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ button_press_over_icon (GtkWidget *drag_box, GdkEventButton *event,
GtkSavebox *savebox)
{
GdkDragContext *context;
const gchar *uri = NULL, *leafname;
const gchar *uri = NULL;
gchar *leafname;

g_return_if_fail (savebox != NULL);
g_return_if_fail (GTK_IS_SAVEBOX (savebox));
Expand All @@ -390,11 +391,12 @@ button_press_over_icon (GtkWidget *drag_box, GdkEventButton *event,

uri = gtk_entry_get_text (GTK_ENTRY (savebox->entry));
if (uri && *uri)
leafname = g_basename (uri);
leafname = g_path_get_basename (uri);
else
leafname = _("Unnamed");
leafname = g_strdup (_("Unnamed"));

write_xds_property (context, leafname);
g_free(leafname);

gtk_drag_set_icon_pixbuf (context,
gtk_image_get_pixbuf (GTK_IMAGE (savebox->icon)),
Expand Down
12 changes: 10 additions & 2 deletions ROX-Filer/src/icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <string.h>
#include <gtk/gtk.h>
#include <X11/keysym.h>
#include <X11/XKBlib.h>
#include <gdk/gdkx.h>

#include "global.h"
Expand Down Expand Up @@ -456,6 +457,8 @@ void icon_set_path(Icon *icon, const char *pathname, const char *name)

if (pathname)
{
gchar *src_base = NULL;

if (g_utf8_validate(pathname, -1, NULL))
icon->src_path = g_strdup(pathname);
else
Expand All @@ -465,10 +468,15 @@ void icon_set_path(Icon *icon, const char *pathname, const char *name)
icon_hash_path(icon);

if (!name)
name = g_basename(icon->src_path);
{
src_base = g_path_get_basename(icon->src_path);
name = src_base;
}

icon->item = diritem_new(name);
diritem_restat(icon->path, icon->item, NULL);

g_free(src_base);
}
}

Expand Down Expand Up @@ -746,7 +754,7 @@ static GdkFilterReturn filter_get_key(GdkXEvent *xevent,
KeySym sym;
unsigned int m = kev->state;

sym = XKeycodeToKeysym(dpy, kev->keycode, 0);
sym = XkbKeycodeToKeysym(dpy, kev->keycode, 0, 0);
if (!sym)
return GDK_FILTER_CONTINUE;

Expand Down
9 changes: 6 additions & 3 deletions ROX-Filer/src/infobox.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,15 @@ static GtkWidget *make_vbox(const guchar *path, GObject *window)
GtkBox *vbox;
XMLwrapper *ai;
xmlNode *about = NULL;
gchar *help_dir;
gchar *base, *help_dir;
GtkWidget *hbox, *name, *label;
MaskedPixmap *thumb;

g_return_val_if_fail(path[0] == '/', NULL);

item = diritem_new(g_basename(path));
base = g_path_get_basename(path);
item = diritem_new(path);
g_free(base);
diritem_restat(path, item, NULL);

ai = appinfo_get(path, item);
Expand Down Expand Up @@ -837,7 +839,8 @@ static GtkWidget *make_file_says(const guchar *path)
#ifdef FILE_B_FLAG
argv[2] = (char *) path;
#else
argv[1] = (char *) g_basename(path);
/* No need to free these, as we're about to exec anyway */
argv[1] = (char *) g_path_get_basename(path);
chdir(g_path_get_dirname(path));
#endif
if (execvp(argv[0], argv))
Expand Down
6 changes: 5 additions & 1 deletion ROX-Filer/src/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ void log_info_paths(const gchar *message, GList *paths, const gchar *path)
}

if (n_paths == 1)
actual_message = g_strdup_printf(_("%s '%s'"), message, g_basename((char *) paths->data));
{
gchar *base = g_path_get_basename((char *) paths->data);
actual_message = g_strdup_printf(_("%s '%s'"), message, base);
g_free(base);
}
else if (n_paths > 1)
actual_message = g_strdup_printf(_("%s on %d items"), message, n_paths);

Expand Down
8 changes: 5 additions & 3 deletions ROX-Filer/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ int main(int argc, char **argv)
int wakeup_pipe[2];
int i;
struct sigaction act;
guchar *tmp, *dir;
guchar *tmp, *base, *dir;
gchar *client_id = NULL;
gboolean show_user = FALSE;
gboolean rpc_mode = FALSE;
Expand Down Expand Up @@ -430,16 +430,18 @@ int main(int argc, char **argv)
break;
case 's':
tmp = g_path_get_dirname(VALUE);

base = g_path_get_basename(VALUE);

if (tmp[0] == '/')
dir = NULL;
else
dir = pathdup(tmp);

soap_add(body, "Show",
"Directory", dir ? dir : tmp,
"Leafname", g_basename(VALUE));
"Leafname", base);
g_free(tmp);
g_free(base);
g_free(dir);
break;
case 'l':
Expand Down
Loading