refactor: add an enumeration of the script types (#1934)

* refactor: add an enumeration of the script types

This simplifies the API by having a single set of functions that can be
used for getting/setting all the script types.
This commit is contained in:
Charles Kerr
2021-10-12 22:46:12 -05:00
committed by GitHub
parent 16dcc224ec
commit 98e16a178f
8 changed files with 70 additions and 94 deletions

View File

@@ -1349,11 +1349,11 @@ static void on_prefs_changed(TrCore const* core, tr_quark const key, gpointer da
break;
case TR_KEY_script_torrent_done_enabled:
tr_sessionSetTorrentDoneScriptEnabled(tr, gtr_pref_flag_get(key));
tr_sessionSetScriptEnabled(tr, TR_SCRIPT_ON_TORRENT_DONE, gtr_pref_flag_get(key));
break;
case TR_KEY_script_torrent_done_filename:
tr_sessionSetTorrentDoneScript(tr, gtr_pref_string_get(key));
tr_sessionSetScript(tr, TR_SCRIPT_ON_TORRENT_DONE, gtr_pref_string_get(key));
break;
case TR_KEY_start_added_torrents: