From 8be537ef80ec6e211bae5a67b99af74bb744c453 Mon Sep 17 00:00:00 2001 From: Alan Fitton Date: Thu, 13 Oct 2011 21:12:46 +0000 Subject: if the app is started with a torrent and autoconnect, upload it after the first update, not session_get. noticed a bunch of added notifications when connecting, think this is because the first update isn't through the first update callback. --- src/trg-main-window.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/trg-main-window.c') diff --git a/src/trg-main-window.c b/src/trg-main-window.c index 37e5cfe..c1af8d3 100644 --- a/src/trg-main-window.c +++ b/src/trg-main-window.c @@ -852,8 +852,6 @@ static gboolean on_session_get(gpointer data) { if (!isConnected) { trg_trackers_tree_view_new_connection(priv->trackersTreeView, client); dispatch_async(client, torrent_get(-1), on_torrent_get_first, win); - if (priv->args) - trg_add_from_filename(win, priv->args); } trg_response_free(response); @@ -939,7 +937,16 @@ static gboolean on_torrent_get_active(gpointer data) { } static gboolean on_torrent_get_first(gpointer data) { - return on_torrent_get(data, TORRENT_GET_MODE_FIRST); + trg_response *response = (trg_response*)data; + TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(response->cb_data); + TrgMainWindow *win = TRG_MAIN_WINDOW(response->cb_data); + + gboolean result = on_torrent_get(data, TORRENT_GET_MODE_FIRST); + + if (priv->args) + trg_add_from_filename(win, priv->args); + + return result; } static gboolean on_torrent_get_interactive(gpointer data) { -- cgit v1.2.3