[kazehakase-svn] [3813] * module/embed/per-process/kz-dbus-embed-delegate. c,

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Wed Sep 2 15:08:18 JST 2009


Revision: 3813
          http://sourceforge.jp/projects/kazehakase/svn/view?view=rev&revision=3813
Author:   ikezoe
Date:     2009-09-02 15:08:18 +0900 (Wed, 02 Sep 2009)

Log Message:
-----------
	* module/embed/per-process/kz-dbus-embed-delegate.c,
	module/embed/per-process/kz-embed-process.c: Use current_position in site liste.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c
    kazehakase/trunk/module/embed/per-process/kz-embed-process.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-09-02 05:15:56 UTC (rev 3812)
+++ kazehakase/trunk/ChangeLog	2009-09-02 06:08:18 UTC (rev 3813)
@@ -5,6 +5,8 @@
 	module/embed/per-process/kz-dbus-embed-delegate.c,
 	module/embed/per-process/kz-embed-process.c: get_history and set_history methods now take 
 	GList pointer which stores URI and title list.
+	* module/embed/per-process/kz-dbus-embed-delegate.c,
+	module/embed/per-process/kz-embed-process.c: Use current_position in site liste.
 
 2009-09-01  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c
===================================================================
--- kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c	2009-09-02 05:15:56 UTC (rev 3812)
+++ kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c	2009-09-02 06:08:18 UTC (rev 3813)
@@ -723,12 +723,6 @@
         return;
     }
 
-    /*
-    if (!org_kazehakase_Embed_load_uri(priv->proxy, uri, &error)) {
-        g_print("%s\n", error->message);
-        g_error_free(error);
-    }
-    */
     org_kazehakase_Embed_load_uri_async(priv->proxy, uri, cb_async, NULL);
 }
 
@@ -748,13 +742,8 @@
 static void                                                                         \
 method (KzEmbed *embed)                                                             \
 {                                                                                   \
-    GError *error = NULL;                                                           \
     KzDBusEmbedDelegatePrivate *priv = KZ_DBUS_EMBED_DELEGATE_GET_PRIVATE(embed);   \
-                                                                                    \
-    if (!org_kazehakase_Embed_ ## method(priv->proxy, &error)) {                    \
-        g_print("%s\n", error->message);                                            \
-        g_error_free(error);                                                        \
-    }                                                                               \
+    org_kazehakase_Embed_ ## method ## _async(priv->proxy, cb_async, NULL);         \
 }
 
 DEFINE_SIMPLE_METHOD(go_back)
@@ -805,14 +794,10 @@
 static void
 zoom (KzEmbed *embed, gint zoom, gboolean reflow)
 {
-    GError *error = NULL;
     KzDBusEmbedDelegatePrivate *priv = KZ_DBUS_EMBED_DELEGATE_GET_PRIVATE(embed);
     gdouble ratio = zoom / 100;
 
-    if (!org_kazehakase_Embed_zoom(priv->proxy, ratio, &error)) {
-        g_print("%s\n", error->message);
-        g_error_free(error);
-    }
+    org_kazehakase_Embed_zoom_async(priv->proxy, ratio, cb_async, NULL);
 }
 
 static void
@@ -913,7 +898,7 @@
     GError *error = NULL;
     KzDBusEmbedDelegatePrivate *priv = KZ_DBUS_EMBED_DELEGATE_GET_PRIVATE(embed);
     gchar **titles = NULL, **uris = NULL;
-    gint i, n_children = 0;
+    gint i = 0;
 
     if (!priv->proxy)
         return;
@@ -923,13 +908,11 @@
         g_error_free(error);
     }
 
-    if (titles)
-        n_children = g_strv_length(titles);
-    for (i = 0; i < n_children; i++) {
+    while (uris[i]) {
         KzSite *site;
-
         site = kz_site_new(titles[i], uris[i]);
         *history = g_list_append(*history, site);
+        i++;
     }
     g_strfreev(titles);
     g_strfreev(uris);

Modified: kazehakase/trunk/module/embed/per-process/kz-embed-process.c
===================================================================
--- kazehakase/trunk/module/embed/per-process/kz-embed-process.c	2009-09-02 05:15:56 UTC (rev 3812)
+++ kazehakase/trunk/module/embed/per-process/kz-embed-process.c	2009-09-02 06:08:18 UTC (rev 3813)
@@ -110,10 +110,22 @@
 static gboolean kz_embed_process_can_paste (KzEmbedProcess *object, gboolean *possible, GError **error);
 static gboolean kz_embed_process_find (KzEmbedProcess *object, const gchar *keyword, gboolean backward, gboolean *found, GError **error);
 static gboolean kz_embed_process_zoom (KzEmbedProcess *object, gdouble ratio, GError **error);
-static gboolean kz_embed_process_get_history (KzEmbedProcess *object, gchar ***titles, gchar ***uris, GError **error);
-static gboolean kz_embed_process_set_history (KzEmbedProcess *object, const gchar **titles, const gchar **uris, GError **error);
-static gboolean kz_embed_process_set_encoding (KzEmbedProcess *object, const gchar *encoding, GError **error);
-static gboolean kz_embed_process_get_encoding (KzEmbedProcess *object, gchar **encoding, GError **error);
+static gboolean kz_embed_process_get_history  (KzEmbedProcess *object,
+                                               gchar ***titles,
+                                               gchar ***uris,
+                                               guint *current_position,
+                                               GError **error);
+static gboolean kz_embed_process_set_history  (KzEmbedProcess *object,
+                                               const gchar **titles,
+                                               const gchar **uris,
+                                               guint current_position,
+                                               GError **error);
+static gboolean kz_embed_process_set_encoding (KzEmbedProcess *object,
+                                               const gchar *encoding,
+                                               GError **error);
+static gboolean kz_embed_process_get_encoding (KzEmbedProcess *object,
+                                               gchar **encoding,
+                                               GError **error);
 
 #include "kz-embed-process-server-bindings.h"
 
@@ -527,35 +539,40 @@
 }
 
 static gboolean
-kz_embed_process_get_history (KzEmbedProcess *object, gchar ***titles, gchar ***uris, GError **error)
+kz_embed_process_get_history (KzEmbedProcess *object,
+                              gchar ***titles,
+                              gchar ***uris,
+                              guint *current_position,
+                              GError **error)
 {
     KzEmbedProcessPrivate *priv = KZ_EMBED_PROCESS_GET_PRIVATE(object);
 	GList *node;
     GList *history = NULL;
     gint i, n_children;
-    gchar **ret_titles, **ret_uris;
-    guint current_position;
 
-    kz_embed_get_history(priv->embed, &history, &current_position);
+    kz_embed_get_history(priv->embed, &history, current_position);
 
     n_children = g_list_length(history);
 
-    ret_titles = g_new0(gchar*, n_children + 1);
-    ret_uris = g_new0(gchar*, n_children + 1);
+    *titles = g_new0(gchar*, n_children + 1);
+    *uris = g_new0(gchar*, n_children + 1);
     for (node = g_list_first(history), i = 0; node; node = g_list_next(node), i++) {
         KzSite *site = (KzSite*)(node->data);
-        ret_titles[i] = g_strdup(site->title);
-        ret_uris[i] = g_strdup(site->uri);
+        *titles[i] = g_strdup(site->title);
+        *uris[i] = g_strdup(site->uri);
     }
 
-    titles = &ret_titles;
-    uris = &ret_uris;
+    kz_site_list_free(history);
 
     return TRUE;
 }
 
 static gboolean
-kz_embed_process_set_history (KzEmbedProcess *object, const gchar **titles, const gchar **uris, GError **error)
+kz_embed_process_set_history (KzEmbedProcess *object,
+                              const gchar **titles,
+                              const gchar **uris,
+                              guint current_position,
+                              GError **error)
 {
     KzEmbedProcessPrivate *priv = KZ_EMBED_PROCESS_GET_PRIVATE(object);
     gint i, n_children = 0;
@@ -569,7 +586,7 @@
         site = kz_site_new(titles[i], uris[i]);
         history = g_list_append(history, site);
     }
-    kz_embed_set_history(priv->embed, history, 0);
+    kz_embed_set_history(priv->embed, history, current_position);
     kz_site_list_free(history);
 
     return TRUE;




More information about the Kazehakase-cvs mailing list
Back to archive index