[shotwell] plugins: Small refactor



commit 79ea398faf71d0aa12b8b7e24e90a1a6b062cc1a
Author: Jens Georg <mail jensge org>
Date:   Sun Jun 12 18:40:03 2016 +0200

    plugins: Small refactor
    
    Signed-off-by: Jens Georg <mail jensge org>

 plugins/common/RESTSupport.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plugins/common/RESTSupport.vala b/plugins/common/RESTSupport.vala
index 0e08fe4..d23923c 100644
--- a/plugins/common/RESTSupport.vala
+++ b/plugins/common/RESTSupport.vala
@@ -130,6 +130,10 @@ public class Argument {
 
         return sorted_args.to_array();
     }
+
+    public string to_string () {
+        return "%s=%s".printf (this.key, this.value);
+    }
 }
 
 public class Transaction {
@@ -312,7 +316,7 @@ public class Transaction {
         // concatenate the REST arguments array into an HTTP formdata string
         string formdata_string = "";
         for (int i = 0; i < arguments.length; i++) {
-            formdata_string += ("%s=%s".printf(arguments[i].key, arguments[i].value));
+            formdata_string += arguments[i].to_string ();
             if (i < arguments.length - 1)
                 formdata_string += "&";
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]