summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2012-08-26 21:36:43 +0100
committerGravatar Alan Fitton <ajf@eth0.org.uk>2012-08-26 21:36:43 +0100
commit8ba9cdd592fdc47771c9b3bd8491db9d4510b5e7 (patch)
tree8d443330723920100a8f10a0162f28b96ed86ac1 /src
parent28b1af7e5d73f8bacc3dca76166138bc3d4d24a5 (diff)
fix units in torrent-cell-renderer, fix crash closing old style torrent properties
Diffstat (limited to 'src')
-rw-r--r--src/torrent-cell-renderer.c4
-rw-r--r--src/trg-torrent-props-dialog.c26
2 files changed, 16 insertions, 14 deletions
diff --git a/src/torrent-cell-renderer.c b/src/torrent-cell-renderer.c
index ab4eeeb..128473e 100644
--- a/src/torrent-cell-renderer.c
+++ b/src/torrent-cell-renderer.c
@@ -248,9 +248,9 @@ static char *getShortTransferString(TorrentCellRenderer * r,
const gboolean haveDown = haveMeta && priv->peersToUs > 0;
if (haveDown)
- tr_formatter_speed_KBps(downStr, priv->downSpeed, sizeof(downStr));
+ tr_formatter_speed_KBps(downStr, priv->downSpeed/speed_K, sizeof(downStr));
if (haveUp)
- tr_formatter_speed_KBps(upStr, priv->upSpeed, sizeof(upStr));
+ tr_formatter_speed_KBps(upStr, priv->upSpeed/speed_K, sizeof(upStr));
if (haveDown && haveUp)
/* 1==down arrow, 2==down speed, 3==up arrow, 4==down speed */
diff --git a/src/trg-torrent-props-dialog.c b/src/trg-torrent-props-dialog.c
index 97f2534..b237949 100644
--- a/src/trg-torrent-props-dialog.c
+++ b/src/trg-torrent-props-dialog.c
@@ -146,15 +146,17 @@ trg_torrent_props_response_cb(GtkDialog * dlg, gint res_id,
priv = TRG_TORRENT_PROPS_DIALOG_GET_PRIVATE(dlg);
- trg_tree_view_persist(TRG_TREE_VIEW(priv->peersTv),
- TRG_TREE_VIEW_PERSIST_SORT |
- TRG_TREE_VIEW_PERSIST_LAYOUT);
- trg_tree_view_persist(TRG_TREE_VIEW(priv->filesTv),
- TRG_TREE_VIEW_PERSIST_SORT |
- TRG_TREE_VIEW_PERSIST_LAYOUT);
- trg_tree_view_persist(TRG_TREE_VIEW(priv->trackersTv),
- TRG_TREE_VIEW_PERSIST_SORT |
- TRG_TREE_VIEW_PERSIST_LAYOUT);
+ 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(TRG_TREE_VIEW(priv->filesTv),
+ TRG_TREE_VIEW_PERSIST_SORT |
+ TRG_TREE_VIEW_PERSIST_LAYOUT);
+ trg_tree_view_persist(TRG_TREE_VIEW(priv->trackersTv),
+ TRG_TREE_VIEW_PERSIST_SORT |
+ TRG_TREE_VIEW_PERSIST_LAYOUT);
+ }
if (res_id != GTK_RESPONSE_OK) {
gtk_widget_destroy(GTK_WIDGET(dlg));
@@ -275,12 +277,12 @@ static void models_updated(TrgTorrentModel * model, gpointer data)
(ht, json_array_get_int_element(priv->targetIds, 0), &t, NULL)) {
trg_files_model_update(priv->filesModel,
GTK_TREE_VIEW(priv->filesTv), serial, t,
- TORRENT_GET_MODE_FIRST);
+ TORRENT_GET_MODE_UPDATE);
trg_peers_model_update(priv->peersModel,
TRG_TREE_VIEW(priv->peersTv), serial, t,
- TORRENT_GET_MODE_FIRST);
+ TORRENT_GET_MODE_UPDATE);
trg_trackers_model_update(priv->trackersModel, serial, t,
- TORRENT_GET_MODE_FIRST);
+ TORRENT_GET_MODE_UPDATE);
}
}