[Xfce4-commits] <midori:master> Remove obsolete KatzeNet instanciation

Christian Dywan noreply at xfce.org
Thu Aug 30 00:44:03 CEST 2012


Updating branch refs/heads/master
         to 1c1fd1740e4053ba7e5e5ee8b6d4832523c60299 (commit)
       from f5d0c3ad5d9c7e91805393a2d4727a0e89063451 (commit)

commit 1c1fd1740e4053ba7e5e5ee8b6d4832523c60299
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Aug 29 20:27:47 2012 +0200

    Remove obsolete KatzeNet instanciation

 katze/katze-net.c |   40 ++++++++++------------------------------
 katze/katze-net.h |    2 --
 2 files changed, 10 insertions(+), 32 deletions(-)

diff --git a/katze/katze-net.c b/katze/katze-net.c
index 63b5e60..10b55bf 100644
--- a/katze/katze-net.c
+++ b/katze/katze-net.c
@@ -27,8 +27,6 @@
 struct _KatzeNet
 {
     GObject parent_instance;
-
-    guint cache_size;
 };
 
 struct _KatzeNetClass
@@ -61,23 +59,6 @@ katze_net_finalize (GObject* object)
     G_OBJECT_CLASS (katze_net_parent_class)->finalize (object);
 }
 
-static KatzeNet*
-katze_net_new (void)
-{
-    static KatzeNet* net = NULL;
-
-    if (!net)
-    {
-        net = g_object_new (KATZE_TYPE_NET, NULL);
-        /* Since this is a "singleton", keep an extra reference */
-        g_object_ref (net);
-    }
-    else
-        g_object_ref (net);
-
-    return net;
-}
-
 typedef struct
 {
     KatzeNetStatusCb status_cb;
@@ -102,29 +83,28 @@ katze_net_get_cached_path (KatzeNet*    net,
                            const gchar* uri,
                            const gchar* subfolder)
 {
-    gchar* cache_path;
     gchar* checksum;
     gchar* extension;
     gchar* cached_filename;
     gchar* cached_path;
 
-    net = katze_net_new ();
-
-    if (subfolder)
-        cache_path = g_build_filename (midori_paths_get_cache_dir (), subfolder, NULL);
-    else
-        cache_path = midori_paths_get_cache_dir ();
-    katze_mkdir_with_parents (cache_path, 0700);
     checksum = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1);
-
     extension = g_strrstr (uri, ".");
     cached_filename = g_strdup_printf ("%s%s", checksum,
                                        extension ? extension : "");
     g_free (checksum);
-    cached_path = g_build_filename (cache_path, cached_filename, NULL);
-    g_free (cached_filename);
+
     if (subfolder)
+    {
+        gchar* cache_path = g_build_filename (midori_paths_get_cache_dir (), subfolder, NULL);
+        katze_mkdir_with_parents (cache_path, 0700);
+        cached_path = g_build_filename (cache_path, cached_filename, NULL);
         g_free (cache_path);
+    }
+    else
+        cached_path = g_build_filename (midori_paths_get_cache_dir (), cached_filename, NULL);
+
+    g_free (cached_filename);
     return cached_path;
 }
 
diff --git a/katze/katze-net.h b/katze/katze-net.h
index 5658ff4..eea2df4 100644
--- a/katze/katze-net.h
+++ b/katze/katze-net.h
@@ -14,8 +14,6 @@
 
 #include "katze-utils.h"
 
-#include <gtk/gtk.h>
-
 G_BEGIN_DECLS
 
 #define KATZE_TYPE_NET \


More information about the Xfce4-commits mailing list