[anjuta] git: Unset the log model view before refreshing the log



commit 56ecfd867e063502df010cc319db2b08e2253643
Author: James Liggett <jrliggett cox net>
Date:   Tue Feb 19 16:15:00 2013 -0800

    git: Unset the log model view before refreshing the log

 plugins/git/git-log-pane.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/plugins/git/git-log-pane.c b/plugins/git/git-log-pane.c
index abeca44..5f381d9 100644
--- a/plugins/git/git-log-pane.c
+++ b/plugins/git/git-log-pane.c
@@ -296,17 +296,11 @@ on_log_command_finished (AnjutaCommand *command, guint return_code,
                git_pane_report_errors (command, return_code,
                                        ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE 
(self))));
 #endif
-               g_object_ref (self->priv->log_model);
-               gtk_tree_view_set_model (GTK_TREE_VIEW (log_view), NULL);
                g_object_unref (command);
                
                return;
        }
        
-       
-       g_object_ref (self->priv->log_model);
-       gtk_tree_view_set_model (GTK_TREE_VIEW (log_view), NULL);
-       
        queue = git_log_command_get_output_queue (GIT_LOG_COMMAND (command));
        
        while (g_queue_peek_head (queue))
@@ -334,9 +328,12 @@ static void
 refresh_log (GitLogPane *self)
 {
        Git *plugin;
+       GtkTreeView *log_view;
        GtkTreeViewColumn *graph_column;
 
        plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)));
+       log_view = GTK_TREE_VIEW (gtk_builder_get_object (self->priv->builder,
+                                                         "log_view"));
        graph_column = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object (self->priv->builder,
                                                                     "graph_column"));
 
@@ -344,6 +341,9 @@ refresh_log (GitLogPane *self)
        if (self->priv->log_command)
                g_object_unref (self->priv->log_command);
 
+       g_object_ref (self->priv->log_model);
+       gtk_tree_view_set_model (log_view, NULL);
+
        /* We don't support filters for now */
        self->priv->log_command = git_log_command_new (plugin->project_root_directory,
                                                       self->priv->selected_branch,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]