Guest User

Untitled

a guest
Nov 24th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. @@ -2196,8 +2200,9 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
  2. xmmsc_result_t *res;
  3.  
  4. gint mid;
  5. - gchar *propname, *propval, *src;
  6. - gboolean delete, fint, fstring, nosrc, retval = TRUE;
  7. + gchar *default_source;
  8. + gboolean delete, fint, fstring, retval = TRUE;
  9. + const gchar *source, *propname, *propval;
  10.  
  11. delete = fint = fstring = FALSE;
  12.  
  13. @@ -2220,12 +2225,10 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
  14. return FALSE;
  15. }
  16.  
  17. - if (!command_flag_string_get (ctx, "source", &src)) {
  18. - src = g_strdup_printf ("client/%s", CLI_CLIENTNAME);
  19. - nosrc = TRUE;
  20. - } else {
  21. - src = g_strdup (src);
  22. - nosrc = FALSE;
  23. + default_source = g_strdup_printf ("client/%s", CLI_CLIENTNAME);
  24. +
  25. + if (!command_flag_string_get (ctx, "source", &source)) {
  26. + source = default_source;
  27. }
  28.  
  29. if (!command_arg_string_get (ctx, 1, &propname)) {
  30. @@ -2243,7 +2246,7 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
  31. }
  32. res = xmmsc_medialib_entry_property_remove_with_source (infos->sync,
  33. mid,
  34. - src,
  35. + source,
  36. propname);
  37. xmmsc_result_wait (res);
  38. done (res, infos);
  39. @@ -2251,7 +2254,9 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
  40. res = xmmsc_medialib_get_info (infos->sync, mid);
  41. xmmsc_result_wait (res);
  42. /* use source-preference when printing and user hasn't set --source */
  43. - print_property (infos, res, mid, nosrc ? NULL : src, propname);
  44. + print_property (infos, res, mid,
  45. + source == default_source ? NULL : source,
  46. + propname);
  47. } else {
  48. gint value;
  49. gboolean cons;
  50. @@ -2267,13 +2272,13 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
  51. if (fint) {
  52. res = xmmsc_medialib_entry_property_set_int_with_source (infos->sync,
  53. mid,
  54. - src,
  55. + source,
  56. propname,
  57. value);
  58. } else {
  59. res = xmmsc_medialib_entry_property_set_str_with_source (infos->sync,
  60. mid,
  61. - src,
  62. + source,
  63. propname,
  64. propval);
  65. }
  66. @@ -2282,8 +2287,8 @@ cli_server_property (cli_infos_t *infos, command_context_t *ctx)
  67. done (res, infos);
  68. }
  69.  
  70. - finish:
  71. - g_free (src);
  72. +finish:
  73. + g_free (default_source);
  74.  
  75. return retval;
  76. }
Add Comment
Please, Sign In to add comment