summaryrefslogtreecommitdiff
path: root/src/trg-client.c
diff options
context:
space:
mode:
authorGravatar Alan <alan@ajfx200.localdomain>2012-08-24 14:19:50 +0100
committerGravatar Alan <alan@ajfx200.localdomain>2012-08-24 14:19:50 +0100
commitb0ad42a97cc5fb962d229b9c9743989e2f47216f (patch)
treed0e6cb0619e391e6d347c76b844f6ad83421a85c /src/trg-client.c
parente5e0975a6302924c06da9426fca637950011ed20 (diff)
consider seed ratios in the new cell renderer like Transmisson does, as well as some other scenarios so it behaves almost like the Transmission. lots of new fields added to the model for this.
Diffstat (limited to 'src/trg-client.c')
-rw-r--r--src/trg-client.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/trg-client.c b/src/trg-client.c
index 77afe2d..970fb46 100644
--- a/src/trg-client.c
+++ b/src/trg-client.c
@@ -83,6 +83,8 @@ struct _TrgClientPrivate {
GPrivate *tlsKey;
gint configSerial;
GMutex *configMutex;
+ gboolean seedRatioLimited;
+ gdouble seedRatioLimit;
};
static void dispatch_async_threadfunc(trg_request * reqrsp,
@@ -203,6 +205,9 @@ void trg_client_set_session(TrgClient * tc, JsonObject * session)
priv->session = session;
json_object_ref(session);
+ priv->seedRatioLimit = session_get_seed_ratio_limit(session);
+ priv->seedRatioLimited = session_get_seed_ratio_limited(session);
+
g_signal_emit(tc, signals[TC_SESSION_UPDATED], 0, session);
}
@@ -696,3 +701,13 @@ gboolean trg_client_update_session(TrgClient *tc, GSourceFunc callback, gpointer
return dispatch_async(tc, session_get(), callback,
data);
}
+
+gdouble trg_client_get_seed_ratio_limit(TrgClient *tc)
+{
+ return tc->priv->seedRatioLimit;
+}
+
+gboolean trg_client_get_seed_ratio_limited(TrgClient *tc)
+{
+ return tc->priv->seedRatioLimited;
+}