summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2012-09-05 22:02:12 +0100
committerGravatar Alan Fitton <ajf@eth0.org.uk>2012-09-05 22:02:12 +0100
commit4ba144769b6a1aea5772e19808c755b9dfc60bf8 (patch)
tree9d1babca0fd2bb9d7ae44969bb4435fe196838a1 /src
parent80183c2387c7da5e9f0bf07cf19f6e712d620396 (diff)
update changelog and reindent
Diffstat (limited to 'src')
-rw-r--r--src/hig.h21
-rw-r--r--src/icons.h8
-rw-r--r--src/session-get.c4
-rw-r--r--src/torrent-cell-renderer.c5
-rw-r--r--src/torrent-cell-renderer.h18
-rw-r--r--src/torrent.c6
-rw-r--r--src/torrent.h15
-rw-r--r--src/trg-client.h7
-rw-r--r--src/trg-files-tree-view.h2
-rw-r--r--src/trg-main-window.c20
-rw-r--r--src/trg-menu-bar.c6
-rw-r--r--src/trg-menu-bar.h3
-rw-r--r--src/trg-peers-model.c20
-rw-r--r--src/trg-peers-tree-view.h2
-rw-r--r--src/trg-preferences-dialog.c3
-rw-r--r--src/trg-prefs.h6
-rw-r--r--src/trg-remote-prefs-dialog.c6
-rw-r--r--src/trg-torrent-model.c10
-rw-r--r--src/trg-torrent-props-dialog.c66
-rw-r--r--src/trg-torrent-props-dialog.h3
-rw-r--r--src/trg-torrent-tree-view.h2
-rw-r--r--src/trg-trackers-tree-view.h2
-rw-r--r--src/trg-tree-view.c33
-rw-r--r--src/trg-tree-view.h10
-rw-r--r--src/util.h7
25 files changed, 163 insertions, 122 deletions
diff --git a/src/hig.h b/src/hig.h
index c2b006b..de4a8bc 100644
--- a/src/hig.h
+++ b/src/hig.h
@@ -22,22 +22,23 @@
GtkWidget *hig_workarea_create(void);
-void hig_workarea_add_section_divider(GtkWidget * table, guint *row);
+void hig_workarea_add_section_divider(GtkWidget * table, guint * row);
void hig_workarea_add_section_title_widget(GtkWidget * t,
- guint *row, GtkWidget * w);
+ guint * row, GtkWidget * w);
void hig_workarea_add_section_title(GtkWidget * table,
- guint *row, const char *section_title);
+ guint * row,
+ const char *section_title);
void hig_workarea_add_wide_tall_control(GtkWidget * table,
- guint *row, GtkWidget * w);
+ guint * row, GtkWidget * w);
void hig_workarea_add_wide_control(GtkWidget * table,
- guint *row, GtkWidget * w);
+ guint * row, GtkWidget * w);
GtkWidget *hig_workarea_add_wide_checkbutton(GtkWidget * table,
- guint *row,
+ guint * row,
const char *mnemonic_string,
gboolean is_active);
@@ -51,25 +52,25 @@ void hig_workarea_add_control(GtkWidget * table,
guint row, GtkWidget * control);
GtkWidget *hig_workarea_add_tall_row(GtkWidget * table,
- guint *row,
+ guint * row,
const char *mnemonic_string,
GtkWidget * control,
GtkWidget *
mnemonic_or_null_for_control);
GtkWidget *hig_workarea_add_row(GtkWidget * table,
- guint *row,
+ guint * row,
const char *mnemonic_string,
GtkWidget * control,
GtkWidget * mnemonic_or_null_for_control);
void hig_workarea_add_row_w(GtkWidget * table,
- guint *row,
+ guint * row,
GtkWidget * label,
GtkWidget * control,
GtkWidget * mnemonic_or_null_for_control);
-void hig_workarea_finish(GtkWidget * table, guint *row);
+void hig_workarea_finish(GtkWidget * table, guint * row);
void hig_message_dialog_set_text(GtkMessageDialog * dialog,
const char *primary,
diff --git a/src/icons.h b/src/icons.h
index db19d92..1f9088a 100644
--- a/src/icons.h
+++ b/src/icons.h
@@ -12,10 +12,10 @@
#define DIRECTORY_MIME_TYPE "folder"
#define UNKNOWN_MIME_TYPE "unknown"
-const char * gtr_get_mime_type_from_filename( const char *file );
+const char *gtr_get_mime_type_from_filename(const char *file);
-GdkPixbuf * gtr_get_mime_type_icon( const char * mime_type,
- GtkIconSize icon_size,
- GtkWidget * for_widget );
+GdkPixbuf *gtr_get_mime_type_icon(const char *mime_type,
+ GtkIconSize icon_size,
+ GtkWidget * for_widget);
#endif
diff --git a/src/session-get.c b/src/session-get.c
index 7bd2dd6..0b85b22 100644
--- a/src/session-get.c
+++ b/src/session-get.c
@@ -170,7 +170,9 @@ gint64 session_get_cache_size_mb(JsonObject * s)
gdouble session_get_seed_ratio_limit(JsonObject * s)
{
- return json_node_really_get_double(json_object_get_member(s, SGET_SEED_RATIO_LIMIT));
+ return
+ json_node_really_get_double(json_object_get_member
+ (s, SGET_SEED_RATIO_LIMIT));
}
gboolean session_get_start_added_torrents(JsonObject * s)
diff --git a/src/torrent-cell-renderer.c b/src/torrent-cell-renderer.c
index 21392dc..95f4d37 100644
--- a/src/torrent-cell-renderer.c
+++ b/src/torrent-cell-renderer.c
@@ -160,7 +160,7 @@ static void getProgressString(GString * gstr, TorrentCellRenderer * r)
sizeof(buf2)),
tr_strlpercent(buf3, p->done,
sizeof(buf3)));
- } else if (!isSeed) { /* Partial seed */
+ } else if (!isSeed) { /* Partial seed */
if (hasSeedRatio) {
g_string_append_printf(gstr,
_
@@ -342,8 +342,7 @@ static void getStatusString(GString * gstr, TorrentCellRenderer * r)
priv->connected + priv->webSeedsToUs),
priv->connected + priv->webSeedsToUs,
tr_strlpercent(buf,
- priv->
- metadataPercentComplete,
+ priv->metadataPercentComplete,
sizeof(buf)));
}
} else if (priv->flags & TORRENT_FLAG_SEEDING) {
diff --git a/src/torrent-cell-renderer.h b/src/torrent-cell-renderer.h
index 817d58b..c6bb7ad 100644
--- a/src/torrent-cell-renderer.h
+++ b/src/torrent-cell-renderer.h
@@ -32,22 +32,20 @@ typedef struct TorrentCellRenderer TorrentCellRenderer;
typedef struct TorrentCellRendererClass TorrentCellRendererClass;
-struct TorrentCellRenderer
-{
+struct TorrentCellRenderer {
GtkCellRenderer parent;
- /*< private >*/
- struct TorrentCellRendererPrivate * priv;
+ /*< private > */
+ struct TorrentCellRendererPrivate *priv;
};
-struct TorrentCellRendererClass
-{
+struct TorrentCellRendererClass {
GtkCellRendererClass parent;
};
-GType torrent_cell_renderer_get_type( void ) G_GNUC_CONST;
+GType torrent_cell_renderer_get_type(void) G_GNUC_CONST;
-GtkCellRenderer * torrent_cell_renderer_new( void );
-GtkTreeView *torrent_cell_renderer_get_owner(TorrentCellRenderer *r);
+GtkCellRenderer *torrent_cell_renderer_new(void);
+GtkTreeView *torrent_cell_renderer_get_owner(TorrentCellRenderer * r);
-#endif /* GTR_TORRENT_CELL_RENDERER_H */
+#endif /* GTR_TORRENT_CELL_RENDERER_H */
diff --git a/src/torrent.c b/src/torrent.c
index 01be5a1..10a556c 100644
--- a/src/torrent.c
+++ b/src/torrent.c
@@ -126,7 +126,9 @@ gint64 torrent_get_seed_ratio_mode(JsonObject * t)
gdouble torrent_get_seed_ratio_limit(JsonObject * t)
{
- return json_node_really_get_double(json_object_get_member(t, FIELD_SEED_RATIO_LIMIT));
+ return
+ json_node_really_get_double(json_object_get_member
+ (t, FIELD_SEED_RATIO_LIMIT));
}
gint64 torrent_get_download_limit(JsonObject * t)
@@ -299,7 +301,7 @@ gchar *torrent_get_status_icon(gint64 rpcv, guint flags)
if (flags & TORRENT_FLAG_ERROR)
return g_strdup(GTK_STOCK_DIALOG_WARNING);
else if (flags & TORRENT_FLAG_DOWNLOADING_METADATA)
- return g_strdup(GTK_STOCK_FIND);
+ return g_strdup(GTK_STOCK_FIND);
else if (flags & TORRENT_FLAG_DOWNLOADING)
return g_strdup(GTK_STOCK_GO_DOWN);
else if (flags & TORRENT_FLAG_PAUSED)
diff --git a/src/torrent.h b/src/torrent.h
index 75f3eb2..99f023c 100644
--- a/src/torrent.h
+++ b/src/torrent.h
@@ -44,7 +44,7 @@
#define TORRENT_ADD_FLAG_PAUSED (1 << 0) /* 0x01 */
#define TORRENT_ADD_FLAG_DELETE (1 << 1) /* 0x02 */
-gint64 torrent_get_total_size(JsonObject *t);
+gint64 torrent_get_total_size(JsonObject * t);
gint64 torrent_get_size_when_done(JsonObject * t);
const gchar *torrent_get_name(JsonObject * t);
gint64 torrent_get_rate_down(JsonObject * t);
@@ -53,19 +53,20 @@ gint64 torrent_get_eta(JsonObject * t);
gint64 torrent_get_uploaded(JsonObject * t);
gint64 torrent_get_downloaded(JsonObject * t);
const gchar *torrent_get_errorstr(JsonObject * t);
-gint64 torrent_get_error(JsonObject *t);
+gint64 torrent_get_error(JsonObject * t);
const gchar *torrent_get_download_dir(JsonObject * t);
const gchar *torrent_get_comment(JsonObject * t);
gint64 torrent_get_have_unchecked(JsonObject * t);
gint64 torrent_get_have_valid(JsonObject * t);
gint64 torrent_get_status(JsonObject * t);
-const gchar *torrent_get_creator(JsonObject *t);
-gint64 torrent_get_date_created(JsonObject *t);
-const gchar *torrent_get_hash(JsonObject *t);
+const gchar *torrent_get_creator(JsonObject * t);
+gint64 torrent_get_date_created(JsonObject * t);
+const gchar *torrent_get_hash(JsonObject * t);
gchar *torrent_get_status_string(gint64 rpcv, gint64 value, guint flags);
gchar *torrent_get_status_icon(gint64 rpcv, guint flags);
guint32 torrent_get_flags(JsonObject * t, gint64 rpcv, gint64 status,
- gint64 fileCount, gint64 downRate, gint64 upRate);
+ gint64 fileCount, gint64 downRate,
+ gint64 upRate);
JsonArray *torrent_get_peers(JsonObject * t);
JsonObject *torrent_get_peersfrom(JsonObject * t);
JsonArray *torrent_get_tracker_stats(JsonObject * t);
@@ -75,7 +76,7 @@ gint64 torrent_get_id(JsonObject * t);
JsonArray *torrent_get_files(JsonObject * args);
gint64 torrent_get_peers_getting_from_us(JsonObject * args);
gint64 torrent_get_peers_sending_to_us(JsonObject * args);
-gint64 torrent_get_web_seeds_sending_to_us(JsonObject *args);
+gint64 torrent_get_web_seeds_sending_to_us(JsonObject * args);
gint64 torrent_get_peers_connected(JsonObject * args);
gdouble torrent_get_percent_done(JsonObject * t);
gdouble torrent_get_recheck_progress(JsonObject * t);
diff --git a/src/trg-client.h b/src/trg-client.h
index d7eb043..803579e 100644
--- a/src/trg-client.h
+++ b/src/trg-client.h
@@ -158,9 +158,10 @@ guint trg_client_get_failcount(TrgClient * tc);
void trg_client_reset_failcount(TrgClient * tc);
void trg_client_inc_serial(TrgClient * tc);
void trg_client_inc_connid(TrgClient * tc);
-gboolean trg_client_update_session(TrgClient *tc, GSourceFunc callback, gpointer data);
-gboolean trg_client_get_seed_ratio_limited(TrgClient *tc);
-gdouble trg_client_get_seed_ratio_limit(TrgClient *tc);
+gboolean trg_client_update_session(TrgClient * tc, GSourceFunc callback,
+ gpointer data);
+gboolean trg_client_get_seed_ratio_limited(TrgClient * tc);
+gdouble trg_client_get_seed_ratio_limit(TrgClient * tc);
G_END_DECLS
#endif /* _TRG_CLIENT_H_ */
diff --git a/src/trg-files-tree-view.h b/src/trg-files-tree-view.h
index 2f2971c..04a38bb 100644
--- a/src/trg-files-tree-view.h
+++ b/src/trg-files-tree-view.h
@@ -56,7 +56,7 @@ GType trg_files_tree_view_get_type(void);
TrgFilesTreeView *trg_files_tree_view_new(TrgFilesModel * model,
TrgMainWindow * win,
TrgClient * client,
- const gchar *configId);
+ const gchar * configId);
void
trg_files_tree_view_renderPriority(GtkTreeViewColumn *
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index 28b91a0..036c81c 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -455,7 +455,8 @@ static void add_url_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data)
TrgMainWindowPrivate *priv = win->priv;
TrgTorrentAddUrlDialog *dlg = trg_torrent_add_url_dialog_new(win,
- priv->client);
+ priv->
+ client);
gtk_widget_show_all(GTK_WIDGET(dlg));
}
@@ -1416,7 +1417,8 @@ trg_torrent_tree_view_visible_func(GtkTreeModel * model,
matchesTracker = (!json
|| !torrent_has_tracker(json,
trg_state_selector_get_url_host_regex
- (priv->stateSelector),
+ (priv->
+ stateSelector),
text));
g_free(text);
if (matchesTracker)
@@ -2615,10 +2617,10 @@ static GObject *trg_main_window_constructor(GType type,
construct_params)
{
TrgMainWindow *self = TRG_MAIN_WINDOW(G_OBJECT_CLASS
- (trg_main_window_parent_class)->constructor
- (type,
- n_construct_properties,
- construct_params));
+ (trg_main_window_parent_class)->
+ constructor(type,
+ n_construct_properties,
+ construct_params));
TrgMainWindowPrivate *priv =
G_TYPE_INSTANCE_GET_PRIVATE(self, TRG_TYPE_MAIN_WINDOW,
TrgMainWindowPrivate);
@@ -2678,7 +2680,8 @@ static GObject *trg_main_window_constructor(GType type,
self, NULL);
priv->torrentTreeView = trg_main_window_torrent_tree_view_new(self,
- priv->filteredTorrentModel);
+ priv->
+ filteredTorrentModel);
g_signal_connect(priv->torrentTreeView, "popup-menu",
G_CALLBACK(torrent_tv_popup_menu_cb), self);
g_signal_connect(priv->torrentTreeView, "button-press-event",
@@ -2732,7 +2735,8 @@ static GObject *trg_main_window_constructor(GType type,
FALSE, FALSE);
gtk_paned_pack2(GTK_PANED(priv->hpaned), my_scrolledwin_new(GTK_WIDGET
- (priv->torrentTreeView)),
+ (priv->
+ torrentTreeView)),
TRUE, TRUE);
g_signal_connect(G_OBJECT(priv->stateSelector),
diff --git a/src/trg-menu-bar.c b/src/trg-menu-bar.c
index df2cad9..c701cbc 100644
--- a/src/trg-menu-bar.c
+++ b/src/trg-menu-bar.c
@@ -485,8 +485,7 @@ static GtkWidget *trg_menu_bar_view_menu_new(TrgMenuBar * mb)
priv->mb_view_transmission_compact);
group =
gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM
- (priv->
- mb_view_transmission_compact));
+ (priv->mb_view_transmission_compact));
priv->mb_view_classic =
trg_menu_bar_view_radio_item_new(priv->prefs, group,
TRG_PREFS_KEY_STYLE,
@@ -496,8 +495,7 @@ static GtkWidget *trg_menu_bar_view_menu_new(TrgMenuBar * mb)
gtk_menu_shell_append(GTK_MENU_SHELL(viewMenu),
trg_tree_view_sort_menu(TRG_TREE_VIEW
- (priv->
- torrent_tree_view),
+ (priv->torrent_tree_view),
_("Sort")));
priv->mb_view_states =
diff --git a/src/trg-menu-bar.h b/src/trg-menu-bar.h
index 47750f5..3774bb6 100644
--- a/src/trg-menu-bar.h
+++ b/src/trg-menu-bar.h
@@ -50,7 +50,8 @@ typedef struct {
GType trg_menu_bar_get_type(void);
TrgMenuBar *trg_menu_bar_new(TrgMainWindow * win, TrgPrefs * prefs,
- TrgTorrentTreeView *ttv, GtkAccelGroup * accel_group);
+ TrgTorrentTreeView * ttv,
+ GtkAccelGroup * accel_group);
GtkWidget *trg_menu_bar_item_new(GtkMenuShell * shell, const gchar * text,
const gchar * stock_id,
gboolean sensitive);
diff --git a/src/trg-peers-model.c b/src/trg-peers-model.c
index 5e79232..a231666 100644
--- a/src/trg-peers-model.c
+++ b/src/trg-peers-model.c
@@ -100,16 +100,18 @@ struct ResolvedDnsIdleData {
gchar *rdns;
};
-static gboolean resolved_dns_idle_cb(gpointer data) {
+static gboolean resolved_dns_idle_cb(gpointer data)
+{
struct ResolvedDnsIdleData *idleData = data;
- GtkTreeModel *model = gtk_tree_row_reference_get_model(idleData->rowRef);
+ GtkTreeModel *model =
+ gtk_tree_row_reference_get_model(idleData->rowRef);
GtkTreePath *path = gtk_tree_row_reference_get_path(idleData->rowRef);
- if (path != NULL ) {
+ if (path != NULL) {
GtkTreeIter iter;
if (gtk_tree_model_get_iter(model, &iter, path) == TRUE) {
gtk_list_store_set(GTK_LIST_STORE(model), &iter, PEERSCOL_HOST,
- idleData->rdns, -1);
+ idleData->rdns, -1);
}
gtk_tree_path_free(path);
}
@@ -122,15 +124,17 @@ static gboolean resolved_dns_idle_cb(gpointer data) {
}
static void resolved_dns_cb(GObject * source_object, GAsyncResult * res,
- gpointer data) {
+ gpointer data)
+{
- gchar *rdns = g_resolver_lookup_by_address_finish(G_RESOLVER(source_object),
- res, NULL );
+ gchar *rdns =
+ g_resolver_lookup_by_address_finish(G_RESOLVER(source_object),
+ res, NULL);
GtkTreeRowReference *rowRef = data;
if (rdns != NULL) {
struct ResolvedDnsIdleData *idleData =
- g_new(struct ResolvedDnsIdleData, 1);
+ g_new(struct ResolvedDnsIdleData, 1);
idleData->rdns = rdns;
idleData->rowRef = rowRef;
g_idle_add(resolved_dns_idle_cb, idleData);
diff --git a/src/trg-peers-tree-view.h b/src/trg-peers-tree-view.h
index f1a7b9d..c7b254f 100644
--- a/src/trg-peers-tree-view.h
+++ b/src/trg-peers-tree-view.h
@@ -51,7 +51,7 @@ GType trg_peers_tree_view_get_type(void);
TrgPeersTreeView *trg_peers_tree_view_new(TrgPrefs * prefs,
TrgPeersModel * model,
- const gchar *configId);
+ const gchar * configId);
G_END_DECLS
#endif /* TRG_PEERS_TREE_VIEW_H_ */
diff --git a/src/trg-preferences-dialog.c b/src/trg-preferences-dialog.c
index ba382eb..e8cfb15 100644
--- a/src/trg-preferences-dialog.c
+++ b/src/trg-preferences-dialog.c
@@ -384,7 +384,8 @@ trgp_double_special_dependent(GtkWidget * widget, gpointer data)
(priv->fullUpdateCheck)
&&
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
- (priv->fullUpdateCheck)));
+ (priv->
+ fullUpdateCheck)));
}
static GtkWidget *trg_prefs_generalPage(TrgPreferencesDialog * dlg)
diff --git a/src/trg-prefs.h b/src/trg-prefs.h
index 465ad81..793ec04 100644
--- a/src/trg-prefs.h
+++ b/src/trg-prefs.h
@@ -88,9 +88,9 @@
#define TRG_PREFS_REPLACENODE (1 << 5) /* 0x16 */
enum {
- TRG_STYLE_TR = 0,
- TRG_STYLE_CLASSIC,
- TRG_STYLE_TR_COMPACT
+ TRG_STYLE_TR = 0,
+ TRG_STYLE_CLASSIC,
+ TRG_STYLE_TR_COMPACT
};
typedef struct _TrgPrefsPrivate TrgPrefsPrivate;
diff --git a/src/trg-remote-prefs-dialog.c b/src/trg-remote-prefs-dialog.c
index bb975fb..22b29af 100644
--- a/src/trg-remote-prefs-dialog.c
+++ b/src/trg-remote-prefs-dialog.c
@@ -162,10 +162,12 @@ trg_remote_prefs_double_special_dependent(GtkWidget * widget,
gtk_widget_set_sensitive(GTK_WIDGET(data),
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
- (priv->alt_time_check))
+ (priv->
+ alt_time_check))
||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
- (priv->alt_check)));
+ (priv->
+ alt_check)));
}
static void
diff --git a/src/trg-torrent-model.c b/src/trg-torrent-model.c
index 4db2bdb..d5b640f 100644
--- a/src/trg-torrent-model.c
+++ b/src/trg-torrent-model.c
@@ -191,7 +191,8 @@ static void trg_torrent_model_ref_free(gpointer data)
GtkTreeIter iter;
JsonObject *json;
if (gtk_tree_model_get_iter(model, &iter, path)) {
- gtk_tree_model_get(model, &iter, TORRENT_COLUMN_JSON, &json, -1);
+ gtk_tree_model_get(model, &iter, TORRENT_COLUMN_JSON, &json,
+ -1);
json_object_unref(json);
g_object_set_data(G_OBJECT(model), PROP_REMOVE_IN_PROGRESS,
GINT_TO_POINTER(TRUE));
@@ -294,7 +295,8 @@ trg_torrent_model_reload_dir_aliases_foreachfunc(GtkTreeModel * model,
shorten_download_dir((TrgClient *) gdata, downloadDir);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
- TORRENT_COLUMN_DOWNLOADDIR_SHORT, shortDownloadDir, -1);
+ TORRENT_COLUMN_DOWNLOADDIR_SHORT, shortDownloadDir,
+ -1);
g_free(downloadDir);
g_free(shortDownloadDir);
@@ -543,9 +545,9 @@ update_torrent_iter(TrgTorrentModel * model,
gtk_list_store_set(ls, iter, TORRENT_COLUMN_METADATAPERCENTCOMPLETE,
torrent_get_metadata_percent_complete(t), -1);
gtk_list_store_set(ls, iter, TORRENT_COLUMN_PEERS_TO_US,
- torrent_get_peers_sending_to_us(t), -1);
+ torrent_get_peers_sending_to_us(t), -1);
gtk_list_store_set(ls, iter, TORRENT_COLUMN_PEERS_FROM_US,
- torrent_get_peers_getting_from_us(t), -1);
+ torrent_get_peers_getting_from_us(t), -1);
gtk_list_store_set(ls, iter, TORRENT_COLUMN_WEB_SEEDS_TO_US,
torrent_get_web_seeds_sending_to_us(t), -1);
gtk_list_store_set(ls, iter, TORRENT_COLUMN_SEED_RATIO_LIMIT,
diff --git a/src/trg-torrent-props-dialog.c b/src/trg-torrent-props-dialog.c
index 190fa13..da93279 100644
--- a/src/trg-torrent-props-dialog.c
+++ b/src/trg-torrent-props-dialog.c
@@ -56,7 +56,7 @@ G_DEFINE_TYPE(TrgTorrentPropsDialog, trg_torrent_props_dialog,
GTK_TYPE_DIALOG)
enum {
PROP_0, PROP_TREEVIEW, PROP_TORRENT_MODEL, PROP_PARENT_WINDOW,
- PROP_CLIENT
+ PROP_CLIENT
};
#define GET_PRIVATE(o) \
@@ -133,7 +133,7 @@ static void trg_torrent_props_dialog_get_property(GObject * object,
}
static void trg_torrent_props_response_cb(GtkDialog * dialog, gint res_id,
- gpointer data G_GNUC_UNUSED)
+ gpointer data G_GNUC_UNUSED)
{
TrgTorrentPropsDialogPrivate *priv = GET_PRIVATE(dialog);
JsonNode *request;
@@ -141,17 +141,20 @@ static void trg_torrent_props_response_cb(GtkDialog * dialog, gint res_id,
if (priv->peersTv)
trg_tree_view_persist(TRG_TREE_VIEW(priv->peersTv),
- TRG_TREE_VIEW_PERSIST_SORT | TRG_TREE_VIEW_PERSIST_LAYOUT);
+ TRG_TREE_VIEW_PERSIST_SORT |
+ TRG_TREE_VIEW_PERSIST_LAYOUT);
if (priv->filesTv)
trg_tree_view_persist(TRG_TREE_VIEW(priv->filesTv),
- TRG_TREE_VIEW_PERSIST_SORT | TRG_TREE_VIEW_PERSIST_LAYOUT);
+ TRG_TREE_VIEW_PERSIST_SORT |
+ TRG_TREE_VIEW_PERSIST_LAYOUT);
if (priv->trackersTv)
trg_tree_view_persist(TRG_TREE_VIEW(priv->trackersTv),
- TRG_TREE_VIEW_PERSIST_SORT | TRG_TREE_VIEW_PERSIST_LAYOUT);
+ TRG_TREE_VIEW_PERSIST_SORT |
+ TRG_TREE_VIEW_PERSIST_LAYOUT);
if (res_id != GTK_RESPONSE_OK) {
- gtk_widget_destroy(GTK_WIDGET(dialog) );
+ gtk_widget_destroy(GTK_WIDGET(dialog));
json_array_unref(priv->targetIds);
return;
}
@@ -160,28 +163,29 @@ static void trg_torrent_props_response_cb(GtkDialog * dialog, gint res_id,
args = node_get_arguments(request);
json_object_set_int_member(args, FIELD_SEED_RATIO_MODE,
- gtk_combo_box_get_active(GTK_COMBO_BOX
- (priv->
- seedRatioMode) ));
+ gtk_combo_box_get_active(GTK_COMBO_BOX
+ (priv->seedRatioMode)));
json_object_set_int_member(args, FIELD_BANDWIDTH_PRIORITY,
- gtk_combo_box_get_active(GTK_COMBO_BOX
- (priv->
- bandwidthPriorityCombo) ) - 1);
+ gtk_combo_box_get_active(GTK_COMBO_BOX
+ (priv->bandwidthPriorityCombo))
+ - 1);
trg_json_widgets_save(priv->widgets, args);
trg_json_widget_desc_list_free(priv->widgets);
- dispatch_async(priv->client, request, on_generic_interactive_action, priv->parent);
+ dispatch_async(priv->client, request, on_generic_interactive_action,
+ priv->parent);
if (priv->show_details) {
TrgPrefs *prefs = trg_client_get_prefs(priv->client);
gint width, height;
- gtk_window_get_size (GTK_WINDOW(dialog), &width, &height);
+ gtk_window_get_size(GTK_WINDOW(dialog), &width, &height);
trg_prefs_set_int(prefs, "dialog-width", width, TRG_PREFS_GLOBAL);
- trg_prefs_set_int(prefs, "dialog-height", height, TRG_PREFS_GLOBAL);
+ trg_prefs_set_int(prefs, "dialog-height", height,
+ TRG_PREFS_GLOBAL);
}
- gtk_widget_destroy(GTK_WIDGET(dialog) );
+ gtk_widget_destroy(GTK_WIDGET(dialog));
}
static void seed_ratio_mode_changed_cb(GtkWidget * w, gpointer data)
@@ -467,22 +471,28 @@ static GtkWidget *trg_props_limits_page_new(TrgTorrentPropsDialog * win,
return t;
}
-static void models_updated(TrgTorrentModel * model, gpointer data) {
+static void models_updated(TrgTorrentModel * model, gpointer data)
+{
TrgTorrentPropsDialogPrivate *priv = GET_PRIVATE(data);
GHashTable *ht = get_torrent_table(model);
gint64 serial = trg_client_get_serial(priv->client);
JsonObject *t = NULL;
GtkTreeIter iter;
gboolean exists = get_torrent_data(ht,
- json_array_get_int_element(priv->targetIds, 0), &t, &iter);
+ json_array_get_int_element(priv->
+ targetIds,
+ 0), &t,
+ &iter);
if (exists && priv->lastJson != t) {
- trg_files_model_update(priv->filesModel, GTK_TREE_VIEW(priv->filesTv),
- serial, t, TORRENT_GET_MODE_UPDATE);
- trg_peers_model_update(priv->peersModel, TRG_TREE_VIEW(priv->peersTv),
- serial, t, TORRENT_GET_MODE_UPDATE);
+ trg_files_model_update(priv->filesModel,
+ GTK_TREE_VIEW(priv->filesTv), serial, t,
+ TORRENT_GET_MODE_UPDATE);
+ trg_peers_model_update(priv->peersModel,
+ TRG_TREE_VIEW(priv->peersTv), serial, t,
+ TORRENT_GET_MODE_UPDATE);
trg_trackers_model_update(priv->trackersModel, serial, t,
- TORRENT_GET_MODE_UPDATE);
+ TORRENT_GET_MODE_UPDATE);
info_page_update(TRG_TORRENT_PROPS_DIALOG(data), t, model, &iter);
}
@@ -513,7 +523,7 @@ static GObject *trg_torrent_props_dialog_constructor(GType type,
gint rowCount = gtk_tree_selection_count_selected_rows(selection);
TrgPrefs *prefs = trg_client_get_prefs(priv->client);
priv->show_details = trg_prefs_get_int(prefs, TRG_PREFS_KEY_STYLE,
- TRG_PREFS_GLOBAL) !=
+ TRG_PREFS_GLOBAL) !=
TRG_STYLE_CLASSIC && rowCount == 1;
gint64 width, height;
@@ -632,8 +642,12 @@ static GObject *trg_torrent_props_dialog_constructor(GType type,
if (priv->show_details) {
TrgPrefs *prefs = trg_client_get_prefs(priv->client);
- if ((width = trg_prefs_get_int(prefs, "dialog-width", TRG_PREFS_GLOBAL)) <= 0
- || (height = trg_prefs_get_int(prefs, "dialog-height", TRG_PREFS_GLOBAL)) <= 0) {
+ if ((width =
+ trg_prefs_get_int(prefs, "dialog-width",
+ TRG_PREFS_GLOBAL)) <= 0
+ || (height =
+ trg_prefs_get_int(prefs, "dialog-height",
+ TRG_PREFS_GLOBAL)) <= 0) {
width = 700;
height = 600;
}
diff --git a/src/trg-torrent-props-dialog.h b/src/trg-torrent-props-dialog.h
index bb15bdb..504f172 100644
--- a/src/trg-torrent-props-dialog.h
+++ b/src/trg-torrent-props-dialog.h
@@ -50,7 +50,8 @@ GType trg_torrent_props_dialog_get_type(void);
TrgTorrentPropsDialog *trg_torrent_props_dialog_new(GtkWindow * window,
TrgTorrentTreeView *
treeview,
- TrgTorrentModel *torrentModel,
+ TrgTorrentModel *
+ torrentModel,
TrgClient * client);
G_END_DECLS
diff --git a/src/trg-torrent-tree-view.h b/src/trg-torrent-tree-view.h
index 4f70c75..394bebe 100644
--- a/src/trg-torrent-tree-view.h
+++ b/src/trg-torrent-tree-view.h
@@ -50,7 +50,7 @@ typedef struct {
GType trg_torrent_tree_view_get_type(void);
-TrgTorrentTreeView *trg_torrent_tree_view_new(TrgClient *tc,
+TrgTorrentTreeView *trg_torrent_tree_view_new(TrgClient * tc,
GtkTreeModel * model);
JsonArray *build_json_id_array(TrgTorrentTreeView * tv);
diff --git a/src/trg-trackers-tree-view.h b/src/trg-trackers-tree-view.h
index 95170b7..a7684d8 100644
--- a/src/trg-trackers-tree-view.h
+++ b/src/trg-trackers-tree-view.h
@@ -53,7 +53,7 @@ GType trg_trackers_tree_view_get_type(void);
TrgTrackersTreeView *trg_trackers_tree_view_new(TrgTrackersModel * model,
TrgClient * client,
TrgMainWindow * win,
- const gchar *configId);
+ const gchar * configId);
void trg_trackers_tree_view_new_connection(TrgTrackersTreeView * tv,
TrgClient * tc);
diff --git a/src/trg-tree-view.c b/src/trg-tree-view.c
index 3258d94..3f7a289 100644
--- a/src/trg-tree-view.c
+++ b/src/trg-tree-view.c
@@ -425,7 +425,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer, "text",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
@@ -434,7 +435,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer,
"speed-value",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
case TRG_COLTYPE_EPOCH:
@@ -442,7 +444,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer,
"epoch-value",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
case TRG_COLTYPE_ETA:
@@ -450,7 +453,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer,
"eta-value",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
case TRG_COLTYPE_SIZE:
@@ -458,7 +462,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer,
"size-value",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
case TRG_COLTYPE_PROG:
@@ -466,7 +471,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer,
"value",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
case TRG_COLTYPE_RATIO:
@@ -474,7 +480,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer,
"ratio-value",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
case TRG_COLTYPE_WANTED:
@@ -499,7 +506,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer,
"priority-value",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
case TRG_COLTYPE_NUMGTZERO:
@@ -507,7 +515,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer,
"value",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
case TRG_COLTYPE_NUMGTEQZERO:
@@ -515,7 +524,8 @@ trg_tree_view_add_column_after(TrgTreeView * tv,
column = gtk_tree_view_column_new_with_attributes(desc->header,
renderer,
"value",
- desc->model_column,
+ desc->
+ model_column,
NULL);
break;
default:
@@ -692,7 +702,8 @@ void trg_tree_view_setup_columns(TrgTreeView * tv)
json_node_get_string
((JsonNode
*)
- cli->data));
+ cli->
+ data));
if (desc) {
gint64 width = json_node_get_int((JsonNode *) wli->data);
trg_tree_view_add_column(tv, desc, width);
diff --git a/src/trg-tree-view.h b/src/trg-tree-view.h
index 3f410f2..f2b4965 100644
--- a/src/trg-tree-view.h
+++ b/src/trg-tree-view.h
@@ -91,14 +91,14 @@ trg_column_description *trg_tree_view_reg_column(TrgTreeView * tv,
gint type,
gint model_column,
const gchar * header,
- const gchar * id, guint flags);
+ const gchar * id,
+ guint flags);
void trg_tree_view_setup_columns(TrgTreeView * tv);
void trg_tree_view_set_prefs(TrgTreeView * tv, TrgPrefs * prefs);
void trg_tree_view_persist(TrgTreeView * tv, guint flags);
-void trg_tree_view_remove_all_columns(TrgTreeView *tv);
-void trg_tree_view_restore_sort(TrgTreeView * tv,
- guint flags);
-GtkWidget *trg_tree_view_sort_menu(TrgTreeView *tv, const gchar *label);
+void trg_tree_view_remove_all_columns(TrgTreeView * tv);
+void trg_tree_view_restore_sort(TrgTreeView * tv, guint flags);
+GtkWidget *trg_tree_view_sort_menu(TrgTreeView * tv, const gchar * label);
gboolean trg_tree_view_is_column_showing(TrgTreeView * tv, gint index);
#endif /* _TRG_TREE_VIEW_H_ */
diff --git a/src/util.h b/src/util.h
index adef7cf..f55b736 100644
--- a/src/util.h
+++ b/src/util.h
@@ -55,7 +55,7 @@ GRegex *trg_uri_host_regex_new(void);
gchar *trg_gregex_get_first(GRegex * rx, const gchar * uri);
gchar *make_error_message(JsonObject * response, int status);
void trg_error_dialog(GtkWindow * parent, trg_response * response);
-gchar *add_links_to_text(const gchar *original);
+gchar *add_links_to_text(const gchar * original);
void
tr_formatter_size_init(unsigned int kilo,
@@ -84,8 +84,7 @@ size_t tr_strlcpy(char *dst, const void *src, size_t siz);
double tr_truncd(double x, int decimal_places);
int evutil_vsnprintf(char *buf, size_t buflen, const char *format,
va_list ap);
-char*
-tr_strlsize( char * buf, guint64 bytes, size_t buflen );
+char *tr_strlsize(char *buf, guint64 bytes, size_t buflen);
void rm_trailing_slashes(gchar * str);
void trg_widget_set_visible(GtkWidget * w, gboolean visible);
gchar *trg_base64encode(const gchar * filename);
@@ -101,7 +100,7 @@ GtkWidget *trg_hbox_new(gboolean homogeneous, gint spacing);
gboolean is_unity();
#ifdef WIN32
-gchar *trg_win32_support_path(gchar *file);
+gchar *trg_win32_support_path(gchar * file);
#endif
#endif /* UTIL_H_ */