* with a valid and unique @c id field. This function fakes it.
*/
static void added_completed(void attribute((unused)) *v,
- const char *error,
+ const char *err,
int nvec, char **vec) {
- if(error) {
- popup_protocol_error(0, error);
+ if(err) {
+ popup_protocol_error(0, err);
return;
}
/* Convert the vector result to a queue linked list */
/** @brief Called with search results */
static void choose_search_completed(void attribute((unused)) *v,
- const char *error,
+ const char *err,
int nvec, char **vec) {
//fprintf(stderr, "choose_search_completed\n");
- if(error) {
- popup_protocol_error(0, error);
+ if(err) {
+ popup_protocol_error(0, err);
return;
}
choose_searching = 0;
}
static void choose_dirs_completed(void *v,
- const char *error,
+ const char *err,
int nvec, char **vec) {
- if(error) {
- popup_protocol_error(0, error);
+ if(err) {
+ popup_protocol_error(0, err);
return;
}
choose_populate(v, nvec, vec, 0/*!isfile*/);
}
static void choose_files_completed(void *v,
- const char *error,
+ const char *err,
int nvec, char **vec) {
- if(error) {
- popup_protocol_error(0, error);
+ if(err) {
+ popup_protocol_error(0, err);
return;
}
choose_populate(v, nvec, vec, 1/*isfile*/);
}
void choose_play_completed(void attribute((unused)) *v,
- const char *error) {
- if(error)
- popup_protocol_error(0, error);
+ const char *err) {
+ if(err)
+ popup_protocol_error(0, err);
}
static void choose_state_toggled
}
static void icon_action_completed(void attribute((unused)) *v,
- const char *error) {
- if(error)
- popup_protocol_error(0, error);
+ const char *err) {
+ if(err)
+ popup_protocol_error(0, err);
}
static void clicked_icon(GtkButton attribute((unused)) *button,
/** @brief Called when a volume command completes */
static void volume_completed(void attribute((unused)) *v,
- const char *error,
+ const char *err,
int attribute((unused)) l,
int attribute((unused)) r) {
- if(error)
- popup_protocol_error(0, error);
+ if(err)
+ popup_protocol_error(0, err);
/* We don't set the UI's notion of the volume here, it is set from the log
* regardless of the reason it changed */
}
}
static void userinfo_rights_completed(void attribute((unused)) *v,
- const char *error,
+ const char *err,
const char *value) {
rights_type r;
- if(error) {
- popup_protocol_error(0, error);
+ if(err) {
+ popup_protocol_error(0, err);
r = 0;
} else {
if(parse_rights(value, &r, 0))
/** @brief Called when a NOP completes */
static void nop_completed(void attribute((unused)) *v,
- const char attribute((unused)) *error) {
+ const char attribute((unused)) *err) {
/* TODO report the error somewhere */
nop_in_flight = 0;
}
/** @brief Called when a rtp-address command succeeds */
static void got_rtp_address(void attribute((unused)) *v,
- const char *error,
+ const char *err,
int attribute((unused)) nvec,
char attribute((unused)) **vec) {
const int rtp_was_supported = rtp_supported;
++suppress_actions;
rtp_address_in_flight = 0;
- if(error) {
+ if(err) {
/* An error just means that we're not using network play */
rtp_supported = 0;
rtp_is_running = 0;
}
/** @brief Called when a namepart lookup has completed */
-static void namepart_completed(void *v, const char *error, const char *value) {
+static void namepart_completed(void *v, const char *err, const char *value) {
D(("namepart_completed"));
- if(error) {
- gtk_label_set_text(GTK_LABEL(report_label), error);
+ if(err) {
+ gtk_label_set_text(GTK_LABEL(report_label), err);
value = "?";
}
const char *key = v;
}
/** @brief Called when a length lookup has completed */
-static void length_completed(void *v, const char *error, long l) {
+static void length_completed(void *v, const char *err, long l) {
D(("length_completed"));
- if(error) {
- gtk_label_set_text(GTK_LABEL(report_label), error);
+ if(err) {
+ gtk_label_set_text(GTK_LABEL(report_label), err);
l = -1;
}
const char *key = v;
/** @brief Called when version arrives, displays about... popup */
static void about_popup_got_version(void attribute((unused)) *v,
- const char attribute((unused)) *error,
+ const char attribute((unused)) *err,
const char *value) {
GtkWidget *w;
char *server_version_string;
}
/* Called when we've set a namepart */
-static void set_namepart_completed(void *v, const char *error) {
- if(error)
- popup_protocol_error(0, error);
+static void set_namepart_completed(void *v, const char *err) {
+ if(err)
+ popup_protocol_error(0, err);
else {
struct prefdata *f = v;
}
static void set_string_completed(void attribute((unused)) *v,
- const char *error) {
- if(error)
- popup_protocol_error(0, error);
+ const char *err) {
+ if(err)
+ popup_protocol_error(0, err);
}
static void set_string(struct prefdata *f, const char *value) {
}
/* Got the value of a pref */
-static void prefdata_completed(void *v, const char *error, const char *value) {
- if(error) {
+static void prefdata_completed(void *v, const char *err, const char *value) {
+ if(err) {
} else {
struct callbackdata *cbd = v;
for(struct queue_entry *q = newq; q; q = q->next) {
const struct newqueue_data *nqd = hash_find(h, q->id);
if(!nqd->old) {
- GtkTreeIter iter[1];
if(after) {
/* Try to insert at the right sort of place */
GtkTreeIter where[1];
}
static void ql_scratch_completed(void attribute((unused)) *v,
- const char *error) {
- if(error)
- popup_protocol_error(0, error);
+ const char *err) {
+ if(err)
+ popup_protocol_error(0, err);
}
void ql_scratch_activate(GtkMenuItem attribute((unused)) *menuitem,
}
static void ql_remove_completed(void attribute((unused)) *v,
- const char *error) {
- if(error)
- popup_protocol_error(0, error);
+ const char *err) {
+ if(err)
+ popup_protocol_error(0, err);
}
static void ql_remove_activate_callback(GtkTreeModel *model,
&& gtk_tree_selection_count_selected_rows(ql->selection) > 0;
}
-static void ql_play_completed(void attribute((unused)) *v, const char *error) {
- if(error)
- popup_protocol_error(0, error);
+static void ql_play_completed(void attribute((unused)) *v, const char *err) {
+ if(err)
+ popup_protocol_error(0, err);
}
static void ql_play_activate_callback(GtkTreeModel *model,
}
struct tabtype *ql_tabtype(struct queuelike *ql) {
- static const struct tabtype ql_tabtype = {
+ static const struct tabtype queuelike_tabtype = {
ql_properties_sensitive,
ql_selectall_sensitive,
ql_selectnone_sensitive,
0
};
- ql->tabtype = ql_tabtype;
+ ql->tabtype = queuelike_tabtype;
ql->tabtype.extra = ql;
return &ql->tabtype;
}
/** @brief Update the queue itself */
static void queue_completed(void attribute((unused)) *v,
- const char *error,
+ const char *err,
struct queue_entry *q) {
- if(error) {
- popup_protocol_error(0, error);
+ if(err) {
+ popup_protocol_error(0, err);
return;
}
actual_queue = q;
/** @brief Update the playing track */
static void playing_completed(void attribute((unused)) *v,
- const char *error,
+ const char *err,
struct queue_entry *q) {
- if(error) {
- popup_protocol_error(0, error);
+ if(err) {
+ popup_protocol_error(0, err);
return;
}
actual_playing_track = q;
static int queue_drag_target = -1;
static void queue_move_completed(void attribute((unused)) *v,
- const char *error) {
- if(error) {
- popup_protocol_error(0, error);
+ const char *err) {
+ if(err) {
+ popup_protocol_error(0, err);
return;
}
/* The log should tell us the queue changed so we do no more here */
/** @brief Update the recently played list */
static void recent_completed(void attribute((unused)) *v,
- const char *error,
+ const char *err,
struct queue_entry *q) {
- if(error) {
- popup_protocol_error(0, error);
+ if(err) {
+ popup_protocol_error(0, err);
return;
}
/* The recent list is backwards compared to what we wanted */
* If users_deferred_select is set then that user is selected.
*/
static void users_got_list(void attribute((unused)) *v,
- const char *error,
+ const char *err,
int nvec, char **vec) {
int n;
GtkTreeIter iter;
- if(error) {
- popup_protocol_error(0, error);
+ if(err) {
+ popup_protocol_error(0, err);
return;
}
/* Present users in alphabetical order */
/** @brief Called when a user setting has been edited */
static void users_edituser_completed(void attribute((unused)) *v,
- const char *error) {
- if(error)
- popup_submsg(users_window, GTK_MESSAGE_ERROR, error);
+ const char *err) {
+ if(err)
+ popup_submsg(users_window, GTK_MESSAGE_ERROR, err);
}
/** @brief Called when a new user has been created */
static void users_adduser_completed(void *v,
- const char *error) {
- if(error) {
- popup_submsg(users_window, GTK_MESSAGE_ERROR, error);
+ const char *err) {
+ if(err) {
+ popup_submsg(users_window, GTK_MESSAGE_ERROR, err);
mode(ADD); /* Let the user try again */
} else {
const struct kvp *const kvp = v;
/** @brief Called when a user has been deleted */
static void users_delete_completed(void *v,
- const char *error) {
- if(error)
- popup_submsg(users_window, GTK_MESSAGE_ERROR, error);
+ const char *err) {
+ if(err)
+ popup_submsg(users_window, GTK_MESSAGE_ERROR, err);
else {
const struct kvp *const kvp = v;
const char *const user = kvp_get(kvp, "user");
}
static void users_got_email(void attribute((unused)) *v,
- const char *error,
+ const char *err,
const char *value) {
- if(error)
- popup_protocol_error(0, error);
+ if(err)
+ popup_protocol_error(0, err);
users_email = value;
}
static void users_got_rights(void attribute((unused)) *v,
- const char *error,
+ const char *err,
const char *value) {
- if(error)
- popup_protocol_error(0, error);
+ if(err)
+ popup_protocol_error(0, err);
users_rights = value;
}
static void users_got_password(void attribute((unused)) *v,
- const char *error,
+ const char *err,
const char *value) {
- if(error)
- popup_protocol_error(0, error);
+ if(err)
+ popup_protocol_error(0, err);
/* TODO if an error occurred gathering user info, we should react in some
* different way */
users_password = value;