[gnome-clocks/wip/cityimages] Clean up code



commit 6a7d3545da0d53b1ffa4ada3a1ca97efb1e6a4e2
Author: Evgeny Bobkin <evgen ibqn gmail com>
Date:   Tue Sep 17 09:09:13 2013 +0200

    Clean up code

 src/providers.vala |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/providers.vala b/src/providers.vala
index 302e8be..e2375fa 100644
--- a/src/providers.vala
+++ b/src/providers.vala
@@ -59,7 +59,6 @@ public class LocalImageProvider : GLib.Object, ImageProvider {
         File folder = File.new_for_path (folder_path);
 
         if (!folder.query_exists ()) {
-            stdout.printf( "creating a city-images directory\n");
             try {
                 folder.make_directory_with_parents ();
             } catch (Error e) {
@@ -69,16 +68,16 @@ public class LocalImageProvider : GLib.Object, ImageProvider {
 
         try {
             monitor = folder.monitor_directory (FileMonitorFlags.NONE, null);
-            stdout.printf ("Monitoring: %s\n", folder.get_path ());
 
             monitor.changed.connect ((src, dest, event) => {
+            /*
                 if (dest != null) {
                     stdout.printf ("%s: %s, %s\n", event.to_string (),
                                    src.get_path (), dest.get_path ());
                 } else {
                     stdout.printf ("%s: %s\n", event.to_string (), src.get_path ());
                 }
-
+            */
                 image_updated (src.get_path ());
             });
         } catch (Error err) {
@@ -123,7 +122,7 @@ private class FlickrClient : GLib.Object {
     private async Json.Object? get_root_object (string message) {
         GLib.InputStream stream;
 
-        string msg = query_message + message; // stdout.printf (@"$msg\n");
+        string msg = query_message + message;
         var query = new Soup.Message ("GET", msg);
 
         try {
@@ -239,7 +238,6 @@ public class FlickrImageProvider : GLib.Object, ImageProvider {
         File folder = File.new_for_path (folder_path);
 
         if (!folder.query_exists ()) {
-            stdout.printf( "creating a flickr directory\n");
             try {
                 folder.make_directory_with_parents ();
             } catch (Error e) {
@@ -306,14 +304,11 @@ public class FlickrImageProvider : GLib.Object, ImageProvider {
         var source = File.new_for_uri (uri);
         var target = File.new_for_path (target_path);
 
-        GLib.AtomicInt.inc (ref downloading);
         try {
             yield source.copy_async (target, FileCopyFlags.OVERWRITE);
         } catch (Error e) {
             warning ("Copying an image has failed: %s", e.message);
             return;
-        } finally {
-            GLib.AtomicInt.dec_and_test (ref downloading);
         }
 
         image_updated (name);


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