summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2012-01-12 21:31:48 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2012-01-12 21:31:48 +0000
commit7aef8c5669946d7a13ec56e1b3a3c72584ab3284 (patch)
treef7c8b8067610a44cd86d38e56ae76ccf1971c631
parent52ccfb4d3b2ca00a4dd8ab4bad43688e45f58829 (diff)
the handler for adding many files (threaded) expands after adding, consistent with the fewer handler.
-rw-r--r--src/trg-files-model.c7
-rw-r--r--src/trg-files-model.h5
-rw-r--r--src/trg-main-window.c6
3 files changed, 8 insertions, 10 deletions
diff --git a/src/trg-files-model.c b/src/trg-files-model.c
index 4363a25..8675237 100644
--- a/src/trg-files-model.c
+++ b/src/trg-files-model.c
@@ -317,6 +317,7 @@ gboolean trg_files_model_update_foreach(GtkListStore * model,
struct FirstUpdateThreadData {
TrgFilesModel *model;
+ GtkTreeView *tree_view;
JsonArray *files;
gint n_items;
trg_files_tree_node *top_node;
@@ -333,6 +334,7 @@ static gboolean trg_files_model_applytree_idlefunc(gpointer data)
if (args->torrent_id == priv->torrentId) {
store_add_node(GTK_TREE_STORE(args->model), NULL, args->top_node);
+ gtk_tree_view_expand_all(args->tree_view);
priv->n_items = args->n_items;
priv->accept = TRUE;
}
@@ -371,8 +373,8 @@ static gpointer trg_files_model_buildtree_threadfunc(gpointer data)
return NULL;
}
-void trg_files_model_update(TrgFilesModel * model, gint64 updateSerial,
- JsonObject * t, gint mode)
+void trg_files_model_update(TrgFilesModel * model, GtkTreeView *tv,
+ gint64 updateSerial, JsonObject * t, gint mode)
{
TrgFilesModelPrivate *priv = TRG_FILES_MODEL_GET_PRIVATE(model);
JsonArray *files = torrent_get_files(t);
@@ -393,6 +395,7 @@ void trg_files_model_update(TrgFilesModel * model, gint64 updateSerial,
gtk_tree_store_clear(GTK_TREE_STORE(model));
json_array_ref(files);
+ futd->tree_view = tv;
futd->files = files;
futd->filesList = filesList;
futd->torrent_id = priv->torrentId;
diff --git a/src/trg-files-model.h b/src/trg-files-model.h
index 7a53a55..1b98246 100644
--- a/src/trg-files-model.h
+++ b/src/trg-files-model.h
@@ -62,9 +62,8 @@ G_END_DECLS enum {
#define TRG_FILES_MODEL_CREATE_THREAD_IF_GT 600
-void
-trg_files_model_update(TrgFilesModel * model, gint64 updateSerial,
- JsonObject * t, gint mode);
+void trg_files_model_update(TrgFilesModel * model, GtkTreeView *tv,
+ gint64 updateSerial, JsonObject * t, gint mode);
gint64 trg_files_model_get_torrent_id(TrgFilesModel * model);
void trg_files_model_set_accept(TrgFilesModel * model, gboolean accept);
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index bee6e82..1c97dd6 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -296,15 +296,11 @@ static void update_selected_torrent_notebook(TrgMainWindow * win,
trg_general_panel_update(priv->genDetails, t, &iter);
trg_trackers_model_update(priv->trackersModel,
trg_client_get_serial(client), t, mode);
- trg_files_model_update(priv->filesModel,
+ trg_files_model_update(priv->filesModel, GTK_TREE_VIEW(priv->filesTreeView),
trg_client_get_serial(client), t, mode);
trg_peers_model_update(priv->peersModel,
TRG_TREE_VIEW(priv->peersTreeView),
trg_client_get_serial(client), t, mode);
-
- if (mode == TORRENT_GET_MODE_FIRST)
- gtk_tree_view_expand_all(GTK_TREE_VIEW(priv->filesTreeView));
-
} else if (id < 0) {
trg_main_window_torrent_scrub(win);
}