Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @@ -2196,8 +2200,9 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
- xmmsc_result_t *res;
- gint mid;
- - gchar *propname, *propval, *src;
- - gboolean delete, fint, fstring, nosrc, retval = TRUE;
- + gchar *default_source;
- + gboolean delete, fint, fstring, retval = TRUE;
- + const gchar *source, *propname, *propval;
- delete = fint = fstring = FALSE;
- @@ -2220,12 +2225,10 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
- return FALSE;
- }
- - if (!command_flag_string_get (ctx, "source", &src)) {
- - src = g_strdup_printf ("client/%s", CLI_CLIENTNAME);
- - nosrc = TRUE;
- - } else {
- - src = g_strdup (src);
- - nosrc = FALSE;
- + default_source = g_strdup_printf ("client/%s", CLI_CLIENTNAME);
- +
- + if (!command_flag_string_get (ctx, "source", &source)) {
- + source = default_source;
- }
- if (!command_arg_string_get (ctx, 1, &propname)) {
- @@ -2243,7 +2246,7 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
- }
- res = xmmsc_medialib_entry_property_remove_with_source (infos->sync,
- mid,
- - src,
- + source,
- propname);
- xmmsc_result_wait (res);
- done (res, infos);
- @@ -2251,7 +2254,9 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
- res = xmmsc_medialib_get_info (infos->sync, mid);
- xmmsc_result_wait (res);
- /* use source-preference when printing and user hasn't set --source */
- - print_property (infos, res, mid, nosrc ? NULL : src, propname);
- + print_property (infos, res, mid,
- + source == default_source ? NULL : source,
- + propname);
- } else {
- gint value;
- gboolean cons;
- @@ -2267,13 +2272,13 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
- if (fint) {
- res = xmmsc_medialib_entry_property_set_int_with_source (infos->sync,
- mid,
- - src,
- + source,
- propname,
- value);
- } else {
- res = xmmsc_medialib_entry_property_set_str_with_source (infos->sync,
- mid,
- - src,
- + source,
- propname,
- propval);
- }
- @@ -2282,8 +2287,8 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
- done (res, infos);
- }
- - finish:
- - g_free (src);
- +finish:
- + g_free (default_source);
- return retval;
- }
Add Comment
Please, Sign In to add comment