summaryrefslogtreecommitdiff
path: root/src/torrent.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <alan@eth0.org.uk>2012-08-23 14:27:34 +0100
committerGravatar Alan Fitton <alan@eth0.org.uk>2012-08-23 14:27:34 +0100
commite5e0975a6302924c06da9426fca637950011ed20 (patch)
treed72100dd7be031ce6c8279766f124bd9a06e8331 /src/torrent.c
parentfd6f3356d27d3e3b6f0506b76e0a381efed7e3ef (diff)
improvements to new cell renderer branch
Diffstat (limited to 'src/torrent.c')
-rw-r--r--src/torrent.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/torrent.c b/src/torrent.c
index e86cda8..d605835 100644
--- a/src/torrent.c
+++ b/src/torrent.c
@@ -282,7 +282,7 @@ torrent_get_flags(JsonObject * t, gint64 rpcv, gint64 status,
flags |= TORRENT_FLAG_ACTIVE;
}
- if (strlen(torrent_get_errorstr(t)) > 0)
+ if (torrent_get_error(t) > 0)
flags |= TORRENT_FLAG_ERROR;
return flags;
@@ -320,6 +320,14 @@ const gchar *torrent_get_errorstr(JsonObject * t)
return json_object_get_string_member(t, FIELD_ERRORSTR);
}
+gint64 torrent_get_error(JsonObject *t)
+{
+ if (!json_object_has_member(t, FIELD_ERROR))
+ return 0;
+ else
+ return json_object_get_int_member(t, FIELD_ERROR);
+}
+
gchar *torrent_get_status_string(gint64 rpcv, gint64 value, guint flags)
{
if (rpcv >= NEW_STATUS_RPC_VERSION) {
@@ -420,7 +428,6 @@ JsonArray *get_torrents(JsonObject * response)
JsonArray *torrent_get_files(JsonObject * args)
{
- g_assert(json_object_get_array_member(args, FIELD_FILES));
return json_object_get_array_member(args, FIELD_FILES);
}