diff options
-rw-r--r-- | src/trg-main-window.c | 4 | ||||
-rw-r--r-- | src/trg-torrent-tree-view.c | 7 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/trg-main-window.c b/src/trg-main-window.c index fe650c0..b8fdd3f 100644 --- a/src/trg-main-window.c +++ b/src/trg-main-window.c @@ -953,6 +953,8 @@ on_torrent_get_multipurpose(JsonObject * response, gboolean first, g_mutex_lock(client->updateMutex); + client->updateSerial++; + trg_torrent_model_update(priv->torrentModel, priv->client, response, &stats, first); @@ -964,8 +966,6 @@ on_torrent_get_multipurpose(JsonObject * response, gboolean first, g_timeout_add_seconds(3, trg_update_torrents_timerfunc, data); - client->updateSerial++; - gdk_threads_leave(); response_unref(response); } diff --git a/src/trg-torrent-tree-view.c b/src/trg-torrent-tree-view.c index 43a49db..b0c8e2a 100644 --- a/src/trg-torrent-tree-view.c +++ b/src/trg-torrent-tree-view.c @@ -77,17 +77,12 @@ gint get_first_selected(trg_client *client, TrgTorrentTreeView * view, GtkTreeIt if ((firstNode = g_list_first(selectionList)) != NULL) { if (gtk_tree_model_get_iter(model, iter, firstNode->data) == TRUE) { - gboolean locked; gtk_tree_model_get(model, iter, TORRENT_COLUMN_JSON, json, TORRENT_COLUMN_ID, &id, TORRENT_COLUMN_UPDATESERIAL, &updateSerial, -1); - locked = g_mutex_trylock(client->updateMutex); - if (locked) - g_mutex_unlock(client->updateMutex); - - if (updateSerial < (locked ? client->updateSerial-1 : client->updateSerial)) + if (updateSerial < client->updateSerial) id = -1; } } |