[evolution-data-server/openismus-work-master: 115/134] EBookBackendSqliteDB: Cursor move API changed to return number of contacts traversed.



commit 97e7fc8adef8b9c86d8957c887cb5e9b0e6027b2
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Sun Oct 13 04:09:44 2013 +0200

    EBookBackendSqliteDB: Cursor move API changed to return number of contacts traversed.

 .../libedata-book/e-book-backend-sqlitedb.c        |   12 ++++++++----
 .../libedata-book/e-book-backend-sqlitedb.h        |    2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c 
b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 3149ecc..25cf2ae 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -5886,11 +5886,12 @@ collect_results_for_cursor_cb (gpointer ref,
  * the result list will be stored to @results and should be freed with g_slist_free()
  * and all elements freed with e_book_backend_sqlitedb_search_data_free().
  *
- * Returns: %TRUE on success, otherwise %FALSE is returned and @error is set.
+ * Returns: The number of contacts which the cursor has moved by if successfull.
+ * Otherwise -1 is returned and @error is set.
  *
  * Since: 3.12
  */
-gboolean
+gint
 e_book_backend_sqlitedb_cursor_move_by (EBookBackendSqliteDB *ebsdb,
                                        EbSdbCursor          *cursor,
                                        EbSdbCursorOrigin     origin,
@@ -5898,7 +5899,7 @@ e_book_backend_sqlitedb_cursor_move_by (EBookBackendSqliteDB *ebsdb,
                                        GSList              **results,
                                        GError              **error)
 {
-       CursorCollectData data = { NULL, NULL, FALSE, 0 };
+       CursorCollectData data = { NULL, NULL, NULL, FALSE, 0 };
        GString *query;
        gboolean success;
 
@@ -6012,7 +6013,10 @@ e_book_backend_sqlitedb_cursor_move_by (EBookBackendSqliteDB *ebsdb,
                                   (GDestroyNotify)e_book_backend_sqlitedb_search_data_free);
        g_free (data.alloc_vcard);
 
-       return success;
+       if (success)
+               return data.n_results;
+
+       return -1;
 }
 
 /**
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.h 
b/addressbook/libedata-book/e-book-backend-sqlitedb.h
index b2d03c5..2ec563c 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.h
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.h
@@ -334,7 +334,7 @@ EbSdbCursor    *e_book_backend_sqlitedb_cursor_new
 void            e_book_backend_sqlitedb_cursor_free
                                                 (EBookBackendSqliteDB *ebsdb,
                                                 EbSdbCursor          *cursor);
-gboolean        e_book_backend_sqlitedb_cursor_move_by
+gint            e_book_backend_sqlitedb_cursor_move_by
                                                 (EBookBackendSqliteDB *ebsdb,
                                                 EbSdbCursor          *cursor,
                                                 EbSdbCursorOrigin     origin,


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