summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-04-12 14:41:42 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-04-12 14:41:42 +0000
commit05a98f92cb9eeab843727e0fa2fc052cb371109a (patch)
tree30593b257e0e7045615ba71b95185561a6134539
parentba223a1a4d7cae2bba4ca0e2e55627a986175ace (diff)
tidy sources with GNU indent after recent changes. on seconds thoughts, don't install docs with autotools, leave it to the package manager.
-rw-r--r--src/Makefile.am3
-rw-r--r--src/base64.c2
-rw-r--r--src/dispatch.c3
-rw-r--r--src/requests.c3
-rw-r--r--src/torrent.c4
-rw-r--r--src/torrent.h4
-rw-r--r--src/trg-about-window.c15
-rw-r--r--src/trg-cell-renderer-epoch.c9
-rw-r--r--src/trg-client.c12
-rw-r--r--src/trg-files-model.c6
-rw-r--r--src/trg-main-window.c82
-rw-r--r--src/trg-menu-bar.c14
-rw-r--r--src/trg-peers-model.c2
-rw-r--r--src/trg-preferences-dialog.c28
-rw-r--r--src/trg-state-selector.c10
-rw-r--r--src/trg-status-bar.c10
-rw-r--r--src/trg-torrent-add-dialog.c15
-rw-r--r--src/trg-torrent-model.c81
-rw-r--r--src/trg-torrent-model.h5
-rw-r--r--src/trg-torrent-props-dialog.c6
-rw-r--r--src/trg-trackers-model.c3
-rw-r--r--src/trg-trackers-model.h2
-rw-r--r--src/util.c14
-rw-r--r--src/util.h9
24 files changed, 199 insertions, 143 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 13a02e7..229211f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -80,9 +80,6 @@ transmission_remote_gtk_LDFLAGS = -lm -lcurl $(jsonglib_LIBS) $(gtk_LIBS) $(gthr
install-data-local: install-icons update-icon-cache
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(srcdir)/$(schema_DATA)
- $(INSTALL_DATA) -D ../COPYING $(docdir)/COPYING
- $(INSTALL_DATA) ../AUTHORS $(docdir)/AUTHORS
- $(INSTALL_DATA) ../README $(docdir)/README
gtk_update_icon_cache = gtk-update-icon-cache -f -t
diff --git a/src/base64.c b/src/base64.c
index 40aa190..99e904f 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -57,7 +57,7 @@ char *base64encode(char *filename)
return NULL;
}
- b64out = g_base64_encode((guchar*) addr, sb.st_size);
+ b64out = g_base64_encode((guchar *) addr, sb.st_size);
munmap(addr, sb.st_size);
close(fd);
diff --git a/src/dispatch.c b/src/dispatch.c
index 12ada88..e102aed 100644
--- a/src/dispatch.c
+++ b/src/dispatch.c
@@ -91,7 +91,8 @@ GThread *dispatch_async(trg_client * client, JsonNode * req,
{
GError *error = NULL;
GThread *thread;
- struct dispatch_async_args *args = g_new(struct dispatch_async_args, 1);
+ struct dispatch_async_args *args =
+ g_new(struct dispatch_async_args, 1);
args->callback = callback;
args->data = data;
diff --git a/src/requests.c b/src/requests.c
index 4c841e4..bccf4f5 100644
--- a/src/requests.c
+++ b/src/requests.c
@@ -159,8 +159,7 @@ JsonNode *torrent_get(gboolean recent)
json_array_add_string_element(fields, FIELD_ERRORSTR);
json_array_add_string_element(fields, FIELD_WANTED);
json_array_add_string_element(fields, FIELD_PRIORITIES);
- json_object_set_array_member(args,
- PARAM_FIELDS, fields);
+ json_object_set_array_member(args, PARAM_FIELDS, fields);
return root;
}
diff --git a/src/torrent.c b/src/torrent.c
index 4c35e06..7c82df4 100644
--- a/src/torrent.c
+++ b/src/torrent.c
@@ -61,7 +61,7 @@ const gchar *torrent_get_name(JsonObject * t)
return json_object_get_string_member(t, FIELD_NAME);
}
-gint64 torrent_get_added_date(JsonObject *t)
+gint64 torrent_get_added_date(JsonObject * t)
{
return json_object_get_int_member(t, FIELD_ADDED_DATE);
}
@@ -265,7 +265,7 @@ const gchar *tracker_get_scrape(JsonObject * t)
return json_object_get_string_member(t, FIELD_SCRAPE);
}
-JsonArray *get_torrents_removed(JsonObject *response)
+JsonArray *get_torrents_removed(JsonObject * response)
{
if (G_UNLIKELY(json_object_has_member(response, FIELD_REMOVED)))
return json_object_get_array_member(response, FIELD_REMOVED);
diff --git a/src/torrent.h b/src/torrent.h
index 3376dd2..a80d420 100644
--- a/src/torrent.h
+++ b/src/torrent.h
@@ -64,7 +64,7 @@ gboolean torrent_get_is_finished(JsonObject * t);
gboolean torrent_get_honors_session_limits(JsonObject * t);
gint64 torrent_get_bandwidth_priority(JsonObject * t);
gint64 torrent_get_upload_limit(JsonObject * t);
-gint64 torrent_get_added_date(JsonObject *t);
+gint64 torrent_get_added_date(JsonObject * t);
gboolean torrent_get_upload_limited(JsonObject * t);
gint64 torrent_get_download_limit(JsonObject * t);
gboolean torrent_get_download_limited(JsonObject * t);
@@ -74,6 +74,6 @@ gint64 torrent_get_peer_limit(JsonObject * t);
gboolean torrent_has_tracker(JsonObject * t, GRegex * rx, gchar * search);
JsonArray *get_torrents(JsonObject * response);
-JsonArray *get_torrents_removed(JsonObject *response);
+JsonArray *get_torrents_removed(JsonObject * response);
#endif /* TORRENT_H_ */
diff --git a/src/trg-about-window.c b/src/trg-about-window.c
index 327d70b..2661183 100644
--- a/src/trg-about-window.c
+++ b/src/trg-about-window.c
@@ -52,7 +52,8 @@ GtkWidget *trg_about_window_new(GtkWindow * parent)
}
if (g_file_get_contents(TRGLICENSE, &licenseText, NULL, NULL)) {
- gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(dialog), licenseText);
+ gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(dialog),
+ licenseText);
} else {
gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(dialog), "GPL2");
}
@@ -72,13 +73,13 @@ GtkWidget *trg_about_window_new(GtkWindow * parent)
"http://code.google.com/p/transmission-remote-gtk/");
gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(dialog), trgAuthors);
- /*gtk_about_dialog_set_documenters(GTK_ABOUT_DIALOG(dialog), documenters);*/
+ /*gtk_about_dialog_set_documenters(GTK_ABOUT_DIALOG(dialog), documenters); */
gtk_about_dialog_set_translator_credits(GTK_ABOUT_DIALOG(dialog),
- "translations kindly contributed by\n\n"
- "* Julian Held (German)\n"
- "* Youn sok Choi (Korean)\n"
- "* Piotr (Polish)\n"
- "* Y3AVD (Russian)");
+ "translations kindly contributed by\n\n"
+ "* Julian Held (German)\n"
+ "* Youn sok Choi (Korean)\n"
+ "* Piotr (Polish)\n"
+ "* Y3AVD (Russian)");
g_free(licenseText);
diff --git a/src/trg-cell-renderer-epoch.c b/src/trg-cell-renderer-epoch.c
index 28e2d5c..dfe818b 100644
--- a/src/trg-cell-renderer-epoch.c
+++ b/src/trg-cell-renderer-epoch.c
@@ -40,7 +40,7 @@ struct _TrgCellRendererEpochPrivate {
static void
trg_cell_renderer_epoch_get_property(GObject * object, guint property_id,
- GValue * value, GParamSpec * pspec)
+ GValue * value, GParamSpec * pspec)
{
TrgCellRendererEpochPrivate *priv =
TRG_CELL_RENDERER_EPOCH_GET_PRIVATE(object);
@@ -55,8 +55,8 @@ trg_cell_renderer_epoch_get_property(GObject * object, guint property_id,
static void
trg_cell_renderer_epoch_set_property(GObject * object, guint property_id,
- const GValue * value,
- GParamSpec * pspec)
+ const GValue * value,
+ GParamSpec * pspec)
{
TrgCellRendererEpochPrivate *priv =
TRG_CELL_RENDERER_EPOCH_GET_PRIVATE(object);
@@ -111,5 +111,6 @@ trg_cell_renderer_epoch_init(TrgCellRendererEpoch * self G_GNUC_UNUSED)
GtkCellRenderer *trg_cell_renderer_epoch_new(void)
{
return
- GTK_CELL_RENDERER(g_object_new(TRG_TYPE_CELL_RENDERER_EPOCH, NULL));
+ GTK_CELL_RENDERER(g_object_new
+ (TRG_TYPE_CELL_RENDERER_EPOCH, NULL));
}
diff --git a/src/trg-client.c b/src/trg-client.c
index d2e0cf3..14f9041 100644
--- a/src/trg-client.c
+++ b/src/trg-client.c
@@ -45,7 +45,9 @@ trg_client *trg_init_client()
client = g_new0(trg_client, 1);
client->gconf = gconf_client_get_default();
client->updateMutex = g_mutex_new();
- client->activeOnlyUpdate = gconf_client_get_bool(client->gconf, TRG_GCONF_KEY_UPDATE_ACTIVE_ONLY, NULL);
+ client->activeOnlyUpdate =
+ gconf_client_get_bool(client->gconf,
+ TRG_GCONF_KEY_UPDATE_ACTIVE_ONLY, NULL);
return client;
}
@@ -80,7 +82,9 @@ int trg_client_populate_with_settings(trg_client * tc, GConfClient * gconf)
g_free(tc->password);
tc->password = NULL;
- port = gconf_client_get_int_or_default(gconf, TRG_GCONF_KEY_PORT, TRG_PORT_DEFAULT, &error);
+ port =
+ gconf_client_get_int_or_default(gconf, TRG_GCONF_KEY_PORT,
+ TRG_PORT_DEFAULT, &error);
check_for_error(error);
host = gconf_client_get_string(gconf, TRG_GCONF_KEY_HOSTNAME, &error);
@@ -97,7 +101,9 @@ int trg_client_populate_with_settings(trg_client * tc, GConfClient * gconf)
g_free(host);
tc->interval =
- gconf_client_get_int_or_default(gconf, TRG_GCONF_KEY_UPDATE_INTERVAL, TRG_INTERVAL_DEFAULT, &error);
+ gconf_client_get_int_or_default(gconf,
+ TRG_GCONF_KEY_UPDATE_INTERVAL,
+ TRG_INTERVAL_DEFAULT, &error);
check_for_error(error);
if (tc->interval < 1)
tc->interval = TRG_INTERVAL_DEFAULT;
diff --git a/src/trg-files-model.c b/src/trg-files-model.c
index ccc4757..66feec6 100644
--- a/src/trg-files-model.c
+++ b/src/trg-files-model.c
@@ -144,9 +144,9 @@ trg_files_model_update(TrgFilesModel * model, gint64 updateSerial,
if (mode == TORRENT_GET_MODE_FIRST) {
gtk_list_store_clear(GTK_LIST_STORE(model));
priv->accept = TRUE;
- for (li = json_array_get_elements(priv->files); li; li = g_list_next(li)) {
- JsonObject *file =
- json_node_get_object((JsonNode*)li->data);
+ for (li = json_array_get_elements(priv->files); li;
+ li = g_list_next(li)) {
+ JsonObject *file = json_node_get_object((JsonNode *) li->data);
GtkTreeIter filesIter;
trg_files_model_iter_new(model, &filesIter, file, j);
trg_files_model_iter_update(model, &filesIter,
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index b444237..fce8a11 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -69,7 +69,8 @@
#include "trg-remote-prefs-dialog.h"
#include "trg-preferences-dialog.h"
-static gboolean update_selected_torrent_notebook(TrgMainWindow * win, gint mode);
+static gboolean update_selected_torrent_notebook(TrgMainWindow * win,
+ gint mode);
static void torrent_event_notification(TrgTorrentModel * model,
gchar * icon, gchar * desc,
gint tmout, gchar * prefKey,
@@ -119,7 +120,8 @@ static void on_torrent_get(JsonObject * response,
int mode, int status, gpointer data);
static void on_torrent_get_first(JsonObject * response, int status,
gpointer data);
-static void on_torrent_get_active(JsonObject *response, int status, gpointer data);
+static void on_torrent_get_active(JsonObject * response, int status,
+ gpointer data);
static void on_torrent_get_update(JsonObject * response, int status,
gpointer data);
static void on_torrent_get_interactive(JsonObject * response, int status,
@@ -127,7 +129,8 @@ static void on_torrent_get_interactive(JsonObject * response, int status,
static gboolean trg_update_torrents_timerfunc(gpointer data);
static void trg_main_window_update_notebook_displays(TrgMainWindow * win,
JsonObject * t,
- GtkTreeIter * iter, gint mode);
+ GtkTreeIter * iter,
+ gint mode);
static void open_about_cb(GtkWidget * w, GtkWindow * parent);
static gboolean trg_torrent_tree_view_visible_func(GtkTreeModel * model,
GtkTreeIter * iter,
@@ -241,7 +244,8 @@ static void trg_main_window_init(TrgMainWindow * self G_GNUC_UNUSED)
{
}
-static gboolean update_selected_torrent_notebook(TrgMainWindow * win, gint mode)
+static gboolean update_selected_torrent_notebook(TrgMainWindow * win,
+ gint mode)
{
TrgMainWindowPrivate *priv;
GtkTreeIter iter;
@@ -417,9 +421,9 @@ gboolean trg_add_from_filename(TrgMainWindow * win, gchar * fileName)
gtk_widget_show_all(GTK_WIDGET(dialog));
} else {
- JsonNode *torrentAddReq =
- torrent_add(fileName,
- pref_get_start_paused(priv->client->gconf));
+ JsonNode *torrentAddReq = torrent_add(fileName,
+ pref_get_start_paused
+ (priv->client->gconf));
dispatch_async(priv->client, torrentAddReq,
on_generic_interactive_action, win);
g_free(fileName);
@@ -433,7 +437,7 @@ gboolean trg_add_from_filename(TrgMainWindow * win, gchar * fileName)
return FALSE;
}
-static void resume_all_cb(GtkWidget *w G_GNUC_UNUSED, gpointer data)
+static void resume_all_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data)
{
TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
@@ -847,14 +851,17 @@ static void on_session_get(JsonObject * response, int status,
if (!client->session) {
float version;
- if (session_get_version(newSession, &version))
- {
+ if (session_get_version(newSession, &version)) {
if (version < TRANSMISSION_MIN_SUPPORTED) {
- gchar *msg = g_strdup_printf(_("This application supports Transmission %.2f and later, you have %.2f."), TRANSMISSION_MIN_SUPPORTED, version);
+ gchar *msg =
+ g_strdup_printf(_
+ ("This application supports Transmission %.2f and later, you have %.2f."),
+ TRANSMISSION_MIN_SUPPORTED, version);
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK, "%s", msg);
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ "%s", msg);
gtk_window_set_title(GTK_WINDOW(dialog), _("Error"));
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
@@ -865,13 +872,14 @@ static void on_session_get(JsonObject * response, int status,
trg_status_bar_connect(priv->statusBar, newSession);
trg_main_window_conn_changed(win, TRUE);
- dispatch_async(client, torrent_get(FALSE), on_torrent_get_first, data);
+ dispatch_async(client, torrent_get(FALSE), on_torrent_get_first,
+ data);
}
trg_client_set_session(client, newSession);
trg_trackers_tree_view_new_connection(priv->trackersTreeView, client);
-out:
+ out:
gdk_threads_leave();
json_object_ref(newSession);
response_unref(response);
@@ -951,7 +959,7 @@ on_torrent_get(JsonObject * response, int mode, int status, gpointer data)
}
static void
-on_torrent_get_active(JsonObject *response, int status, gpointer data)
+on_torrent_get_active(JsonObject * response, int status, gpointer data)
{
on_torrent_get(response, TORRENT_GET_MODE_ACTIVE, status, data);
}
@@ -979,9 +987,11 @@ static gboolean trg_update_torrents_timerfunc(gpointer data)
TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
if (priv->client->session)
- dispatch_async(priv->client, torrent_get(priv->client->activeOnlyUpdate),
- priv->client->activeOnlyUpdate ? on_torrent_get_active : on_torrent_get_update,
- data);
+ dispatch_async(priv->client,
+ torrent_get(priv->client->activeOnlyUpdate),
+ priv->client->
+ activeOnlyUpdate ? on_torrent_get_active :
+ on_torrent_get_update, data);
return FALSE;
}
@@ -996,11 +1006,11 @@ trg_main_window_update_notebook_displays(TrgMainWindow * win,
trg_general_panel_update(priv->genDetails, t, iter);
trg_trackers_model_update(priv->trackersModel, client->updateSerial, t,
- mode);
+ mode);
trg_files_model_update(priv->filesModel, client->updateSerial, t,
- mode);
+ mode);
trg_peers_model_update(priv->peersModel, client->updateSerial, t,
- mode);
+ mode);
}
static void open_about_cb(GtkWidget * w G_GNUC_UNUSED, GtkWindow * parent)
@@ -1124,7 +1134,8 @@ torrent_selection_changed(GtkWidget * w G_GNUC_UNUSED, gpointer data)
{
TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
TrgMainWindow *win = TRG_MAIN_WINDOW(data);
- gboolean isSelected = update_selected_torrent_notebook(win, TORRENT_GET_MODE_FIRST);
+ gboolean isSelected =
+ update_selected_torrent_notebook(win, TORRENT_GET_MODE_FIRST);
trg_toolbar_torrent_actions_sensitive(priv->toolBar, isSelected);
trg_menu_bar_torrent_actions_sensitive(priv->menuBar, isSelected);
@@ -1295,9 +1306,11 @@ static TrgMenuBar *trg_main_window_menu_bar_new(TrgMainWindow * win)
g_signal_connect(b_add, "activate", G_CALLBACK(add_cb), win);
g_signal_connect(b_add_url, "activate", G_CALLBACK(add_url_cb), win);
g_signal_connect(b_resume, "activate", G_CALLBACK(resume_cb), win);
- g_signal_connect(b_resume_all, "activate", G_CALLBACK(resume_all_cb), win);
+ g_signal_connect(b_resume_all, "activate", G_CALLBACK(resume_all_cb),
+ win);
g_signal_connect(b_pause, "activate", G_CALLBACK(pause_cb), win);
- g_signal_connect(b_pause_all, "activate", G_CALLBACK(pause_all_cb), win);
+ g_signal_connect(b_pause_all, "activate", G_CALLBACK(pause_all_cb),
+ win);
g_signal_connect(b_verify, "activate", G_CALLBACK(verify_cb), win);
g_signal_connect(b_reannounce, "activate", G_CALLBACK(reannounce_cb),
win);
@@ -1393,7 +1406,7 @@ static void set_limit_cb(GtkWidget * w, gpointer data)
if (limitIds)
dispatch_async(priv->client, req, on_generic_interactive_action,
- data);
+ data);
else
dispatch_async(priv->client, req, on_session_set, data);
}
@@ -1405,15 +1418,16 @@ static GtkWidget *limit_item_new(TrgMainWindow * win, GtkWidget * menu,
GtkWidget *item;
gboolean active = limit < 0 ? FALSE : (currentLimit == (gint64) limit);
- if (limit >= 1000)
- g_snprintf(speed, sizeof(speed), "%.2f MB/s", limit / 1000);
- else
- g_snprintf(speed, sizeof(speed), "%.0f KB/s", limit);
+ if (limit >= 1000)
+ g_snprintf(speed, sizeof(speed), "%.2f MB/s", limit / 1000);
+ else
+ g_snprintf(speed, sizeof(speed), "%.0f KB/s", limit);
item = gtk_check_menu_item_new_with_label(speed);
- /* Yeah, I know it's unsafe to cast from a float to an int, but its safe here */
- g_object_set_data(G_OBJECT(item), "limit", GINT_TO_POINTER((gint)limit));
+ /* Yeah, I know it's unsafe to cast from a float to an int, but its safe here */
+ g_object_set_data(G_OBJECT(item), "limit",
+ GINT_TO_POINTER((gint) limit));
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), active);
g_signal_connect(item, "activate", G_CALLBACK(set_limit_cb), win);
@@ -1434,7 +1448,7 @@ static GtkWidget *limit_menu_new(TrgMainWindow * win, gchar * title,
if (ids)
get_first_selected(priv->client, priv->torrentTreeView, &iter,
- &current);
+ &current);
else
current = priv->client->session;
diff --git a/src/trg-menu-bar.c b/src/trg-menu-bar.c
index b86b0c7..7efa149 100644
--- a/src/trg-menu-bar.c
+++ b/src/trg-menu-bar.c
@@ -324,11 +324,13 @@ GtkWidget *trg_menu_bar_torrent_menu_new(TrgMenuBarPrivate * priv)
_("Remove and Delete"), GTK_STOCK_DELETE,
FALSE);
- gtk_menu_shell_append(GTK_MENU_SHELL(torrentMenu), gtk_separator_menu_item_new());
+ gtk_menu_shell_append(GTK_MENU_SHELL(torrentMenu),
+ gtk_separator_menu_item_new());
priv->mb_resume_all =
- trg_menu_bar_item_new(GTK_MENU_SHELL(torrentMenu), _("_Resume All"),
- GTK_STOCK_MEDIA_PLAY, FALSE);
+ trg_menu_bar_item_new(GTK_MENU_SHELL(torrentMenu),
+ _("_Resume All"), GTK_STOCK_MEDIA_PLAY,
+ FALSE);
priv->mb_pause_all =
trg_menu_bar_item_new(GTK_MENU_SHELL(torrentMenu), _("_Pause All"),
GTK_STOCK_MEDIA_PAUSE, FALSE);
@@ -379,14 +381,16 @@ static void trg_menu_bar_class_init(TrgMenuBarClass * klass)
trg_menu_bar_install_widget_prop(object_class, PROP_RESUME_BUTTON,
"resume-button", "Resume Button");
trg_menu_bar_install_widget_prop(object_class, PROP_RESUME_ALL_BUTTON,
- "resume-all-button", "Resume All Button");
+ "resume-all-button",
+ "Resume All Button");
trg_menu_bar_install_widget_prop(object_class, PROP_VERIFY_BUTTON,
"verify-button", "Verify Button");
trg_menu_bar_install_widget_prop(object_class, PROP_REANNOUNCE_BUTTON,
"reannounce-button",
"Re-announce Button");
trg_menu_bar_install_widget_prop(object_class, PROP_PAUSE_ALL_BUTTON,
- "pause-all-button", "Pause All Button");
+ "pause-all-button",
+ "Pause All Button");
trg_menu_bar_install_widget_prop(object_class, PROP_PAUSE_BUTTON,
"pause-button", "Pause Button");
trg_menu_bar_install_widget_prop(object_class, PROP_PROPS_BUTTON,
diff --git a/src/trg-peers-model.c b/src/trg-peers-model.c
index a96b44f..566685b 100644
--- a/src/trg-peers-model.c
+++ b/src/trg-peers-model.c
@@ -141,7 +141,7 @@ void trg_peers_model_update(TrgPeersModel * model, gint64 updateSerial,
gtk_list_store_clear(GTK_LIST_STORE(model));
for (li = json_array_get_elements(peers); li; li = g_list_next(li)) {
- JsonObject *peer = json_node_get_object((JsonNode*)li->data);
+ JsonObject *peer = json_node_get_object((JsonNode *) li->data);
const gchar *address = NULL, *flagStr;
#ifdef HAVE_GEOIP
const gchar *country = NULL;
diff --git a/src/trg-preferences-dialog.c b/src/trg-preferences-dialog.c
index 0563949..41548b8 100644
--- a/src/trg-preferences-dialog.c
+++ b/src/trg-preferences-dialog.c
@@ -101,9 +101,9 @@ trg_preferences_dialog_get_property(GObject * object,
}
}
-static void update_activeonly_cb(GtkToggleButton *w, gpointer data)
+static void update_activeonly_cb(GtkToggleButton * w, gpointer data)
{
- trg_client *client = (trg_client*)data;
+ trg_client *client = (trg_client *) data;
client->activeOnlyUpdate = gtk_toggle_button_get_active(w);
}
@@ -147,7 +147,7 @@ static void spun_cb_int(GtkWidget * widget, gpointer gconf)
}
static GtkWidget *new_spin_button(GConfClient * gconf,
- const gchar *key,
+ const gchar * key,
int low, int high, int step, int deflt)
{
GtkWidget *w;
@@ -159,7 +159,8 @@ static GtkWidget *new_spin_button(GConfClient * gconf,
gtk_spin_button_set_digits(GTK_SPIN_BUTTON(w), 0);
- currentValue = gconf_client_get_int_or_default(gconf, key, deflt, NULL);
+ currentValue =
+ gconf_client_get_int_or_default(gconf, key, deflt, NULL);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), currentValue);
@@ -230,7 +231,7 @@ static void toggle_tray_icon(GtkToggleButton * w, gpointer win)
trg_main_window_remove_status_icon(TRG_MAIN_WINDOW(win));
}
-static GtkWidget *trg_prefs_desktopPage(trg_client *client,
+static GtkWidget *trg_prefs_desktopPage(trg_client * client,
TrgMainWindow * win)
{
GtkWidget *tray, *w, *t;
@@ -297,7 +298,7 @@ static GtkWidget *trg_prefs_desktopPage(trg_client *client,
return t;
}
-static GtkWidget *trg_prefs_behaviorPage(trg_client *client)
+static GtkWidget *trg_prefs_behaviorPage(trg_client * client)
{
GtkWidget *w, *t;
gint row = 0;
@@ -331,7 +332,8 @@ static GtkWidget *trg_prefs_serverPage(trg_client * client)
w = new_entry(gconf, TRG_GCONF_KEY_HOSTNAME);
hig_workarea_add_row(t, &row, _("Host:"), w, NULL);
- w = new_spin_button(gconf, TRG_GCONF_KEY_PORT, 1, 65535, 1, TRG_PORT_DEFAULT);
+ w = new_spin_button(gconf, TRG_GCONF_KEY_PORT, 1, 65535, 1,
+ TRG_PORT_DEFAULT);
hig_workarea_add_row(t, &row, _("Port:"), w, NULL);
w = new_check_button(gconf, _("Automatically connect"),
@@ -341,13 +343,16 @@ static GtkWidget *trg_prefs_serverPage(trg_client * client)
w = new_check_button(gconf, _("SSL"), TRG_GCONF_KEY_SSL);
hig_workarea_add_wide_control(t, &row, w);
- w = new_spin_button(gconf, TRG_GCONF_KEY_UPDATE_INTERVAL, 1, 60, 1, TRG_INTERVAL_DEFAULT);
+ w = new_spin_button(gconf, TRG_GCONF_KEY_UPDATE_INTERVAL, 1, 60, 1,
+ TRG_INTERVAL_DEFAULT);
g_signal_connect(w, "value-changed", G_CALLBACK(interval_changed_cb),
client);
hig_workarea_add_row(t, &row, _("Update interval:"), w, NULL);
- w = new_check_button(gconf, _("Update active torrents only"), TRG_GCONF_KEY_UPDATE_ACTIVE_ONLY);
- g_signal_connect(w, "toggled", G_CALLBACK(update_activeonly_cb), client);
+ w = new_check_button(gconf, _("Update active torrents only"),
+ TRG_GCONF_KEY_UPDATE_ACTIVE_ONLY);
+ g_signal_connect(w, "toggled", G_CALLBACK(update_activeonly_cb),
+ client);
hig_workarea_add_wide_control(t, &row, w);
hig_workarea_add_section_divider(t, &row);
@@ -399,7 +404,8 @@ static GObject *trg_preferences_dialog_constructor(GType type,
gtk_label_new(_("Connection")));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
- trg_prefs_desktopPage(priv->client, priv->win),
+ trg_prefs_desktopPage(priv->client,
+ priv->win),
gtk_label_new(_("Desktop")));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
diff --git a/src/trg-state-selector.c b/src/trg-state-selector.c
index 8a6c4bc..944a356 100644
--- a/src/trg-state-selector.c
+++ b/src/trg-state-selector.c
@@ -226,7 +226,7 @@ void trg_state_selector_update(TrgStateSelector * s)
return;
for (li = torrentItemRefs; li; li = g_list_next(li)) {
- GtkTreeRowReference *rr = (GtkTreeRowReference*)li->data;
+ GtkTreeRowReference *rr = (GtkTreeRowReference *) li->data;
GtkTreePath *path = gtk_tree_row_reference_get_path(rr);
GtkTreeModel *torrentModel = gtk_tree_row_reference_get_model(rr);
JsonObject *t = NULL;
@@ -235,7 +235,8 @@ void trg_state_selector_update(TrgStateSelector * s)
if (path) {
GtkTreeIter iter;
if (gtk_tree_model_get_iter(torrentModel, &iter, path)) {
- gtk_tree_model_get(torrentModel, &iter, TORRENT_COLUMN_JSON, &t, -1);
+ gtk_tree_model_get(torrentModel, &iter,
+ TORRENT_COLUMN_JSON, &t, -1);
}
gtk_tree_path_free(path);
}
@@ -246,9 +247,10 @@ void trg_state_selector_update(TrgStateSelector * s)
if (priv->showTrackers) {
JsonArray *trackers = torrent_get_trackers(t);
- for (trackerItem = json_array_get_elements(trackers); trackerItem; trackerItem = g_list_next(trackerItem)) {
+ for (trackerItem = json_array_get_elements(trackers);
+ trackerItem; trackerItem = g_list_next(trackerItem)) {
JsonObject *tracker =
- json_node_get_object((JsonNode*)trackerItem->data);
+ json_node_get_object((JsonNode *) trackerItem->data);
const gchar *announceUrl = tracker_get_announce(tracker);
gchar *announceHost =
trg_gregex_get_first(priv->urlHostRegex, announceUrl);
diff --git a/src/trg-status-bar.c b/src/trg-status-bar.c
index 4cae5df..c5a0ca1 100644
--- a/src/trg-status-bar.c
+++ b/src/trg-status-bar.c
@@ -92,11 +92,11 @@ void trg_status_bar_update(TrgStatusBar * sb,
statusBarUpdate =
g_strdup_printf
- (ngettext("%d torrent .. Down %s, Up %s .. %d seeding, %d downloading, %d paused",
- "%d torrents .. Down %s, Up %s .. %d seeding, %d downloading, %d paused",
- stats->count),
- stats->count, downRateTotalString, upRateTotalString,
- stats->seeding, stats->down, stats->paused);
+ (ngettext
+ ("%d torrent .. Down %s, Up %s .. %d seeding, %d downloading, %d paused",
+ "%d torrents .. Down %s, Up %s .. %d seeding, %d downloading, %d paused",
+ stats->count), stats->count, downRateTotalString,
+ upRateTotalString, stats->seeding, stats->down, stats->paused);
gtk_statusbar_pop(GTK_STATUSBAR(sb), priv->countSpeedsCtx);
gtk_statusbar_push(GTK_STATUSBAR(sb),
priv->countSpeedsCtx, statusBarUpdate);
diff --git a/src/trg-torrent-add-dialog.c b/src/trg-torrent-add-dialog.c
index cf2c83a..3c0ffc9 100644
--- a/src/trg-torrent-add-dialog.c
+++ b/src/trg-torrent-add-dialog.c
@@ -187,7 +187,8 @@ static gchar *trg_destination_folder_get(GtkComboBox * box)
static GtkWidget *trg_destination_folder_new(trg_client * client)
{
- const gchar *defaultDownDir = json_object_get_string_member(client->session, SGET_DOWNLOAD_DIR);
+ const gchar *defaultDownDir =
+ json_object_get_string_member(client->session, SGET_DOWNLOAD_DIR);
GtkWidget *combo = gtk_combo_box_entry_new_text();
GSList *dirs = NULL;
GSList *sli;
@@ -204,7 +205,7 @@ static GtkWidget *trg_destination_folder_new(trg_client * client)
g_mutex_lock(client->updateMutex);
torrentItemRefs = g_hash_table_get_values(client->torrentTable);
for (li = torrentItemRefs; li; li = g_list_next(li)) {
- rr = (GtkTreeRowReference*)li->data;
+ rr = (GtkTreeRowReference *) li->data;
model = gtk_tree_row_reference_get_model(rr);
path = gtk_tree_row_reference_get_path(rr);
@@ -212,7 +213,8 @@ static GtkWidget *trg_destination_folder_new(trg_client * client)
GtkTreeIter iter;
if (gtk_tree_model_get_iter(model, &iter, path)) {
const gchar *dd;
- gtk_tree_model_get(model, &iter, TORRENT_COLUMN_JSON, &t, -1);
+ gtk_tree_model_get(model, &iter, TORRENT_COLUMN_JSON, &t,
+ -1);
dd = torrent_get_download_dir(t);
if (dd)
g_slist_str_set_add(&dirs, dd);
@@ -225,7 +227,8 @@ static GtkWidget *trg_destination_folder_new(trg_client * client)
g_mutex_unlock(client->updateMutex);
for (sli = dirs; sli != NULL; sli = g_slist_next(sli))
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), (gchar*)sli->data);
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo),
+ (gchar *) sli->data);
gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
g_str_slist_free(dirs);
@@ -882,8 +885,8 @@ static GObject *trg_torrent_add_dialog_constructor(GType type,
priv->paused_check =
gtk_check_button_new_with_mnemonic(_("Start _paused"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->paused_check),
- pref_get_start_paused(priv->
- client->gconf));
+ pref_get_start_paused(priv->client->
+ gconf));
priv->priority_combo = gtr_priority_combo_new();
gtk_combo_box_set_active(GTK_COMBO_BOX(priv->priority_combo), 1);
diff --git a/src/trg-torrent-model.c b/src/trg-torrent-model.c
index 12da8de..b5c384d 100644
--- a/src/trg-torrent-model.c
+++ b/src/trg-torrent-model.c
@@ -40,22 +40,19 @@ enum {
static guint signals[TMODEL_SIGNAL_COUNT] = { 0 };
G_DEFINE_TYPE(TrgTorrentModel, trg_torrent_model, GTK_TYPE_LIST_STORE)
-
#define TRG_TORRENT_MODEL_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), TRG_TYPE_TORRENT_MODEL, TrgTorrentModelPrivate))
-
typedef struct _TrgTorrentModelPrivate TrgTorrentModelPrivate;
struct _TrgTorrentModelPrivate {
GHashTable *ht;
};
-static void
-trg_torrent_model_dispose (GObject *object)
+static void trg_torrent_model_dispose(GObject * object)
{
TrgTorrentModelPrivate *priv = TRG_TORRENT_MODEL_GET_PRIVATE(object);
g_hash_table_destroy(priv->ht);
- G_OBJECT_CLASS (trg_torrent_model_parent_class)->dispose (object);
+ G_OBJECT_CLASS(trg_torrent_model_parent_class)->dispose(object);
}
static guint32 torrent_get_flags(JsonObject * t, gint64 status);
@@ -114,7 +111,7 @@ static void trg_torrent_model_count_peers(TrgTorrentModel * model,
leechers = 0;
for (li = json_array_get_elements(peers); li; li = g_list_next(li)) {
- JsonObject *peer = json_node_get_object((JsonNode*)li->data);
+ JsonObject *peer = json_node_get_object((JsonNode *) li->data);
if (peer_get_is_downloading_from(peer))
seeders++;
@@ -130,7 +127,7 @@ static void trg_torrent_model_count_peers(TrgTorrentModel * model,
static void trg_torrent_model_ref_free(gpointer data)
{
- GtkTreeRowReference *rr = (GtkTreeRowReference*)data;
+ GtkTreeRowReference *rr = (GtkTreeRowReference *) data;
GtkTreeModel *model = gtk_tree_row_reference_get_model(rr);
GtkTreePath *path = gtk_tree_row_reference_get_path(rr);
if (path) {
@@ -172,7 +169,10 @@ static void trg_torrent_model_init(TrgTorrentModel * self)
gtk_list_store_set_column_types(GTK_LIST_STORE(self),
TORRENT_COLUMN_COLUMNS, column_types);
- priv->ht = g_hash_table_new_full(g_int64_hash, g_int64_equal, (GDestroyNotify)g_free, trg_torrent_model_ref_free);
+ priv->ht =
+ g_hash_table_new_full(g_int64_hash, g_int64_equal,
+ (GDestroyNotify) g_free,
+ trg_torrent_model_ref_free);
}
static guint32 torrent_get_flags(JsonObject * t, gint64 status)
@@ -210,10 +210,12 @@ static guint32 torrent_get_flags(JsonObject * t, gint64 status)
static gboolean
trg_torrent_model_stats_scan_foreachfunc(GtkTreeModel * model,
- GtkTreePath * path G_GNUC_UNUSED,
- GtkTreeIter * iter, gpointer gdata)
+ GtkTreePath * path G_GNUC_UNUSED,
+ GtkTreeIter * iter,
+ gpointer gdata)
{
- trg_torrent_model_update_stats *stats = (trg_torrent_model_update_stats*)gdata;
+ trg_torrent_model_update_stats *stats =
+ (trg_torrent_model_update_stats *) gdata;
guint flags;
gtk_tree_model_get(model, iter, TORRENT_COLUMN_FLAGS, &flags, -1);
if (flags & TORRENT_FLAG_SEEDING)
@@ -225,9 +227,12 @@ trg_torrent_model_stats_scan_foreachfunc(GtkTreeModel * model,
return FALSE;
}
-void trg_torrent_model_stats_scan(TrgTorrentModel *model, trg_torrent_model_update_stats *stats)
+void trg_torrent_model_stats_scan(TrgTorrentModel * model,
+ trg_torrent_model_update_stats * stats)
{
- gtk_tree_model_foreach(GTK_TREE_MODEL(model), trg_torrent_model_stats_scan_foreachfunc, stats);
+ gtk_tree_model_foreach(GTK_TREE_MODEL(model),
+ trg_torrent_model_stats_scan_foreachfunc,
+ stats);
}
static void
@@ -298,7 +303,8 @@ update_torrent_iter(TrgTorrentModel * model, gint64 serial,
gtk_list_store_set(GTK_LIST_STORE(model), iter,
TORRENT_COLUMN_UPDATESERIAL, serial, -1);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_ADDED, torrent_get_added_date(t), -1);
+ TORRENT_COLUMN_ADDED, torrent_get_added_date(t),
+ -1);
#else
gtk_list_store_set(GTK_LIST_STORE(model), iter,
TORRENT_COLUMN_ICON, statusIcon,
@@ -346,7 +352,7 @@ struct TrgModelRemoveData {
gint64 currentSerial;
};
-GHashTable *get_torrent_table(TrgTorrentModel *model)
+GHashTable *get_torrent_table(TrgTorrentModel * model)
{
TrgTorrentModelPrivate *priv = TRG_TORRENT_MODEL_GET_PRIVATE(model);
return priv->ht;
@@ -354,31 +360,31 @@ GHashTable *get_torrent_table(TrgTorrentModel *model)
gboolean
trg_model_find_removed_foreachfunc(GtkTreeModel * model,
- GtkTreePath * path G_GNUC_UNUSED,
- GtkTreeIter * iter, gpointer gdata)
+ GtkTreePath * path G_GNUC_UNUSED,
+ GtkTreeIter * iter, gpointer gdata)
{
- struct TrgModelRemoveData *args = (struct TrgModelRemoveData *)gdata;
+ struct TrgModelRemoveData *args = (struct TrgModelRemoveData *) gdata;
gint64 rowSerial;
- gtk_tree_model_get(model, iter, TORRENT_COLUMN_UPDATESERIAL, &rowSerial, -1);
+ gtk_tree_model_get(model, iter, TORRENT_COLUMN_UPDATESERIAL,
+ &rowSerial, -1);
if (rowSerial != args->currentSerial) {
gint64 *id = g_new(gint64, 1);
gtk_tree_model_get(model, iter, TORRENT_COLUMN_ID, id, -1);
- args->toRemove =
- g_list_append(args->toRemove, id);
+ args->toRemove = g_list_append(args->toRemove, id);
}
return FALSE;
}
GList *trg_torrent_model_find_removed(GtkTreeModel * model,
- gint64 currentSerial)
+ gint64 currentSerial)
{
struct TrgModelRemoveData args;
args.toRemove = NULL;
args.currentSerial = currentSerial;
gtk_tree_model_foreach(GTK_TREE_MODEL(model),
- trg_model_find_removed_foreachfunc, &args);
+ trg_model_find_removed_foreachfunc, &args);
return args.toRemove;
}
@@ -405,11 +411,15 @@ void trg_torrent_model_update(TrgTorrentModel * model, trg_client * tc,
args = get_arguments(response);
newTorrents = get_torrents(args);
- for (li = json_array_get_elements(newTorrents); li; li = g_list_next(li)) {
- t = json_node_get_object((JsonNode*)li->data);
+ for (li = json_array_get_elements(newTorrents); li;
+ li = g_list_next(li)) {
+ t = json_node_get_object((JsonNode *) li->data);
id = torrent_get_id(t);
- result = mode == TORRENT_GET_MODE_FIRST ? NULL : g_hash_table_lookup(priv->ht, &id);
+ result =
+ mode ==
+ TORRENT_GET_MODE_FIRST ? NULL : g_hash_table_lookup(priv->ht,
+ &id);
if (!result) {
gtk_list_store_append(GTK_LIST_STORE(model), &iter);
@@ -427,10 +437,14 @@ void trg_torrent_model_update(TrgTorrentModel * model, trg_client * tc,
g_signal_emit(model, signals[TMODEL_TORRENT_ADDED], 0,
&iter);
} else {
- path = gtk_tree_row_reference_get_path((GtkTreeRowReference*)result);
+ path =
+ gtk_tree_row_reference_get_path((GtkTreeRowReference *)
+ result);
if (path) {
- if (gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path)) {
- update_torrent_iter(model, tc->updateSerial, &iter, t, stats);
+ if (gtk_tree_model_get_iter
+ (GTK_TREE_MODEL(model), &iter, path)) {
+ update_torrent_iter(model, tc->updateSerial, &iter, t,
+ stats);
}
gtk_tree_path_free(path);
}
@@ -440,14 +454,17 @@ void trg_torrent_model_update(TrgTorrentModel * model, trg_client * tc,
if (mode == TORRENT_GET_MODE_ACTIVE) {
removedTorrents = get_torrents_removed(args);
if (removedTorrents) {
- for (li = json_array_get_elements(removedTorrents); li != NULL; li = g_list_next(li)) {
- id = json_node_get_int((JsonNode*)li->data);
+ for (li = json_array_get_elements(removedTorrents); li != NULL;
+ li = g_list_next(li)) {
+ id = json_node_get_int((JsonNode *) li->data);
g_hash_table_remove(priv->ht, &id);
removed = TRUE;
}
}
} else if (mode >= TORRENT_GET_MODE_INTERACTION) {
- GList *hitlist = trg_torrent_model_find_removed(GTK_TREE_MODEL(model), tc->updateSerial);
+ GList *hitlist =
+ trg_torrent_model_find_removed(GTK_TREE_MODEL(model),
+ tc->updateSerial);
if (hitlist) {
for (li = hitlist; li; li = g_list_next(li)) {
g_hash_table_remove(priv->ht, li->data);
diff --git a/src/trg-torrent-model.h b/src/trg-torrent-model.h
index 2f9b99a..72467da 100644
--- a/src/trg-torrent-model.h
+++ b/src/trg-torrent-model.h
@@ -75,8 +75,9 @@ void trg_torrent_model_update(TrgTorrentModel * model, trg_client * tc,
trg_torrent_model_update_stats * stats,
gint mode);
-void trg_torrent_model_stats_scan(TrgTorrentModel *model, trg_torrent_model_update_stats *stats);
-GHashTable *get_torrent_table(TrgTorrentModel *model);
+void trg_torrent_model_stats_scan(TrgTorrentModel * model,
+ trg_torrent_model_update_stats * stats);
+GHashTable *get_torrent_table(TrgTorrentModel * model);
enum {
TORRENT_COLUMN_ICON,
diff --git a/src/trg-torrent-props-dialog.c b/src/trg-torrent-props-dialog.c
index 2851b7c..bf9f096 100644
--- a/src/trg-torrent-props-dialog.c
+++ b/src/trg-torrent-props-dialog.c
@@ -138,12 +138,10 @@ trg_torrent_props_response_cb(GtkDialog * dlg, gint res_id,
(priv->seedRatioLimit), args);
json_object_set_int_member(args, FIELD_SEED_RATIO_MODE,
gtk_combo_box_get_active(GTK_COMBO_BOX
- (priv->
- seedRatioMode)));
+ (priv->seedRatioMode)));
json_object_set_int_member(args, FIELD_BANDWIDTH_PRIORITY,
gtk_combo_box_get_active(GTK_COMBO_BOX
- (priv->
- bandwidthPriorityCombo))
+ (priv->bandwidthPriorityCombo))
- 1);
gtk_spin_button_json_int_out(GTK_SPIN_BUTTON
diff --git a/src/trg-trackers-model.c b/src/trg-trackers-model.c
index 7a8feb7..d17f29f 100644
--- a/src/trg-trackers-model.c
+++ b/src/trg-trackers-model.c
@@ -71,8 +71,7 @@ void trg_trackers_model_update(TrgTrackersModel * model,
for (li = json_array_get_elements(trackers); li; li = g_list_next(li)) {
GtkTreeIter trackIter;
- JsonObject *tracker =
- json_node_get_object((JsonNode*)li->data);
+ JsonObject *tracker = json_node_get_object((JsonNode *) li->data);
gint64 trackerId = tracker_get_id(tracker);
announce = tracker_get_announce(tracker);
diff --git a/src/trg-trackers-model.h b/src/trg-trackers-model.h
index 61a64a9..c360e95 100644
--- a/src/trg-trackers-model.h
+++ b/src/trg-trackers-model.h
@@ -48,7 +48,7 @@ GType trg_trackers_model_get_type(void);
TrgTrackersModel *trg_trackers_model_new(void);
G_END_DECLS
-void trg_trackers_model_update(TrgTrackersModel * model,
+ void trg_trackers_model_update(TrgTrackersModel * model,
gint64 updateSerial, JsonObject * t,
gint mode);
void trg_trackers_model_set_accept(TrgTrackersModel * model,
diff --git a/src/util.c b/src/util.c
index 572df3a..1ad04c5 100644
--- a/src/util.c
+++ b/src/util.c
@@ -86,9 +86,12 @@ void trg_error_dialog(GtkWindow * parent, int status,
g_free((gpointer) msg);
}
-gint gconf_client_get_int_or_default(GConfClient * gconf, const gchar *key, int deflt, GError **error)
+gint gconf_client_get_int_or_default(GConfClient * gconf,
+ const gchar * key, int deflt,
+ GError ** error)
{
- GConfValue *value = gconf_client_get_without_default(gconf, key, error);
+ GConfValue *value =
+ gconf_client_get_without_default(gconf, key, error);
gint ret;
if (value) {
ret = gconf_value_get_int(value);
@@ -99,11 +102,11 @@ gint gconf_client_get_int_or_default(GConfClient * gconf, const gchar *key, int
return ret;
}
-gboolean g_slist_str_set_add(GSList **list, const gchar *string)
+gboolean g_slist_str_set_add(GSList ** list, const gchar * string)
{
GSList *li;
for (li = *list; li != NULL; li = g_slist_next(li))
- if (!g_strcmp0((gchar*)li->data, string))
+ if (!g_strcmp0((gchar *) li->data, string))
return FALSE;
*list = g_slist_append(*list, g_strdup(string));
@@ -113,7 +116,8 @@ gboolean g_slist_str_set_add(GSList **list, const gchar *string)
gboolean gconf_client_get_bool_or_true(GConfClient * gconf, gchar * key)
{
GError *error = NULL;
- GConfValue *value = gconf_client_get_without_default(gconf, key, &error);
+ GConfValue *value =
+ gconf_client_get_without_default(gconf, key, &error);
gboolean ret = TRUE;
if (error) {
g_error_free(error);
diff --git a/src/util.h b/src/util.h
index 3903d9f..ec72600 100644
--- a/src/util.h
+++ b/src/util.h
@@ -39,16 +39,19 @@
#define GIGABYTE_FACTOR ( 1024.0 * 1024.0 * 1024.0 )
void add_file_id_to_array(JsonObject * args, gchar * key, gint index);
-gboolean g_slist_str_set_add(GSList **list, const gchar *string);
+gboolean g_slist_str_set_add(GSList ** list, const gchar * string);
void g_str_slist_free(GSList * list);
GRegex *trg_uri_host_regex_new(void);
gchar *trg_gregex_get_first(GRegex * rx, const gchar * uri);
gboolean gconf_client_get_bool_or_true(GConfClient * gconf, gchar * key);
-gint gconf_client_get_int_or_default(GConfClient * gconf, const gchar *key, int deflt, GError **error);
+gint gconf_client_get_int_or_default(GConfClient * gconf,
+ const gchar * key, int deflt,
+ GError ** error);
void response_unref(JsonObject * response);
const gchar *make_error_message(JsonObject * response, int status);
-void trg_error_dialog(GtkWindow * parent, int status, JsonObject * response);
+void trg_error_dialog(GtkWindow * parent, int status,
+ JsonObject * response);
char *tr_strltime_long(char *buf, gint64 seconds, size_t buflen);
char *tr_strltime_short(char *buf, gint64 seconds, size_t buflen);