summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-09 19:51:59 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-09 19:51:59 +0000
commitc277216befdc3438e717ea55539f49f7ffae107c (patch)
treea039f7547786c0cf3f103a6879285b067f7a7cdf
parent1cd35ab86d03cb76152363e33a2b85a1484c44e5 (diff)
indent -kr *.c *.h
-rw-r--r--src/dispatch.c2
-rw-r--r--src/session-get.c3
-rw-r--r--src/torrent.c24
-rw-r--r--src/torrent.h2
-rw-r--r--src/trg-cell-renderer-priority.c3
-rw-r--r--src/trg-cell-renderer-ratio.c3
-rw-r--r--src/trg-cell-renderer-size.c3
-rw-r--r--src/trg-cell-renderer-speed.c3
-rw-r--r--src/trg-client.c19
-rw-r--r--src/trg-client.h5
-rw-r--r--src/trg-files-model.c2
-rw-r--r--src/trg-files-tree-view.c17
-rw-r--r--src/trg-main-window.c173
-rw-r--r--src/trg-peers-model.c36
-rw-r--r--src/trg-peers-tree-view.c2
-rw-r--r--src/trg-preferences-dialog.c18
-rw-r--r--src/trg-preferences-dialog.h9
-rw-r--r--src/trg-remote-prefs-dialog.c2
-rw-r--r--src/trg-status-bar.c3
-rw-r--r--src/trg-toolbar.c2
-rw-r--r--src/trg-torrent-model.c85
-rw-r--r--src/trg-torrent-props-dialog.c24
-rw-r--r--src/trg-torrent-tree-view.c17
-rw-r--r--src/trg-torrent-tree-view.h4
-rw-r--r--src/trg-trackers-model.c40
-rw-r--r--src/trg-trackers-tree-view.c3
26 files changed, 275 insertions, 229 deletions
diff --git a/src/dispatch.c b/src/dispatch.c
index 2c720e3..e72c4ed 100644
--- a/src/dispatch.c
+++ b/src/dispatch.c
@@ -41,7 +41,7 @@ JsonObject *dispatch(trg_client * client, JsonNode * req, int *status)
json_node_free(req);
#ifdef DEBUG
if (g_getenv("TRG_SHOW_OUTGOING") != NULL)
- g_printf("=>(outgoing)=> %s\n", serialized);
+ g_printf("=>(outgoing)=> %s\n", serialized);
#endif
response = trg_http_perform(client, serialized);
g_free(serialized);
diff --git a/src/session-get.c b/src/session-get.c
index 8ee4ab7..4ded820 100644
--- a/src/session-get.c
+++ b/src/session-get.c
@@ -26,7 +26,8 @@
int session_get_version(JsonObject * s, float *version)
{
- const gchar *versionStr = json_object_get_string_member(s, SGET_VERSION);
+ const gchar *versionStr =
+ json_object_get_string_member(s, SGET_VERSION);
return sscanf(versionStr, "%f", version);
}
diff --git a/src/torrent.c b/src/torrent.c
index 9cc4d10..d05cb2b 100644
--- a/src/torrent.c
+++ b/src/torrent.c
@@ -166,18 +166,18 @@ gdouble torrent_get_percent_done(JsonObject * t)
gchar *torrent_get_status_icon(guint flags)
{
- if (flags & TORRENT_FLAG_ERROR)
- return g_strdup(GTK_STOCK_DIALOG_WARNING);
- else if (flags & TORRENT_FLAG_DOWNLOADING)
- return g_strdup(GTK_STOCK_GO_DOWN);
- else if (flags & TORRENT_FLAG_PAUSED)
- return g_strdup(GTK_STOCK_MEDIA_PAUSE);
- else if (flags & TORRENT_FLAG_SEEDING)
- return g_strdup(GTK_STOCK_GO_UP);
- else if (flags & TORRENT_FLAG_CHECKING)
- return g_strdup(GTK_STOCK_REFRESH);
- else
- return g_strdup(GTK_STOCK_DIALOG_QUESTION);
+ if (flags & TORRENT_FLAG_ERROR)
+ return g_strdup(GTK_STOCK_DIALOG_WARNING);
+ else if (flags & TORRENT_FLAG_DOWNLOADING)
+ return g_strdup(GTK_STOCK_GO_DOWN);
+ else if (flags & TORRENT_FLAG_PAUSED)
+ return g_strdup(GTK_STOCK_MEDIA_PAUSE);
+ else if (flags & TORRENT_FLAG_SEEDING)
+ return g_strdup(GTK_STOCK_GO_UP);
+ else if (flags & TORRENT_FLAG_CHECKING)
+ return g_strdup(GTK_STOCK_REFRESH);
+ else
+ return g_strdup(GTK_STOCK_DIALOG_QUESTION);
}
const gchar *torrent_get_errorstr(JsonObject * t)
diff --git a/src/torrent.h b/src/torrent.h
index d457273..fa1ccf0 100644
--- a/src/torrent.h
+++ b/src/torrent.h
@@ -27,7 +27,7 @@
#define TORRENT_FLAG_INCOMPLETE (1 << 2) /* 0x02 */
#define TORRENT_FLAG_SEEDING (1 << 3) /* 0x04 */
#define TORRENT_FLAG_CHECKING (1 << 4) /* 0x08 */
-#define TORRENT_FLAG_WAITING_CHECK (1 << 5) /* 0x16 */
+#define TORRENT_FLAG_WAITING_CHECK (1 << 5) /* 0x16 */
#define TORRENT_FLAG_DOWNLOADING (1 << 6) /* 0x32 */
#define TORRENT_FLAG_PAUSED (1 << 7) /* 0x64 */
diff --git a/src/trg-cell-renderer-priority.c b/src/trg-cell-renderer-priority.c
index b1f659c..91ab812 100644
--- a/src/trg-cell-renderer-priority.c
+++ b/src/trg-cell-renderer-priority.c
@@ -104,7 +104,8 @@ trg_cell_renderer_priority_class_init(TrgCellRendererPriorityClass * klass)
}
static void
-trg_cell_renderer_priority_init(TrgCellRendererPriority * self G_GNUC_UNUSED)
+trg_cell_renderer_priority_init(TrgCellRendererPriority *
+ self G_GNUC_UNUSED)
{
}
diff --git a/src/trg-cell-renderer-ratio.c b/src/trg-cell-renderer-ratio.c
index 29ce7ca..5b0d4b6 100644
--- a/src/trg-cell-renderer-ratio.c
+++ b/src/trg-cell-renderer-ratio.c
@@ -101,8 +101,7 @@ trg_cell_renderer_ratio_class_init(TrgCellRendererRatioClass * klass)
g_type_class_add_private(klass, sizeof(TrgCellRendererRatioPrivate));
}
-static void
-trg_cell_renderer_ratio_init(TrgCellRendererRatio * self)
+static void trg_cell_renderer_ratio_init(TrgCellRendererRatio * self)
{
g_object_set(self, "xalign", 1.0f, NULL);
}
diff --git a/src/trg-cell-renderer-size.c b/src/trg-cell-renderer-size.c
index 7b6f8f8..eadf59e 100644
--- a/src/trg-cell-renderer-size.c
+++ b/src/trg-cell-renderer-size.c
@@ -101,8 +101,7 @@ trg_cell_renderer_size_class_init(TrgCellRendererSizeClass * klass)
g_type_class_add_private(klass, sizeof(TrgCellRendererSizePrivate));
}
-static void
-trg_cell_renderer_size_init(TrgCellRendererSize * self)
+static void trg_cell_renderer_size_init(TrgCellRendererSize * self)
{
g_object_set(self, "xalign", 1.0f, NULL);
}
diff --git a/src/trg-cell-renderer-speed.c b/src/trg-cell-renderer-speed.c
index 9d6292a..369e04d 100644
--- a/src/trg-cell-renderer-speed.c
+++ b/src/trg-cell-renderer-speed.c
@@ -102,8 +102,7 @@ trg_cell_renderer_speed_class_init(TrgCellRendererSpeedClass * klass)
g_type_class_add_private(klass, sizeof(TrgCellRendererSpeedPrivate));
}
-static void
-trg_cell_renderer_speed_init(TrgCellRendererSpeed * self)
+static void trg_cell_renderer_speed_init(TrgCellRendererSpeed * self)
{
g_object_set(self, "xalign", 1.0f, NULL);
}
diff --git a/src/trg-client.c b/src/trg-client.c
index 71b365b..35915b4 100644
--- a/src/trg-client.c
+++ b/src/trg-client.c
@@ -17,6 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <string.h>
#include <glib-object.h>
#include <gconf/gconf-client.h>
@@ -34,9 +35,9 @@ trg_client *trg_init_client()
return client;
}
-#define check_for_error(error) if (error) { g_error_free(error); return FALSE; }
+#define check_for_error(error) if (error) { g_error_free(error); return TRG_GCONF_SCHEMA_ERROR; }
-gboolean trg_client_populate_with_settings(trg_client * tc,
+int trg_client_populate_with_settings(trg_client * tc,
GConfClient * gconf)
{
gint port;
@@ -57,15 +58,19 @@ gboolean trg_client_populate_with_settings(trg_client * tc,
host = gconf_client_get_string(gconf, TRG_GCONF_KEY_HOSTNAME, &error);
check_for_error(error);
+ if (!host || strlen(host) < 1)
+ return TRG_NO_HOSTNAME_SET;
- tc->url = g_strdup_printf("http://%s:%d/transmission/rpc", host, port);
- g_free(host);
+ tc->url = g_strdup_printf("http://%s:%d/transmission/rpc", host, port);
+ g_free(host);
- tc->username = gconf_client_get_string(gconf, TRG_GCONF_KEY_USERNAME, &error);
+ tc->username =
+ gconf_client_get_string(gconf, TRG_GCONF_KEY_USERNAME, &error);
check_for_error(error);
- tc->password = gconf_client_get_string(gconf, TRG_GCONF_KEY_PASSWORD, &error);
+ tc->password =
+ gconf_client_get_string(gconf, TRG_GCONF_KEY_PASSWORD, &error);
check_for_error(error);
- return TRUE;
+ return 0;
}
diff --git a/src/trg-client.h b/src/trg-client.h
index 5f93551..082f4d3 100644
--- a/src/trg-client.h
+++ b/src/trg-client.h
@@ -20,6 +20,9 @@
#ifndef TRG_CLIENT_H_
#define TRG_CLIENT_H_
+#define TRG_GCONF_SCHEMA_ERROR -1
+#define TRG_NO_HOSTNAME_SET -2
+
#include <json-glib/json-glib.h>
#include <gconf/gconf-client.h>
@@ -39,7 +42,7 @@ typedef struct {
} trg_client;
trg_client *trg_init_client();
-gboolean trg_client_populate_with_settings(trg_client * tc,
+int trg_client_populate_with_settings(trg_client * tc,
GConfClient * gconf);
#endif /* TRG_CLIENT_H_ */
diff --git a/src/trg-files-model.c b/src/trg-files-model.c
index 981c63c..379fb2c 100644
--- a/src/trg-files-model.c
+++ b/src/trg-files-model.c
@@ -116,7 +116,7 @@ static void trg_files_model_init(TrgFilesModel * self)
gboolean
trg_files_model_update_foreach(GtkListStore * model,
GtkTreePath * path G_GNUC_UNUSED,
- GtkTreeIter * iter,
+ GtkTreeIter * iter,
gpointer data G_GNUC_UNUSED)
{
TrgFilesModelPrivate *priv = TRG_FILES_MODEL_GET_PRIVATE(model);
diff --git a/src/trg-files-tree-view.c b/src/trg-files-tree-view.c
index d5d705f..ceecb39 100644
--- a/src/trg-files-tree-view.c
+++ b/src/trg-files-tree-view.c
@@ -49,7 +49,7 @@ static void trg_files_tree_view_class_init(TrgFilesTreeViewClass * klass)
static void set_unwanted_foreachfunc(GtkTreeModel * model,
GtkTreePath * path G_GNUC_UNUSED,
GtkTreeIter * iter,
- gpointer data G_GNUC_UNUSED)
+ gpointer data G_GNUC_UNUSED)
{
gtk_list_store_set(GTK_LIST_STORE(model), iter, FILESCOL_WANTED,
FALSE, FILESCOL_ICON, GTK_STOCK_CANCEL, -1);
@@ -57,7 +57,7 @@ static void set_unwanted_foreachfunc(GtkTreeModel * model,
static void set_wanted_foreachfunc(GtkTreeModel * model,
GtkTreePath * path G_GNUC_UNUSED,
- GtkTreeIter * iter,
+ GtkTreeIter * iter,
gpointer data G_GNUC_UNUSED)
{
gtk_list_store_set(GTK_LIST_STORE(model), iter, FILESCOL_WANTED,
@@ -65,9 +65,9 @@ static void set_wanted_foreachfunc(GtkTreeModel * model,
}
static void set_low_foreachfunc(GtkTreeModel * model,
- GtkTreePath * path G_GNUC_UNUSED,
+ GtkTreePath * path G_GNUC_UNUSED,
GtkTreeIter * iter,
- gpointer data G_GNUC_UNUSED)
+ gpointer data G_GNUC_UNUSED)
{
gtk_list_store_set(GTK_LIST_STORE(model), iter, FILESCOL_PRIORITY,
T_PRIORITY_LOW, -1);
@@ -75,7 +75,7 @@ static void set_low_foreachfunc(GtkTreeModel * model,
static void set_normal_foreachfunc(GtkTreeModel * model,
GtkTreePath * path G_GNUC_UNUSED,
- GtkTreeIter * iter,
+ GtkTreeIter * iter,
gpointer data G_GNUC_UNUSED)
{
gtk_list_store_set(GTK_LIST_STORE(model), iter, FILESCOL_PRIORITY,
@@ -83,9 +83,9 @@ static void set_normal_foreachfunc(GtkTreeModel * model,
}
static void set_high_foreachfunc(GtkTreeModel * model,
- GtkTreePath * path G_GNUC_UNUSED,
+ GtkTreePath * path G_GNUC_UNUSED,
GtkTreeIter * iter,
- gpointer data G_GNUC_UNUSED)
+ gpointer data G_GNUC_UNUSED)
{
gtk_list_store_set(GTK_LIST_STORE(model), iter, FILESCOL_PRIORITY,
T_PRIORITY_HIGH, -1);
@@ -99,7 +99,8 @@ static void add_file_id_to_array(JsonObject * args, gchar * key,
}
static void send_updated_file_prefs_foreachfunc(GtkTreeModel * model,
- GtkTreePath * path G_GNUC_UNUSED,
+ GtkTreePath *
+ path G_GNUC_UNUSED,
GtkTreeIter * iter,
gpointer data)
{
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index b8fdd3f..7e8483d 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -172,7 +172,8 @@ static gboolean update_selected_torrent_notebook(TrgMainWindow * win,
priv = TRG_MAIN_WINDOW_GET_PRIVATE(win);
newFirstSelected =
- get_first_selected(priv->client, priv->torrentTreeView, &iter, &json);
+ get_first_selected(priv->client, priv->torrentTreeView, &iter,
+ &json);
if (priv->selectedTorrentId >= 0
&& (priv->selectedTorrentId != newFirstSelected
@@ -203,7 +204,8 @@ static void on_torrent_completed(TrgTorrentModel * model,
priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
- if (priv->statusIcon == NULL || !gtk_status_icon_is_embedded(priv->statusIcon))
+ if (priv->statusIcon == NULL
+ || !gtk_status_icon_is_embedded(priv->statusIcon))
return;
gtk_tree_model_get(GTK_TREE_MODEL(model), iter,
@@ -215,12 +217,12 @@ static void on_torrent_completed(TrgTorrentModel * model,
GTK_STOCK_APPLY
/* the fourth argument was removed in libnotify 0.7.0 */
#if !defined(NOTIFY_VERSION_MINOR) || (NOTIFY_VERSION_MAJOR == 0 && NOTIFY_VERSION_MINOR < 7)
- , NULL
+ , NULL
#endif
- );
+ );
#if !defined(NOTIFY_VERSION_MINOR) || (NOTIFY_VERSION_MAJOR == 0 && NOTIFY_VERSION_MINOR < 7)
- notify_notification_attach_to_status_icon(notify, priv->statusIcon);
+ notify_notification_attach_to_status_icon(notify, priv->statusIcon);
#endif
notify_notification_set_urgency(notify, NOTIFY_URGENCY_LOW);
@@ -232,7 +234,7 @@ static void on_torrent_completed(TrgTorrentModel * model,
}
static gboolean delete_event(GtkWidget * w,
- GdkEvent * event G_GNUC_UNUSED,
+ GdkEvent * event G_GNUC_UNUSED,
gpointer * data G_GNUC_UNUSED)
{
TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(w);
@@ -410,22 +412,36 @@ static void disconnect_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data)
static void connect_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data)
{
TrgMainWindowPrivate *priv;
+ GtkWidget *dialog;
+ int populate_result;
priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
+ populate_result = trg_client_populate_with_settings(priv->client, priv->client->gconf);
+
+ if (populate_result < 0) {
+ gchar *msg;
+
+ switch(populate_result)
+ {
+ case TRG_GCONF_SCHEMA_ERROR:
+ msg = "Unable to retrieve connection settings from GConf. Schema not installed?";
+ break;
+ case TRG_NO_HOSTNAME_SET:
+ msg = "No hostname set";
+ break;
+ default:
+ msg = "Unknown error getting settings";
+ break;
+ }
- if (trg_client_populate_with_settings
- (priv->client, priv->client->gconf) == FALSE) {
- GtkWidget *dialog;
- trg_status_bar_push_connection_msg(priv->statusBar,
- "Unable to get gconf settings.");
dialog =
gtk_message_dialog_new(GTK_WINDOW(data),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
- "Unable to retrieve connection settings from GConf. Schema not installed?");
+ msg);
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
@@ -441,12 +457,13 @@ static void open_local_prefs_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data)
TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
GtkWidget *dlg = trg_preferences_dialog_get_instance(GTK_WINDOW(data),
- priv->client->
- gconf);
+ priv->
+ client->gconf);
gtk_widget_show_all(dlg);
}
-static void open_remote_prefs_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data)
+static void open_remote_prefs_cb(GtkWidget * w G_GNUC_UNUSED,
+ gpointer data)
{
TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
@@ -773,8 +790,7 @@ trg_main_window_update_notebook_displays(TrgMainWindow * win,
t, first);
}
-static void
-open_about_cb(GtkWidget * w G_GNUC_UNUSED, GtkWindow * parent)
+static void open_about_cb(GtkWidget * w G_GNUC_UNUSED, GtkWindow * parent)
{
GtkWidget *aboutDialog = trg_about_window_new(parent);
@@ -813,10 +829,14 @@ trg_torrent_tree_view_visible_func(GtkTreeModel * model,
}
static
-TrgTorrentTreeView *trg_main_window_torrent_tree_view_new(
- TrgMainWindow * win,
- GtkTreeModel * model,
- TrgStateSelector * selector G_GNUC_UNUSED)
+TrgTorrentTreeView *trg_main_window_torrent_tree_view_new(TrgMainWindow *
+ win,
+ GtkTreeModel *
+ model,
+ TrgStateSelector
+ *
+ selector
+ G_GNUC_UNUSED)
{
TrgTorrentTreeView *torrentTreeView = trg_torrent_tree_view_new(model);
@@ -988,8 +1008,7 @@ static void entry_filter_changed_cb(GtkWidget * w, gpointer data)
static void
torrent_state_selection_changed(TrgStateSelector * selector G_GNUC_UNUSED,
- guint flag G_GNUC_UNUSED,
- gpointer data)
+ guint flag G_GNUC_UNUSED, gpointer data)
{
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(data));
}
@@ -1103,13 +1122,15 @@ static TrgMenuBar *trg_main_window_menu_bar_new(TrgMainWindow * win)
return menuBar;
}
-static void status_icon_activated(GtkStatusIcon * icon G_GNUC_UNUSED, gpointer data)
+static void status_icon_activated(GtkStatusIcon * icon G_GNUC_UNUSED,
+ gpointer data)
{
- gtk_window_deiconify(GTK_WINDOW(data));
+ gtk_window_deiconify(GTK_WINDOW(data));
gtk_window_present(GTK_WINDOW(data));
}
-static void clear_filter_entry_cb(GtkWidget * w, gpointer data G_GNUC_UNUSED)
+static void clear_filter_entry_cb(GtkWidget * w,
+ gpointer data G_GNUC_UNUSED)
{
gtk_entry_set_text(GTK_ENTRY(w), "");
}
@@ -1124,7 +1145,7 @@ static gboolean torrent_tv_key_press_event(GtkWidget * w,
else
remove_cb(w, data);
} else if (key->keyval == GDK_Return) {
- open_props_cb(w, data);
+ open_props_cb(w, data);
}
return FALSE;
}
@@ -1149,8 +1170,7 @@ GtkWidget *trg_imagemenuitem_new(GtkMenuShell * shell, char *text,
static void
trg_torrent_tv_view_menu(GtkWidget * treeview G_GNUC_UNUSED,
- GdkEventButton * event,
- gpointer data)
+ GdkEventButton * event, gpointer data)
{
GtkWidget *menu;
@@ -1183,8 +1203,7 @@ trg_torrent_tv_view_menu(GtkWidget * treeview G_GNUC_UNUSED,
static void
trg_status_icon_view_menu(GtkStatusIcon * icon G_GNUC_UNUSED,
- GdkEventButton * event,
- gpointer data)
+ GdkEventButton * event, gpointer data)
{
TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
gboolean connected = priv->client->session != NULL;
@@ -1268,31 +1287,40 @@ static gboolean torrent_tv_popup_menu_cb(GtkWidget * treeview,
return TRUE;
}
-static void status_bar_text_pushed(GtkStatusbar *statusbar, guint context_id, gchar *text, gpointer user_data)
+static void status_bar_text_pushed(GtkStatusbar * statusbar,
+ guint context_id, gchar * text,
+ gpointer user_data)
{
- TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(user_data);
+ TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(user_data);
if (priv->statusIcon != NULL)
- gtk_status_icon_set_tooltip(priv->statusIcon, text);
+ gtk_status_icon_set_tooltip(priv->statusIcon, text);
}
-static gboolean window_state_event (GtkWidget *widget, GdkEventWindowState *event, gpointer trayIcon)
+static gboolean window_state_event(GtkWidget * widget,
+ GdkEventWindowState * event,
+ gpointer trayIcon)
{
- TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(widget);
+ TrgMainWindowPrivate *priv = TRG_MAIN_WINDOW_GET_PRIVATE(widget);
- if(priv->statusIcon != NULL && event->changed_mask == GDK_WINDOW_STATE_ICONIFIED && (event->new_window_state == GDK_WINDOW_STATE_ICONIFIED || event->new_window_state == (GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_MAXIMIZED)))
- {
- GError *error = NULL;
- gboolean tray_min = gconf_client_get_bool(priv->client->gconf, TRG_GCONF_KEY_SYSTEM_TRAY_MINIMISE, &error);
+ if (priv->statusIcon != NULL
+ && event->changed_mask == GDK_WINDOW_STATE_ICONIFIED
+ && (event->new_window_state == GDK_WINDOW_STATE_ICONIFIED
+ || event->new_window_state ==
+ (GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_MAXIMIZED))) {
+ GError *error = NULL;
+ gboolean tray_min =
+ gconf_client_get_bool(priv->client->gconf,
+ TRG_GCONF_KEY_SYSTEM_TRAY_MINIMISE,
+ &error);
- if (error)
- {
- g_error_free(error);
- tray_min = TRUE;
- }
+ if (error) {
+ g_error_free(error);
+ tray_min = TRUE;
+ }
- if (tray_min)
- gtk_widget_hide (GTK_WIDGET(widget));
+ if (tray_min)
+ gtk_widget_hide(GTK_WIDGET(widget));
}
return TRUE;
@@ -1322,10 +1350,12 @@ static GObject *trg_main_window_constructor(GType type,
priv = TRG_MAIN_WINDOW_GET_PRIVATE(self);
theme = gtk_icon_theme_get_default();
- icon = gtk_icon_theme_load_icon (theme, PACKAGE_NAME, 48, GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
+ icon =
+ gtk_icon_theme_load_icon(theme, PACKAGE_NAME, 48,
+ GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
if (icon)
- gtk_window_set_default_icon(icon);
+ gtk_window_set_default_icon(icon);
gtk_window_set_title(GTK_WINDOW(self), PACKAGE_NAME);
gtk_container_set_border_width(GTK_CONTAINER(self), 5);
@@ -1334,7 +1364,8 @@ static GObject *trg_main_window_constructor(GType type,
G_CALLBACK(delete_event), NULL);
g_signal_connect(G_OBJECT(self), "destroy", G_CALLBACK(destroy_window),
NULL);
- g_signal_connect (G_OBJECT (self), "window-state-event", G_CALLBACK (window_state_event), NULL);
+ g_signal_connect(G_OBJECT(self), "window-state-event",
+ G_CALLBACK(window_state_event), NULL);
priv->torrentModel = trg_torrent_model_new();
g_signal_connect(priv->torrentModel, "torrent-completed",
@@ -1428,32 +1459,32 @@ static GObject *trg_main_window_constructor(GType type,
priv->notebook = trg_main_window_notebook_new(self);
gtk_paned_pack2(GTK_PANED(priv->vpaned), priv->notebook, FALSE, FALSE);
- tray = gconf_client_get_bool(priv->client->gconf, TRG_GCONF_KEY_SYSTEM_TRAY, &error);
- if (error)
- {
- g_error_free(error);
- tray = TRUE;
+ tray =
+ gconf_client_get_bool(priv->client->gconf,
+ TRG_GCONF_KEY_SYSTEM_TRAY, &error);
+ if (error) {
+ g_error_free(error);
+ tray = TRUE;
}
- if (tray)
- {
- priv->statusIcon = gtk_status_icon_new_from_pixbuf(icon);
- gtk_status_icon_set_screen(priv->statusIcon,
- gtk_window_get_screen(GTK_WINDOW(self)));
- g_signal_connect(priv->statusIcon, "activate",
- G_CALLBACK(status_icon_activated), self);
- g_signal_connect(priv->statusIcon, "button-press-event",
- G_CALLBACK(status_icon_button_press_event), self);
- g_signal_connect(priv->statusIcon, "popup-menu",
- G_CALLBACK(trg_status_icon_popup_menu_cb), self);
- }
- else
- {
- priv->statusIcon = NULL;
+ if (tray) {
+ priv->statusIcon = gtk_status_icon_new_from_pixbuf(icon);
+ gtk_status_icon_set_screen(priv->statusIcon,
+ gtk_window_get_screen(GTK_WINDOW
+ (self)));
+ g_signal_connect(priv->statusIcon, "activate",
+ G_CALLBACK(status_icon_activated), self);
+ g_signal_connect(priv->statusIcon, "button-press-event",
+ G_CALLBACK(status_icon_button_press_event), self);
+ g_signal_connect(priv->statusIcon, "popup-menu",
+ G_CALLBACK(trg_status_icon_popup_menu_cb), self);
+ } else {
+ priv->statusIcon = NULL;
}
priv->statusBar = trg_status_bar_new();
- g_signal_connect(priv->statusBar, "text-pushed", G_CALLBACK(status_bar_text_pushed), self);
+ g_signal_connect(priv->statusBar, "text-pushed",
+ G_CALLBACK(status_bar_text_pushed), self);
gtk_box_pack_start(GTK_BOX(outerVbox), GTK_WIDGET(priv->statusBar),
FALSE, FALSE, 2);
diff --git a/src/trg-peers-model.c b/src/trg-peers-model.c
index 574a9d1..a814123 100644
--- a/src/trg-peers-model.c
+++ b/src/trg-peers-model.c
@@ -37,15 +37,13 @@
#include "util.h"
G_DEFINE_TYPE(TrgPeersModel, trg_peers_model, GTK_TYPE_LIST_STORE)
-
#define TRG_PEERS_MODEL_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), TRG_TYPE_PEERS_MODEL, TrgPeersModelPrivate))
-
#ifdef HAVE_GEOIP
typedef struct _TrgPeersModelPrivate TrgPeersModelPrivate;
struct _TrgPeersModelPrivate {
- GeoIP *geoip;
+ GeoIP *geoip;
};
#endif
@@ -53,15 +51,14 @@ static void
trg_peers_model_class_init(TrgPeersModelClass * klass G_GNUC_UNUSED)
{
#ifdef HAVE_GEOIP
- g_type_class_add_private (klass, sizeof (TrgPeersModelPrivate));
+ g_type_class_add_private(klass, sizeof(TrgPeersModelPrivate));
#endif
}
gboolean
find_existing_peer_item_foreachfunc(GtkTreeModel * model,
- GtkTreePath * path G_GNUC_UNUSED,
- GtkTreeIter * iter,
- gpointer data)
+ GtkTreePath * path G_GNUC_UNUSED,
+ GtkTreeIter * iter, gpointer data)
{
struct peerAndIter *pi;
gchar *ip;
@@ -129,7 +126,7 @@ void trg_peers_model_update(TrgPeersModel * model, gint64 updateSerial,
JsonObject * t, gboolean first)
{
#ifdef HAVE_GEOIP
- TrgPeersModelPrivate *priv = TRG_PEERS_MODEL_GET_PRIVATE(model);
+ TrgPeersModelPrivate *priv = TRG_PEERS_MODEL_GET_PRIVATE(model);
#endif
JsonArray *peers;
@@ -144,7 +141,7 @@ void trg_peers_model_update(TrgPeersModel * model, gint64 updateSerial,
for (j = 0; j < json_array_get_length(peers); j++) {
JsonObject *peer;
- const gchar *address=NULL, *flagStr;
+ const gchar *address = NULL, *flagStr;
#ifdef HAVE_GEOIP
const gchar *country = NULL;
#endif
@@ -156,17 +153,18 @@ void trg_peers_model_update(TrgPeersModel * model, gint64 updateSerial,
address = peer_get_address(peer);
#ifdef HAVE_GEOIP
- if (priv->geoip != NULL)
- country = GeoIP_country_name_by_addr(priv->geoip, address);
+ if (priv->geoip != NULL)
+ country = GeoIP_country_name_by_addr(priv->geoip, address);
#endif
- gtk_list_store_set(GTK_LIST_STORE(model), &peerIter,
- PEERSCOL_ICON, GTK_STOCK_NETWORK,
- PEERSCOL_IP, address,
+ gtk_list_store_set(GTK_LIST_STORE(model), &peerIter,
+ PEERSCOL_ICON, GTK_STOCK_NETWORK,
+ PEERSCOL_IP, address,
#if HAVE_GEOIP
- PEERSCOL_COUNTRY, country != NULL ? country : "",
+ PEERSCOL_COUNTRY,
+ country != NULL ? country : "",
#endif
- PEERSCOL_CLIENT, peer_get_client_name(peer),
- -1);
+ PEERSCOL_CLIENT, peer_get_client_name(peer),
+ -1);
isNew = TRUE;
} else {
@@ -238,7 +236,9 @@ static void trg_peers_model_init(TrgPeersModel * self)
#if HAVE_GEOIP
if (g_file_test(TRG_GEOIP_DATABASE, G_FILE_TEST_EXISTS) == TRUE)
- priv->geoip = GeoIP_open(TRG_GEOIP_DATABASE, GEOIP_STANDARD | GEOIP_CHECK_CACHE);
+ priv->geoip =
+ GeoIP_open(TRG_GEOIP_DATABASE,
+ GEOIP_STANDARD | GEOIP_CHECK_CACHE);
#endif
}
diff --git a/src/trg-peers-tree-view.c b/src/trg-peers-tree-view.c
index 98e328c..4827574 100644
--- a/src/trg-peers-tree-view.c
+++ b/src/trg-peers-tree-view.c
@@ -59,7 +59,7 @@ static void trg_peers_tree_view_init(TrgPeersTreeView * self)
PEERSCOL_PROGRESS, -1);
trg_tree_view_add_column(TRG_TREE_VIEW(self), "Flags", PEERSCOL_FLAGS);
trg_tree_view_add_column(TRG_TREE_VIEW(self), "Client",
- PEERSCOL_CLIENT);
+ PEERSCOL_CLIENT);
}
TrgPeersTreeView *trg_peers_tree_view_new(TrgPeersModel * model)
diff --git a/src/trg-preferences-dialog.c b/src/trg-preferences-dialog.c
index 8a88205..70c3465 100644
--- a/src/trg-preferences-dialog.c
+++ b/src/trg-preferences-dialog.c
@@ -72,7 +72,7 @@ trg_preferences_dialog_set_property(GObject * object,
static void
trg_preferences_response_cb(GtkDialog * dlg, gint res_id,
- gpointer data G_GNUC_UNUSED)
+ gpointer data G_GNUC_UNUSED)
{
switch (res_id) {
default:
@@ -83,9 +83,9 @@ trg_preferences_response_cb(GtkDialog * dlg, gint res_id,
static void
trg_preferences_dialog_get_property(GObject * object,
- guint prop_id,
- GValue * value,
- GParamSpec * pspec G_GNUC_UNUSED)
+ guint prop_id,
+ GValue * value,
+ GParamSpec * pspec G_GNUC_UNUSED)
{
TrgPreferencesDialog *pref_dlg = TRG_PREFERENCES_DIALOG(object);
@@ -194,7 +194,7 @@ static GtkWidget *new_entry(GConfClient * gconf, const char *key)
return w;
}
-static GtkWidget *trg_prefs_desktopPage(GConfClient *gconf)
+static GtkWidget *trg_prefs_desktopPage(GConfClient * gconf)
{
GtkWidget *tray, *tray_min, *t;
gint row = 0;
@@ -204,12 +204,14 @@ static GtkWidget *trg_prefs_desktopPage(GConfClient *gconf)
hig_workarea_add_section_title(t, &row, "System Tray");
tray = new_check_button(gconf, "Show in system tray",
- TRG_GCONF_KEY_SYSTEM_TRAY);
+ TRG_GCONF_KEY_SYSTEM_TRAY);
hig_workarea_add_wide_control(t, &row, tray);
tray_min = new_check_button(gconf, "Minimise to system tray",
- TRG_GCONF_KEY_SYSTEM_TRAY_MINIMISE);
- gtk_widget_set_sensitive(tray_min, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(tray)));
+ TRG_GCONF_KEY_SYSTEM_TRAY_MINIMISE);
+ gtk_widget_set_sensitive(tray_min,
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
+ (tray)));
g_signal_connect(G_OBJECT(tray), "toggled",
G_CALLBACK(toggle_active_arg_is_sensitive), tray_min);
hig_workarea_add_wide_control(t, &row, tray_min);
diff --git a/src/trg-preferences-dialog.h b/src/trg-preferences-dialog.h
index 379434e..214eedb 100644
--- a/src/trg-preferences-dialog.h
+++ b/src/trg-preferences-dialog.h
@@ -25,9 +25,7 @@
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
-G_BEGIN_DECLS
-
-typedef struct _TrgPreferencesDialog TrgPreferencesDialog;
+G_BEGIN_DECLS typedef struct _TrgPreferencesDialog TrgPreferencesDialog;
typedef struct _TrgPreferencesDialogClass TrgPreferencesDialogClass;
typedef struct _TrgPreferencesDialogPrivate TrgPreferencesDialogPrivate;
@@ -49,8 +47,7 @@ struct _TrgPreferencesDialogClass {
GType trg_preferences_dialog_get_type(void);
-GtkWidget * trg_preferences_dialog_get_instance(GtkWindow * parent,
- GConfClient * client);
+GtkWidget *trg_preferences_dialog_get_instance(GtkWindow * parent,
+ GConfClient * client);
G_END_DECLS
-
#endif /* TRG_PREFERENCES_WINDOW_H_ */
diff --git a/src/trg-remote-prefs-dialog.c b/src/trg-remote-prefs-dialog.c
index 89aefab..7f90709 100644
--- a/src/trg-remote-prefs-dialog.c
+++ b/src/trg-remote-prefs-dialog.c
@@ -148,7 +148,7 @@ static void update_session(GtkDialog * dlg)
static void
trg_remote_prefs_response_cb(GtkDialog * dlg, gint res_id,
- gpointer data G_GNUC_UNUSED)
+ gpointer data G_GNUC_UNUSED)
{
if (res_id == GTK_RESPONSE_ACCEPT) {
update_session(dlg);
diff --git a/src/trg-status-bar.c b/src/trg-status-bar.c
index 5e463ad..499c00c 100644
--- a/src/trg-status-bar.c
+++ b/src/trg-status-bar.c
@@ -69,7 +69,8 @@ void trg_status_bar_connect(TrgStatusBar * sb, JsonObject * session)
session_get_version(session, &version);
statusMsg =
- g_strdup_printf("Connected to Transmission %g, getting torrents...", version);
+ g_strdup_printf
+ ("Connected to Transmission %g, getting torrents...", version);
g_printf("%s\n", statusMsg);
trg_status_bar_push_connection_msg(sb, statusMsg);
g_free(statusMsg);
diff --git a/src/trg-toolbar.c b/src/trg-toolbar.c
index fc80be1..f7b6c27 100644
--- a/src/trg-toolbar.c
+++ b/src/trg-toolbar.c
@@ -164,7 +164,7 @@ static void trg_toolbar_class_init(TrgToolbarClass * klass)
static
GtkWidget *trg_toolbar_item_new(TrgToolbar * toolbar,
- gchar * text G_GNUC_UNUSED,
+ gchar * text G_GNUC_UNUSED,
int *index, gchar * icon,
gboolean sensitive)
{
diff --git a/src/trg-torrent-model.c b/src/trg-torrent-model.c
index 4cbb1a2..cc58750 100644
--- a/src/trg-torrent-model.c
+++ b/src/trg-torrent-model.c
@@ -194,55 +194,60 @@ update_torrent_iter(gint64 serial, TrgTorrentModel * model,
#ifdef DEBUG
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_ICON, statusIcon, -1);
+ TORRENT_COLUMN_ICON, statusIcon, -1);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_NAME, torrent_get_name(t), -1);
+ TORRENT_COLUMN_NAME, torrent_get_name(t), -1);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_SIZE, torrent_get_size(t), -1);
+ TORRENT_COLUMN_SIZE, torrent_get_size(t), -1);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_DONE, torrent_get_percent_done(t), -1);
+ TORRENT_COLUMN_DONE, torrent_get_percent_done(t),
+ -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), iter, TORRENT_COLUMN_STATUS,
+ statusString, -1);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_STATUS, statusString, -1);
+ TORRENT_COLUMN_DOWNSPEED, downRate, -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), iter, TORRENT_COLUMN_FLAGS,
+ newFlags, -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), iter, TORRENT_COLUMN_UPSPEED,
+ upRate, -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), iter, TORRENT_COLUMN_ETA,
+ torrent_get_eta(t), -1);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_DOWNSPEED, downRate, -1);
+ TORRENT_COLUMN_UPLOADED, uploaded, -1);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_FLAGS, newFlags, -1);
+ TORRENT_COLUMN_DOWNLOADED, downloaded, -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), iter, TORRENT_COLUMN_RATIO,
+ uploaded > 0
+ && downloaded >
+ 0 ? (double) uploaded / (double) downloaded : 0,
+ -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), iter, TORRENT_COLUMN_ID, id,
+ -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), iter, TORRENT_COLUMN_JSON, t,
+ -1);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_UPSPEED, upRate, -1);
- gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_ETA, torrent_get_eta(t), -1);
- gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_UPLOADED, uploaded, -1);
- gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_DOWNLOADED, downloaded, -1);
- gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_RATIO,
- uploaded > 0 && downloaded > 0 ? (double) uploaded / (double) downloaded : 0, -1);
- gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_ID, id, -1);
- gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_JSON, t, -1);
- gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_UPDATESERIAL, serial, -1);
+ TORRENT_COLUMN_UPDATESERIAL, serial, -1);
#else
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_ICON, statusIcon,
- TORRENT_COLUMN_NAME, torrent_get_name(t),
- TORRENT_COLUMN_SIZE, torrent_get_size(t),
- TORRENT_COLUMN_DONE,
- torrent_get_percent_done(t),
- TORRENT_COLUMN_STATUS, statusString,
- TORRENT_COLUMN_DOWNSPEED, downRate,
- TORRENT_COLUMN_FLAGS, newFlags,
- TORRENT_COLUMN_UPSPEED, upRate,
- TORRENT_COLUMN_ETA, torrent_get_eta(t),
- TORRENT_COLUMN_UPLOADED, uploaded,
- TORRENT_COLUMN_DOWNLOADED, downloaded,
- TORRENT_COLUMN_RATIO,
- uploaded >
- 0 && downloaded > 0 ? (double) uploaded / (double) downloaded : 0,
- TORRENT_COLUMN_ID, id, TORRENT_COLUMN_JSON, t,
- TORRENT_COLUMN_UPDATESERIAL, serial, -1);
+ TORRENT_COLUMN_ICON, statusIcon,
+ TORRENT_COLUMN_NAME, torrent_get_name(t),
+ TORRENT_COLUMN_SIZE, torrent_get_size(t),
+ TORRENT_COLUMN_DONE,
+ torrent_get_percent_done(t),
+ TORRENT_COLUMN_STATUS, statusString,
+ TORRENT_COLUMN_DOWNSPEED, downRate,
+ TORRENT_COLUMN_FLAGS, newFlags,
+ TORRENT_COLUMN_UPSPEED, upRate,
+ TORRENT_COLUMN_ETA, torrent_get_eta(t),
+ TORRENT_COLUMN_UPLOADED, uploaded,
+ TORRENT_COLUMN_DOWNLOADED, downloaded,
+ TORRENT_COLUMN_RATIO,
+ uploaded >
+ 0
+ && downloaded >
+ 0 ? (double) uploaded / (double) downloaded : 0,
+ TORRENT_COLUMN_ID, id, TORRENT_COLUMN_JSON, t,
+ TORRENT_COLUMN_UPDATESERIAL, serial, -1);
#endif
if ((lastFlags & TORRENT_FLAG_DOWNLOADING)
diff --git a/src/trg-torrent-props-dialog.c b/src/trg-torrent-props-dialog.c
index 353212c..827e643 100644
--- a/src/trg-torrent-props-dialog.c
+++ b/src/trg-torrent-props-dialog.c
@@ -78,8 +78,8 @@ trg_torrent_props_dialog_set_property(GObject * object,
priv->tv = g_value_get_object(value);
break;
case PROP_CLIENT:
- priv->client = g_value_get_pointer(value);
- break;
+ priv->client = g_value_get_pointer(value);
+ break;
}
}
@@ -87,7 +87,7 @@ static void
trg_torrent_props_dialog_get_property(GObject * object,
guint prop_id,
GValue * value,
- GParamSpec * pspec G_GNUC_UNUSED)
+ GParamSpec * pspec G_GNUC_UNUSED)
{
TrgTorrentPropsDialogPrivate *priv =
TRG_TORRENT_PROPS_DIALOG_GET_PRIVATE(object);
@@ -100,14 +100,14 @@ trg_torrent_props_dialog_get_property(GObject * object,
g_value_set_object(value, priv->parent);
break;
case PROP_CLIENT:
- g_value_set_pointer(value, priv->client);
- break;
+ g_value_set_pointer(value, priv->client);
+ break;
}
}
static void
trg_torrent_props_response_cb(GtkDialog * dlg, gint res_id,
- gpointer data G_GNUC_UNUSED)
+ gpointer data G_GNUC_UNUSED)
{
TrgTorrentPropsDialogPrivate *priv;
JsonNode *request;
@@ -137,12 +137,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
@@ -380,7 +378,7 @@ TrgTorrentPropsDialog *trg_torrent_props_dialog_new(GtkWindow * window,
trg_client * client)
{
return g_object_new(TRG_TYPE_TORRENT_PROPS_DIALOG,
- "parent-window", window,
- "torrent-tree-view", treeview,
- "trg-client", client, NULL);
+ "parent-window", window,
+ "torrent-tree-view", treeview,
+ "trg-client", client, NULL);
}
diff --git a/src/trg-torrent-tree-view.c b/src/trg-torrent-tree-view.c
index b0c8e2a..e33e718 100644
--- a/src/trg-torrent-tree-view.c
+++ b/src/trg-torrent-tree-view.c
@@ -27,7 +27,8 @@ G_DEFINE_TYPE(TrgTorrentTreeView, trg_torrent_tree_view,
TRG_TYPE_TREE_VIEW)
static void
-trg_torrent_tree_view_class_init(TrgTorrentTreeViewClass * klass G_GNUC_UNUSED)
+trg_torrent_tree_view_class_init(TrgTorrentTreeViewClass *
+ klass G_GNUC_UNUSED)
{
}
@@ -60,8 +61,8 @@ static void trg_torrent_tree_view_init(TrgTorrentTreeView * tv)
TORRENT_COLUMN_RATIO, -1);
}
-gint get_first_selected(trg_client *client, TrgTorrentTreeView * view, GtkTreeIter * iter,
- JsonObject ** json)
+gint get_first_selected(trg_client * client, TrgTorrentTreeView * view,
+ GtkTreeIter * iter, JsonObject ** json)
{
GtkTreeModel *model;
GtkTreeSelection *selection;
@@ -77,13 +78,14 @@ gint get_first_selected(trg_client *client, TrgTorrentTreeView * view, GtkTreeIt
if ((firstNode = g_list_first(selectionList)) != NULL) {
if (gtk_tree_model_get_iter(model, iter, firstNode->data) == TRUE) {
- gtk_tree_model_get(model, iter,
+ gtk_tree_model_get(model, iter,
TORRENT_COLUMN_JSON, json,
TORRENT_COLUMN_ID, &id,
- TORRENT_COLUMN_UPDATESERIAL, &updateSerial, -1);
+ TORRENT_COLUMN_UPDATESERIAL, &updateSerial,
+ -1);
if (updateSerial < client->updateSerial)
- id = -1;
+ id = -1;
}
}
@@ -94,7 +96,8 @@ gint get_first_selected(trg_client *client, TrgTorrentTreeView * view, GtkTreeIt
void
trg_torrent_model_get_json_id_array_foreach(GtkTreeModel * model,
- GtkTreePath * path G_GNUC_UNUSED,
+ GtkTreePath *
+ path G_GNUC_UNUSED,
GtkTreeIter * iter,
gpointer data)
{
diff --git a/src/trg-torrent-tree-view.h b/src/trg-torrent-tree-view.h
index 6e642af..50f3f82 100644
--- a/src/trg-torrent-tree-view.h
+++ b/src/trg-torrent-tree-view.h
@@ -51,8 +51,8 @@ GType trg_torrent_tree_view_get_type(void);
TrgTorrentTreeView *trg_torrent_tree_view_new(GtkTreeModel * model);
JsonArray *build_json_id_array(TrgTorrentTreeView * tv);
-gint get_first_selected(trg_client *client, TrgTorrentTreeView * view, GtkTreeIter * iter,
- JsonObject ** json);
+gint get_first_selected(trg_client * client, TrgTorrentTreeView * view,
+ GtkTreeIter * iter, JsonObject ** json);
G_END_DECLS
#endif /* _TRG_TORRENT_TREE_VIEW_H_ */
diff --git a/src/trg-trackers-model.c b/src/trg-trackers-model.c
index 995f27d..e2dc7ab 100644
--- a/src/trg-trackers-model.c
+++ b/src/trg-trackers-model.c
@@ -39,31 +39,31 @@ void trg_trackers_model_update(TrgTrackersModel * model, JsonObject * t)
gtk_list_store_clear(GTK_LIST_STORE(model));
for (j = 0; j < json_array_get_length(trackers); j++) {
- GtkTreeIter trackIter;
- JsonObject *tracker =
- json_node_get_object(json_array_get_element(trackers, j));
+ GtkTreeIter trackIter;
+ JsonObject *tracker =
+ json_node_get_object(json_array_get_element(trackers, j));
- announce = tracker_get_announce(tracker);
- scrape = tracker_get_scrape(tracker);
+ announce = tracker_get_announce(tracker);
+ scrape = tracker_get_scrape(tracker);
- gtk_list_store_append(GTK_LIST_STORE(model), &trackIter);
+ gtk_list_store_append(GTK_LIST_STORE(model), &trackIter);
#ifdef DEBUG
- gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
- TRACKERCOL_ICON, GTK_STOCK_NETWORK, -1);
- gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
- TRACKERCOL_TIER, tracker_get_tier(tracker), -1);
- gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
- TRACKERCOL_ANNOUNCE, announce, -1);
- gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
- TRACKERCOL_SCRAPE, scrape, -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
+ TRACKERCOL_ICON, GTK_STOCK_NETWORK, -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
+ TRACKERCOL_TIER, tracker_get_tier(tracker), -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
+ TRACKERCOL_ANNOUNCE, announce, -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
+ TRACKERCOL_SCRAPE, scrape, -1);
#else
- gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
- TRACKERCOL_ICON, GTK_STOCK_NETWORK,
- TRACKERCOL_TIER,
- tracker_get_tier(tracker),
- TRACKERCOL_ANNOUNCE,
- announce, TRACKERCOL_SCRAPE, scrape, -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), &trackIter,
+ TRACKERCOL_ICON, GTK_STOCK_NETWORK,
+ TRACKERCOL_TIER,
+ tracker_get_tier(tracker),
+ TRACKERCOL_ANNOUNCE,
+ announce, TRACKERCOL_SCRAPE, scrape, -1);
#endif
}
}
diff --git a/src/trg-trackers-tree-view.c b/src/trg-trackers-tree-view.c
index 9f6f070..d29a956 100644
--- a/src/trg-trackers-tree-view.c
+++ b/src/trg-trackers-tree-view.c
@@ -27,7 +27,8 @@ G_DEFINE_TYPE(TrgTrackersTreeView, trg_trackers_tree_view,
static void
-trg_trackers_tree_view_class_init(TrgTrackersTreeViewClass * klass G_GNUC_UNUSED)
+trg_trackers_tree_view_class_init(TrgTrackersTreeViewClass *
+ klass G_GNUC_UNUSED)
{
}