Skip to content

Commit

Permalink
Trivial cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Contreras <[email protected]>
  • Loading branch information
felipec committed Oct 16, 2010
1 parent e03e9a5 commit a556f6a
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 161 deletions.
28 changes: 14 additions & 14 deletions control_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ save_credentials(void)
}

g_file_set_contents(file,
g_key_file_to_data(keyfile, NULL, NULL),
-1, NULL);
g_key_file_to_data(keyfile, NULL, NULL),
-1, NULL);
}

static void
on_dialog_response(GtkDialog *dialog,
gint id,
gpointer user_data)
gint id,
void *user_data)
{
if (id == GTK_RESPONSE_OK)
save_credentials();
Expand Down Expand Up @@ -117,8 +117,8 @@ build_service(struct service *service)
gtk_misc_set_alignment(GTK_MISC(label_password), 0.0, 0.5);
entry_password = hildon_entry_new(HILDON_SIZE_AUTO | HILDON_SIZE_FINGER_HEIGHT);
hildon_gtk_entry_set_input_mode(GTK_ENTRY(entry_password),
HILDON_GTK_INPUT_MODE_FULL |
HILDON_GTK_INPUT_MODE_INVISIBLE);
HILDON_GTK_INPUT_MODE_FULL |
HILDON_GTK_INPUT_MODE_INVISIBLE);

gtk_box_pack_start(GTK_BOX(hbox), label_password, TRUE, TRUE, 20);
gtk_box_pack_start(GTK_BOX(hbox), entry_password, TRUE, TRUE, 0);
Expand All @@ -132,17 +132,17 @@ build_service(struct service *service)
}

osso_return_t
execute(osso_context_t *osso, gpointer data, gboolean user_activated)
execute(osso_context_t *osso, void *data, gboolean user_activated)
{
GtkWidget *dialog;
GtkWidget *vbox;

dialog = gtk_dialog_new_with_buttons("Scrobbler settings",
GTK_WINDOW(data),
GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR,
dgettext("hildon-libs", "wdgt_bd_done"),
GTK_RESPONSE_OK,
NULL);
GTK_WINDOW(data),
GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR,
dgettext("hildon-libs", "wdgt_bd_done"),
GTK_RESPONSE_OK,
NULL);
vbox = gtk_vbox_new(TRUE, 0);

unsigned i;
Expand All @@ -155,7 +155,7 @@ execute(osso_context_t *osso, gpointer data, gboolean user_activated)
load_credentials();

gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
vbox);
vbox);

g_signal_connect(dialog, "response", G_CALLBACK(on_dialog_response), NULL);

Expand All @@ -165,7 +165,7 @@ execute(osso_context_t *osso, gpointer data, gboolean user_activated)
}

osso_return_t
save_state(osso_context_t *osso, gpointer data)
save_state(osso_context_t *osso, void *data)
{
return OSSO_OK;
}
66 changes: 33 additions & 33 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ void scrobbler_love(gboolean on)

static void
metadata_callback(MafwRenderer *self,
const gchar *object_id,
GHashTable *metadata,
gpointer user_data,
const GError *error)
const gchar *object_id,
GHashTable *metadata,
void *user_data,
const GError *error)
{
unsigned i;
if (skip_track) {
Expand All @@ -86,9 +86,9 @@ metadata_callback(MafwRenderer *self,

static void
metadata_changed_cb(MafwRenderer *renderer,
const gchar *name,
GValueArray *value_array,
gpointer data)
const gchar *name,
GValueArray *value_array,
void *data)
{
GValue *value = g_value_array_get_nth(value_array, 0);
if (strcmp(name, "artist") == 0) {
Expand Down Expand Up @@ -123,15 +123,15 @@ stop(void)

static void
state_changed_cb(MafwRenderer *renderer,
MafwPlayState state,
gpointer user_data)
MafwPlayState state,
void *user_data)
{
switch (state) {
case Playing:
track->timestamp = time(NULL);
mafw_renderer_get_current_metadata(renderer,
metadata_callback,
user_data);
metadata_callback,
user_data);
break;
case Stopped:
stop();
Expand All @@ -143,8 +143,8 @@ state_changed_cb(MafwRenderer *renderer,

static void
renderer_added_cb(MafwRegistry *registry,
GObject *renderer,
gpointer user_data)
GObject *renderer,
void *user_data)
{
const gchar *name;

Expand All @@ -157,18 +157,18 @@ renderer_added_cb(MafwRegistry *registry,
return;

g_signal_connect(renderer,
"state-changed",
G_CALLBACK(state_changed_cb),
user_data);
"state-changed",
G_CALLBACK(state_changed_cb),
user_data);
g_signal_connect(renderer,
"metadata-changed",
G_CALLBACK(metadata_changed_cb),
user_data);
"metadata-changed",
G_CALLBACK(metadata_changed_cb),
user_data);
}

static void error_cb(sr_session_t *s,
int fatal,
const char *msg)
int fatal,
const char *msg)
{
g_warning(msg);
}
Expand All @@ -184,8 +184,8 @@ static void session_key_cb(sr_session_t *s, const char *session_key)
struct service *service = s->user_data;
g_key_file_set_string(keyfile, service->id, "session-key", session_key);
g_file_set_contents(conf_file,
g_key_file_to_data(keyfile, NULL, NULL),
-1, NULL);
g_key_file_to_data(keyfile, NULL, NULL),
-1, NULL);
}

static gboolean
Expand Down Expand Up @@ -229,7 +229,7 @@ get_session(struct service *service)
sr_session_load_list(s, service->cache);
if (service->api_key)
sr_session_set_api(s, service->api_url,
service->api_key, service->api_secret);
service->api_key, service->api_secret);
service->session = s;
}

Expand All @@ -251,13 +251,13 @@ authenticate(void)

static void
conf_changed(GFileMonitor *monitor,
GFile *file,
GFile *other_file,
GFileMonitorEvent event_type,
gpointer user_data)
GFile *file,
GFile *other_file,
GFileMonitorEvent event_type,
void *user_data)
{
if (event_type == G_FILE_MONITOR_EVENT_CHANGED ||
event_type == G_FILE_MONITOR_EVENT_CREATED)
event_type == G_FILE_MONITOR_EVENT_CREATED)
authenticate();
}

Expand Down Expand Up @@ -312,8 +312,8 @@ check_proxy(ConIcConnection *connection)

static void
connection_event(ConIcConnection *connection,
ConIcConnectionEvent *event,
gpointer user_data)
ConIcConnectionEvent *event,
void *user_data)
{
ConIcConnectionStatus status;
status = con_ic_connection_event_get_status(event);
Expand Down Expand Up @@ -360,8 +360,8 @@ int main(void)
g_error("Failed to initialize the shared library");

g_signal_connect(registry,
"renderer-added",
G_CALLBACK(renderer_added_cb), NULL);
"renderer-added",
G_CALLBACK(renderer_added_cb), NULL);

dbus_system = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
dbus_connection_setup_with_g_main(dbus_system, NULL);
Expand Down
Loading

0 comments on commit a556f6a

Please sign in to comment.