summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2012-01-15 15:27:04 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2012-01-15 15:27:04 +0000
commitd50ff75ea10e3a928ec769efae4c697f300b2e55 (patch)
treee4f2968c361046acf2ff5355a0ac3aa95560c51a
parent48b4d1af4186442fa282d0fba8440bc0f61dc7a9 (diff)
parse the version out of the version string using locale agnostic g_ascii_strtod instead of sscanf, which would only pick up the integer component with a locale which used a different radix character.
-rw-r--r--AUTHORS2
-rw-r--r--ChangeLog2
-rw-r--r--README4
-rw-r--r--debian/changelog6
-rw-r--r--redhat/transmission-remote-gtk.spec2
-rw-r--r--src/session-get.c6
-rw-r--r--src/session-get.h2
-rw-r--r--src/trg-client.c6
-rw-r--r--src/trg-client.h2
-rw-r--r--src/trg-main-window.c7
-rw-r--r--src/trg-status-bar.c7
11 files changed, 27 insertions, 19 deletions
diff --git a/AUTHORS b/AUTHORS
index 829278c..fb776c1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -16,3 +16,5 @@ translations kindly contributed by
* Y3AVD (Russian)
* ROR191 (Ukranian)
* aspidzent (Spanish)
+ * Pierre Rudloff (French)
+ * Algimantas Margevičius (Lithuanian)
diff --git a/ChangeLog b/ChangeLog
index e0f59a5..1974f80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-* Sat Jan 14 2011 1.0
+* Sun Jan 15 2011 1.0
- Show files in a tree.
- Consistency/code share in files tree view and add dialog tree view.
- A lot of optimisation for building either files tree view.
diff --git a/README b/README
index 463cd97..8334967 100644
--- a/README
+++ b/README
@@ -10,8 +10,8 @@ BUILDING
Building a Transmission release from the command line:
- $ tar zxfv transmission-remote-gtk-0.1.0.tar.gz
- $ cd transmission-0.1.0
+ $ tar zxfv transmission-remote-gtk-1.0.tar.gz
+ $ cd transmission-remote-gtk-1.0
$ ./configure
$ make
$ sudo make install
diff --git a/debian/changelog b/debian/changelog
index 3588f7e..c3e9fe1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+transmission-remote-gtk (1.0-1) stable; urgency=low
+
+ * New upstream release 1.0
+
+ -- Alan Fitton <alan@eth0.org.uk> Fri, 09 Dec 2011 13:13:56 +0000
+
transmission-remote-gtk (0.8-1) stable; urgency=low
* New upstream release 0.8
diff --git a/redhat/transmission-remote-gtk.spec b/redhat/transmission-remote-gtk.spec
index bdbba7c..a44aa96 100644
--- a/redhat/transmission-remote-gtk.spec
+++ b/redhat/transmission-remote-gtk.spec
@@ -70,7 +70,7 @@ fi
%changelog
-* Fri Dec 23 2011 Alan Fitton <alan@eth0.org.uk> 1.0-1
+* Fri Jan 15 2012 Alan Fitton <alan@eth0.org.uk> 1.0-1
- New release.
* Fri Dec 09 2011 Alan Fitton <alan@eth0.org.uk> 0.8-1
diff --git a/src/session-get.c b/src/session-get.c
index 7cd84d8..7f4dd9c 100644
--- a/src/session-get.c
+++ b/src/session-get.c
@@ -31,9 +31,11 @@ const gchar *session_get_version_string(JsonObject * s)
return json_object_get_string_member(s, SGET_VERSION);
}
-int session_get_version(JsonObject * s, float *version)
+gdouble session_get_version(JsonObject * s)
{
- return sscanf(session_get_version_string(s), "%g", version);
+ const gchar *versionString = session_get_version_string(s);
+ gchar *spaceChar = g_strrstr(" ", versionString);
+ return g_ascii_strtod(versionString, &spaceChar);
}
gint64 session_get_download_dir_free_space(JsonObject * s)
diff --git a/src/session-get.h b/src/session-get.h
index 47edb07..c18163a 100644
--- a/src/session-get.h
+++ b/src/session-get.h
@@ -76,7 +76,7 @@ const gchar *session_get_torrent_done_filename(JsonObject * s);
gboolean session_get_torrent_done_enabled(JsonObject * s);
gint64 session_get_cache_size_mb(JsonObject * s);
const gchar *session_get_version_string(JsonObject * s);
-int session_get_version(JsonObject * s, float *version);
+gdouble session_get_version(JsonObject * s);
gboolean session_get_pex_enabled(JsonObject * s);
gboolean session_get_lpd_enabled(JsonObject * s);
const gchar *session_get_download_dir(JsonObject * s);
diff --git a/src/trg-client.c b/src/trg-client.c
index a2c09b8..f5e86e5 100644
--- a/src/trg-client.c
+++ b/src/trg-client.c
@@ -75,7 +75,7 @@ struct _TrgClientPrivate {
gint64 updateSerial;
JsonObject *session;
gboolean ssl;
- float version;
+ gdouble version;
char *url;
char *username;
char *password;
@@ -175,7 +175,7 @@ const gchar *trg_client_get_version_string(TrgClient * tc)
return session_get_version_string(priv->session);
}
-float trg_client_get_version(TrgClient * tc)
+gdouble trg_client_get_version(TrgClient * tc)
{
TrgClientPrivate *priv = TRG_CLIENT_GET_PRIVATE(tc);
return priv->version;
@@ -200,7 +200,7 @@ void trg_client_set_session(TrgClient * tc, JsonObject * session)
if (priv->session) {
json_object_unref(priv->session);
} else {
- session_get_version(session, &priv->version);
+ priv->version = session_get_version(session);
}
priv->session = session;
diff --git a/src/trg-client.h b/src/trg-client.h
index 3609f34..d73a5a7 100644
--- a/src/trg-client.h
+++ b/src/trg-client.h
@@ -129,7 +129,7 @@ TrgClient *trg_client_new(void);
TrgPrefs *trg_client_get_prefs(TrgClient * tc);
int trg_client_populate_with_settings(TrgClient * tc);
void trg_client_set_session(TrgClient * tc, JsonObject * session);
-float trg_client_get_version(TrgClient * tc);
+gdouble trg_client_get_version(TrgClient * tc);
const gchar *trg_client_get_version_string(TrgClient * tc);
gint64 trg_client_get_rpc_version(TrgClient * tc);
gchar *trg_client_get_password(TrgClient * tc);
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index dd686f2..95b2367 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -1013,7 +1013,7 @@ static gboolean on_session_get(gpointer data)
newSession = get_arguments(response->obj);
if (!isConnected) {
- float version;
+ gdouble version;
if (trg_dialog_error_handler(win, response) == TRUE) {
trg_response_free(response);
@@ -1021,11 +1021,10 @@ static gboolean on_session_get(gpointer data)
return FALSE;
}
- if (session_get_version(newSession, &version) == 0
- || version < TRANSMISSION_MIN_SUPPORTED) {
+ if ((version = session_get_version(newSession)) < TRANSMISSION_MIN_SUPPORTED) {
gchar *msg =
g_strdup_printf(_
- ("This application supports Transmission %.2f and later, you have %.2f."),
+ ("This application supports Transmission %g and later, you have %g."),
TRANSMISSION_MIN_SUPPORTED, version);
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win),
GTK_DIALOG_MODAL,
diff --git a/src/trg-status-bar.c b/src/trg-status-bar.c
index 464233c..0f0b293 100644
--- a/src/trg-status-bar.c
+++ b/src/trg-status-bar.c
@@ -132,16 +132,15 @@ void trg_status_bar_connect(TrgStatusBar * sb, JsonObject * session, TrgClient *
{
TrgStatusBarPrivate *priv = TRG_STATUS_BAR_GET_PRIVATE(sb);
TrgPrefs *prefs = trg_client_get_prefs(client);
- gchar *statusMsg;
- float version;
+ gdouble version = session_get_version(session);
- session_get_version(session, &version);
- statusMsg =
+ gchar *statusMsg =
g_strdup_printf(_
("Connected: %s (Transmission %g)"),
trg_prefs_get_string(prefs, TRG_PREFS_KEY_PROFILE_NAME, TRG_PREFS_CONNECTION),
version);
g_message("%s", statusMsg);
+
trg_status_bar_push_connection_msg(sb, statusMsg);
g_free(statusMsg);