From a04430bff79030690add518548677251816e3e71 Mon Sep 17 00:00:00 2001 From: Alan Fitton Date: Wed, 19 Oct 2011 17:32:46 +0000 Subject: issue 155 --- src/remote-exec.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/remote-exec.c') diff --git a/src/remote-exec.c b/src/remote-exec.c index 75c1d10..d8041c7 100644 --- a/src/remote-exec.c +++ b/src/remote-exec.c @@ -22,6 +22,8 @@ #include #include "trg-torrent-model.h" +#include "trg-client.h" +#include "trg-prefs.h" #include "protocol-constants.h" #include "torrent.h" @@ -81,15 +83,19 @@ static gchar *dump_json_value(JsonNode * node) { return g_string_free(buffer, FALSE); } -gchar *build_remote_exec_cmd(TrgPrefs *prefs, GtkTreeModel *model, GList *selection, +gchar *build_remote_exec_cmd(TrgClient *tc, GtkTreeModel *model, GList *selection, const gchar * input) { - JsonObject *profile = trg_prefs_get_profile(prefs); - gchar *work = g_strdup(input); + JsonObject *profile = trg_client_get_current_profile(tc); + gchar *work; GRegex *regex, *replacerx; GMatchInfo *match_info; gchar *whole, *wholeEscaped, *id, *tmp, *valuestr, *repeater; JsonNode *replacement; + if (!profile) + return NULL; + + work = g_strdup(input); regex = g_regex_new("%{([A-Za-z\\-]+)}(?:\\[(.*)\\])?", 0, 0, NULL); g_regex_match_full(regex, input, -1, 0, 0, &match_info, NULL); -- cgit v1.2.3