From f89fab72f99b4014f4688bc658ec059fab760e49 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sun, 18 Oct 2015 18:39:14 +0000 Subject: [PATCH] Remove unused session tag --- cli/cli.c | 2 +- daemon/daemon.c | 2 +- gtk/main.c | 2 +- libtransmission/libtransmission-test.c | 2 +- libtransmission/session.c | 9 +++------ libtransmission/session.h | 1 - libtransmission/transmission.h | 6 ++---- macosx/Controller.m | 2 +- qt/Session.cc | 2 +- 9 files changed, 11 insertions(+), 17 deletions(-) diff --git a/cli/cli.c b/cli/cli.c index c737ddf74..475617358 100644 --- a/cli/cli.c +++ b/cli/cli.c @@ -280,7 +280,7 @@ tr_main (int argc, } } - h = tr_sessionInit ("cli", configDir, false, &settings); + h = tr_sessionInit (configDir, false, &settings); ctor = tr_ctorNew (h); diff --git a/daemon/daemon.c b/daemon/daemon.c index 88df3cc92..eecbfcb82 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -511,7 +511,7 @@ daemon_start (void * raw_arg, tr_formatter_mem_init (MEM_K, MEM_K_STR, MEM_M_STR, MEM_G_STR, MEM_T_STR); tr_formatter_size_init (DISK_K, DISK_K_STR, DISK_M_STR, DISK_G_STR, DISK_T_STR); tr_formatter_speed_init (SPEED_K, SPEED_K_STR, SPEED_M_STR, SPEED_G_STR, SPEED_T_STR); - session = tr_sessionInit ("daemon", configDir, true, settings); + session = tr_sessionInit (configDir, true, settings); tr_sessionSetRPCCallback (session, on_rpc_callback, NULL); tr_logAddNamedInfo (NULL, "Using settings from \"%s\"", configDir); tr_sessionSaveSettings (session, configDir, settings); diff --git a/gtk/main.c b/gtk/main.c index 53beb35af..c8fc6b3ad 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -523,7 +523,7 @@ on_startup (GApplication * application, gpointer user_data) g_mkdir_with_parents (str, 0777); /* initialize the libtransmission session */ - session = tr_sessionInit ("gtk", cbdata->config_dir, TRUE, gtr_pref_get_all ()); + session = tr_sessionInit (cbdata->config_dir, TRUE, gtr_pref_get_all ()); gtr_pref_flag_set (TR_KEY_alt_speed_enabled, tr_sessionUsesAltSpeed (session)); gtr_pref_int_set (TR_KEY_peer_port, tr_sessionGetPeerPort (session)); diff --git a/libtransmission/libtransmission-test.c b/libtransmission/libtransmission-test.c index a42a2a635..492219461 100644 --- a/libtransmission/libtransmission-test.c +++ b/libtransmission/libtransmission-test.c @@ -276,7 +276,7 @@ libttest_session_init (tr_variant * settings) if (!tr_variantDictFind (settings, q)) tr_variantDictAddInt (settings, q, verbose ? TR_LOG_DEBUG : TR_LOG_ERROR); - session = tr_sessionInit ("libtransmission-test", sandbox, !verbose, settings); + session = tr_sessionInit (sandbox, !verbose, settings); tr_free (sandbox); tr_variantFree (&local_settings); diff --git a/libtransmission/session.c b/libtransmission/session.c index 7550d5220..8b1eaa486 100644 --- a/libtransmission/session.c +++ b/libtransmission/session.c @@ -581,10 +581,9 @@ struct init_data }; tr_session * -tr_sessionInit (const char * tag, - const char * configDir, - bool messageQueuingEnabled, - tr_variant * clientSettings) +tr_sessionInit (const char * configDir, + bool messageQueuingEnabled, + tr_variant * clientSettings) { int64_t i; tr_session * session; @@ -600,7 +599,6 @@ tr_sessionInit (const char * tag, session->udp6_socket = TR_BAD_SOCKET; session->lock = tr_lockNew (); session->cache = tr_cacheNew (1024*1024*2); - session->tag = tr_strdup (tag); session->magicNumber = SESSION_MAGIC_NUMBER; tr_bandwidthConstruct (&session->bandwidth, session, NULL); tr_variantInitList (&session->removedTorrents, 0); @@ -1929,7 +1927,6 @@ tr_sessionClose (tr_session * session) } tr_device_info_free (session->downloadDir); tr_free (session->torrentDoneScript); - tr_free (session->tag); tr_free (session->configDir); tr_free (session->resumeDir); tr_free (session->torrentDir); diff --git a/libtransmission/session.h b/libtransmission/session.h index 367a37534..41dfa202a 100644 --- a/libtransmission/session.h +++ b/libtransmission/session.h @@ -179,7 +179,6 @@ struct tr_session char * torrentDoneScript; - char * tag; char * configDir; char * resumeDir; char * torrentDir; diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 95492fe29..55ad2db14 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -252,12 +252,11 @@ void tr_sessionSaveSettings (tr_session * session, * tr_variantInitDict (&settings, 0); * tr_sessionGetDefaultSettings (&settings); * configDir = tr_getDefaultConfigDir ("Transmission"); - * session = tr_sessionInit ("mac", configDir, true, &settings); + * session = tr_sessionInit (configDir, true, &settings); * * tr_variantFree (&settings); * @endcode * - * @param tag "gtk", "macosx", "daemon", etc... this is only for pre-1.30 resume files * @param configDir where Transmission will look for resume files, blocklists, etc. * @param messageQueueingEnabled if false, messages will be dumped to stderr * @param settings libtransmission settings @@ -265,8 +264,7 @@ void tr_sessionSaveSettings (tr_session * session, * @see tr_sessionLoadSettings () * @see tr_getDefaultConfigDir () */ -tr_session * tr_sessionInit (const char * tag, - const char * configDir, +tr_session * tr_sessionInit (const char * configDir, bool messageQueueingEnabled, struct tr_variant * settings); diff --git a/macosx/Controller.m b/macosx/Controller.m index f983507c4..a56f00421 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -361,7 +361,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy [tbString UTF8String]); const char * configDir = tr_getDefaultConfigDir("Transmission"); - fLib = tr_sessionInit("macosx", configDir, YES, &settings); + fLib = tr_sessionInit(configDir, YES, &settings); tr_variantFree(&settings); fConfigDirectory = [[NSString alloc] initWithUTF8String: configDir]; diff --git a/qt/Session.cc b/qt/Session.cc index a002c693f..cbf4adda4 100644 --- a/qt/Session.cc +++ b/qt/Session.cc @@ -351,7 +351,7 @@ Session::start () tr_variant settings; tr_variantInitDict (&settings, 0); tr_sessionLoadSettings (&settings, myConfigDir.toUtf8 ().constData (), "qt"); - mySession = tr_sessionInit ("qt", myConfigDir.toUtf8 ().constData (), true, &settings); + mySession = tr_sessionInit (myConfigDir.toUtf8 ().constData (), true, &settings); tr_variantFree (&settings); myRpc.start (mySession); -- 2.40.0