>From 410bda34d393485bef552b6c1906ee6b54a6bfd9 Mon Sep 17 00:00:00 2001 From: phan Date: Mon, 12 Jul 2010 16:03:51 +0200 Subject: [PATCH] Fix for faulty view.refresh caused by not reconnecting callbacks This patch fixes the directory refresh operation and all related to it funtions, like showing hidden files or vfs monitor callbacks. It was caused by disconnecting callback functions from directiories and not reconnecting these callbacks back, when DIR_STATE_LISTED directiories were back visible. Callbacks disconnection is made in gnome-cmd-file-list.cc:2549 and in gnome-cmd-file-list.cc:1354, which is weird but still ok (but I think, that the latter should be removed, because it seems, that nothing relies on it) --- src/gnome-cmd-dir.cc | 6 ++++++ src/gnome-cmd-dir.h | 1 + src/gnome-cmd-file-list.cc | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletions(-) diff --git a/src/gnome-cmd-dir.cc b/src/gnome-cmd-dir.cc index 306e147..19ae44d 100644 --- a/src/gnome-cmd-dir.cc +++ b/src/gnome-cmd-dir.cc @@ -582,6 +582,12 @@ void gnome_cmd_dir_list_files (GnomeCmdDir *dir, gboolean visprog) gtk_signal_emit (GTK_OBJECT (dir), dir_signals[LIST_OK], dir->priv->files); } +void gnome_cmd_dir_list_files_simplified (GnomeCmdDir *dir) +{ + g_return_if_fail (GNOME_CMD_IS_DIR (dir)); + + gtk_signal_emit (GTK_OBJECT (dir), dir_signals[LIST_OK], dir->priv->files); +} GnomeCmdPath *gnome_cmd_dir_get_path (GnomeCmdDir *dir) { diff --git a/src/gnome-cmd-dir.h b/src/gnome-cmd-dir.h index d60d998..37f1924 100644 --- a/src/gnome-cmd-dir.h +++ b/src/gnome-cmd-dir.h @@ -124,6 +124,7 @@ inline void gnome_cmd_dir_unref (GnomeCmdDir *dir) GnomeVFSResult gnome_cmd_dir_get_files (GnomeCmdDir *dir, GList **files); void gnome_cmd_dir_relist_files (GnomeCmdDir *dir, gboolean visprog); void gnome_cmd_dir_list_files (GnomeCmdDir *dir, gboolean visprog); +void gnome_cmd_dir_list_files_simplified (GnomeCmdDir *dir); GnomeCmdPath *gnome_cmd_dir_get_path (GnomeCmdDir *dir); void gnome_cmd_dir_set_path (GnomeCmdDir *dir, GnomeCmdPath *path); diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc index 6a23751..ba5cc96 100644 --- a/src/gnome-cmd-file-list.cc +++ b/src/gnome-cmd-file-list.cc @@ -2567,7 +2567,12 @@ void GnomeCmdFileList::set_directory(GnomeCmdDir *dir) break; case DIR_STATE_LISTED: - g_signal_emit (this, signals[DIR_CHANGED], 0, dir); + g_signal_connect (dir, "list-ok", G_CALLBACK (on_dir_list_ok), this); + g_signal_connect (dir, "list-failed", G_CALLBACK (on_dir_list_failed), this); + + //FIXME: the next function is kind of minor workaround for reconnecting callbacks to already listed + // directories; if some1 has more time for implementing the reconnecting stuff, please do so. + gnome_cmd_dir_list_files_simplified (dir); break; } -- 1.7.0.4