Removed GKdbusClient class
authorLukasz Skalski <l.skalski@partner.samsung.com>
Fri, 27 Sep 2013 10:17:20 +0000 (12:17 +0200)
committerLukasz Skalski <l.skalski@partner.samsung.com>
Fri, 25 Oct 2013 14:36:17 +0000 (16:36 +0200)
gio/Makefile.am
gio/gdbusaddress.c
gio/gkdbusclient.c [deleted file]
gio/gkdbusclient.h [deleted file]
gio/gkdbusconnection.c
gio/gkdbusconnection.h

index 022e5fe..bd18e3a 100644 (file)
@@ -384,8 +384,7 @@ libgio_2_0_la_SOURCES =             \
        giomodule-priv.h        \
        gioscheduler.c          \
        giostream.c             \
-        gkdbus.c                \
-       gkdbusclient.c          \
+    gkdbus.c                \
        gkdbusconnection.c      \
        gloadableicon.c         \
        gmount.c                \
@@ -558,8 +557,7 @@ gio_headers =                       \
        giomodule.h             \
        gioscheduler.h          \
        giostream.h             \
-        gkdbus.h                \
-       gkdbusclient.h          \
+    gkdbus.h                \
        gkdbusconnection.h      \
        gloadableicon.h         \
        gmount.h                \
index 2d81b41..06a2292 100644 (file)
@@ -34,8 +34,7 @@
 #include "gioenumtypes.h"
 #include "gnetworkaddress.h"
 #include "gsocketclient.h"
-#include "gkdbusclient.h"
-#include "giostream.h"
+#include "gkdbusconnection.h"
 #include "gasyncresult.h"
 #include "gsimpleasyncresult.h"
 #include "glib-private.h"
@@ -690,20 +689,18 @@ g_dbus_address_connect (const gchar   *address_entry,
 
       if (g_strcmp0 (transport_name, "kdbus") == 0)
         {
-          GKdbusClient *client;
           GKdbusConnection *connection;
 
           const gchar *path;
           path = g_hash_table_lookup (key_value_pairs, "path");
           
           g_assert (ret == NULL);
-          client = g_kdbus_client_new ();
-          connection = g_kdbus_client_connect (client,
-                                               path,
-                                               cancellable,
-                                               error);
+          connection = g_kdbus_connection_new ();
+          g_kdbus_connection_connect (connection,
+                                      path,
+                                      cancellable,
+                                      error);
           g_object_unref (connectable);
-          g_object_unref (client);
           if (connection == NULL)
             goto out;
 
diff --git a/gio/gkdbusclient.c b/gio/gkdbusclient.c
deleted file mode 100644 (file)
index f253178..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*  GIO - GLib Input, Output and Streaming Library
- *
- * Copyright © 2013 Samsung
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Lukasz Skalski <l.skalski@partner.samsung.com>
- * Authors: Michal Eljasiewicz <m.eljasiewic@samsung.com>
- */
-
-#include "config.h"
-#include "gkdbusclient.h"
-#include <gio/gkdbusconnection.h>
-
-G_DEFINE_TYPE (GKdbusClient, g_kdbus_client, G_TYPE_OBJECT);
-
-struct _GKdbusClientPrivate
-{
-  GHashTable *app_proxies;
-};
-
-
-// TODO
-static void
-g_kdbus_client_init (GKdbusClient *client)
-{
-  client->priv = G_TYPE_INSTANCE_GET_PRIVATE (client,
-                                             G_TYPE_KDBUS_CLIENT,
-                                             GKdbusClientPrivate);
-  client->priv->app_proxies = g_hash_table_new_full (g_str_hash,
-                                                    g_str_equal,
-                                                    g_free,
-                                                    NULL);
-}
-
-// TODO
-GKdbusClient *
-g_kdbus_client_new (void)
-{
-  return g_object_new (G_TYPE_KDBUS_CLIENT, NULL);
-}
-
-// TODO
-static void
-g_kdbus_client_finalize (GObject *object)
-{
-  GKdbusClient *client = G_KDBUS_CLIENT (object);
-
-  g_hash_table_unref (client->priv->app_proxies);
-}
-
-// TODO
-static void
-g_kdbus_client_get_property (GObject    *object,
-                             guint       prop_id,
-                             GValue     *value,
-                             GParamSpec *pspec)
-{
-  //GKdbusClient *client = G_KDBUS_CLIENT (object);
-
-  switch (prop_id)
-    {
-      default:
-       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-    }
-}
-
-// TODO
-static void
-g_kdbus_client_set_property (GObject      *object,
-                             guint         prop_id,
-                             const GValue *value,
-                             GParamSpec   *pspec)
-{
-  //GKdbusClient *client = G_KDBUS_CLIENT (object);
-
-  switch (prop_id)
-    {
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-    }
-}
-
-// TODO
-static void
-g_kdbus_client_class_init (GKdbusClientClass *class)
-{
-  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-
-  g_type_class_add_private (class, sizeof (GKdbusClientPrivate));
-
-  gobject_class->finalize = g_kdbus_client_finalize;
-  gobject_class->set_property = g_kdbus_client_set_property;
-  gobject_class->get_property = g_kdbus_client_get_property;
-}
-
-// TODO
-GKdbusConnection *
-g_kdbus_client_connect (GKdbusClient       *client,
-                        const gchar       *address,
-                        GCancellable      *cancellable,
-                        GError            **error)
-{
-  GIOStream *connection = NULL;
-  GError *last_error;
-  last_error = NULL;
-
-  while (connection == NULL)
-    {
-
-    if (g_cancellable_is_cancelled (cancellable))
-      {
-           g_clear_error (error);
-           g_cancellable_set_error_if_cancelled (cancellable, error);
-           break;
-      }
-
-    connection = g_object_new(G_TYPE_KDBUS_CONNECTION,NULL);
-    if (g_kdbus_connection_connect (G_KDBUS_CONNECTION (connection),
-                                      address, cancellable, &last_error))
-      {
-           //g_print("It works :)\n");
-      }
-    else
-         {
-           g_object_unref (connection);
-           connection = NULL;
-      }
-    }
-  return G_KDBUS_CONNECTION (connection);
-}
-
diff --git a/gio/gkdbusclient.h b/gio/gkdbusclient.h
deleted file mode 100644 (file)
index 329c274..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*  GIO - GLib Input, Output and Streaming Library
- *
- * Copyright © 2013 Samsung
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Lukasz Skalski <l.skalski@partner.samsung.com>
- * Authors: Michal Eljasiewicz <m.eljasiewic@samsung.com>
- */
-
-#ifndef __G_KDBUS_CLIENT_H__
-#define __G_KDBUS_CLIENT_H__
-
-#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
-#error "Only <gio/gio.h> can be included directly."
-#endif
-
-#include <glib-object.h>
-#include <gio/giotypes.h>
-
-G_BEGIN_DECLS
-
-#define G_TYPE_KDBUS_CLIENT                                (g_kdbus_client_get_type ())
-#define G_KDBUS_CLIENT(inst)                               (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
-                                                             G_TYPE_KDBUS_CLIENT, GKdbusClient))
-#define G_KDBUS_CLIENT_CLASS(class)                        (G_TYPE_CHECK_CLASS_CAST ((class),                       \
-                                                             G_TYPE_KDBUS_CLIENT, GKdbusClientClass))
-#define G_IS_KDBUS_CLIENT(inst)                            (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
-                                                             G_TYPE_KDBUS_CLIENT))
-#define G_IS_KDBUS_CLIENT_CLASS(class)                     (G_TYPE_CHECK_CLASS_TYPE ((class),                       \
-                                                             G_TYPE_KDBUS_CLIENT))
-#define G_KDBUS_CLIENT_GET_CLASS(inst)                     (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
-                                                             G_TYPE_KDBUS_CLIENT, GKdbusClientClass))
-
-typedef struct _GKdbusClientPrivate                        GKdbusClientPrivate;
-typedef struct _GKdbusClientClass                          GKdbusClientClass;
-
-struct _GKdbusClientClass
-{
-  GObjectClass parent_class;
-
-  /* Padding for future expansion */
-  void (*_g_reserved1) (void);
-  void (*_g_reserved2) (void);
-  void (*_g_reserved3) (void);
-  void (*_g_reserved4) (void);
-};
-
-struct _GKdbusClient
-{
-  GObject parent_instance;
-  GKdbusClientPrivate *priv;
-};
-
-GLIB_AVAILABLE_IN_ALL
-GType                   g_kdbus_client_get_type                        (void) G_GNUC_CONST;
-
-GLIB_AVAILABLE_IN_ALL
-GKdbusClient           *g_kdbus_client_new                             (void);
-
-
-GLIB_AVAILABLE_IN_ALL
-GKdbusConnection *     g_kdbus_client_connect                          (GKdbusClient        *client,
-                                                                         const gchar        *address,
-                                                                         GCancellable       *cancellable,
-                                                                         GError             **error);
-
-G_END_DECLS
-
-#endif /* __G_KDBUS_CLIENT_H___ */
index 1390705..0631c44 100644 (file)
@@ -48,6 +48,13 @@ struct _GKdbusConnectionPrivate
 };
 
 // TODO
+GKdbusConnection *
+g_kdbus_connection_new (void)
+{
+  return g_object_new(G_TYPE_KDBUS_CONNECTION,NULL);
+}
+
+// TODO
 gboolean
 g_kdbus_connection_connect (GKdbusConnection   *connection,
                            const gchar        *address,
@@ -156,7 +163,6 @@ g_kdbus_connection_class_init (GKdbusConnectionClass *klass)
 static void
 g_kdbus_connection_init (GKdbusConnection *connection)
 {
-  //connection->kdbus = g_object_new(G_TYPE_KDBUS,NULL);
   connection->priv = G_TYPE_INSTANCE_GET_PRIVATE (connection,
                                                   G_TYPE_KDBUS_CONNECTION,
                                                   GKdbusConnectionPrivate);
index c7f91d3..17a4bfc 100644 (file)
@@ -71,6 +71,8 @@ struct _GKdbusConnection
 GLIB_AVAILABLE_IN_ALL
 GType              g_kdbus_connection_get_type                  (void) G_GNUC_CONST;
 GLIB_AVAILABLE_IN_ALL
+GKdbusConnection   *g_kdbus_connection_new                      (void);
+GLIB_AVAILABLE_IN_ALL
 gboolean           g_kdbus_connection_is_connected              (GKdbusConnection  *connection);
 GLIB_AVAILABLE_IN_ALL
 gboolean           g_kdbus_connection_connect                   (GKdbusConnection  *connection,