[evolution-data-server/openismus-work-master: 62/82] EBookBackendSqliteDB: Cursor API enhancements.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work-master: 62/82] EBookBackendSqliteDB: Cursor API enhancements.
- Date: Mon, 19 Aug 2013 18:57:00 +0000 (UTC)
commit f28b371260be1a334168124e6d7b29938781342c
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Fri Jul 26 14:40:21 2013 +0900
EBookBackendSqliteDB: Cursor API enhancements.
When using the RESET origin, guarantee that both current
and previous cursor states are reset. Same goes for alphabetic
indexes, ensure that both cursor states are set to the new
alphabetic index pointer and not just one of them.
.../libedata-book/e-book-backend-sqlitedb.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c
b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 1e473dd..15f15c9 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -5825,6 +5825,7 @@ e_book_backend_sqlitedb_cursor_move_by (EBookBackendSqliteDB *ebsdb,
case EBSDB_CURSOR_ORIGIN_RESET:
/* Clear the current state before executing the query */
ebsdb_cursor_clear_state (cursor, STATE_CURRENT);
+ ebsdb_cursor_clear_state (cursor, STATE_PREVIOUS);
break;
}
@@ -5955,10 +5956,14 @@ e_book_backend_sqlitedb_cursor_set_target_alphabetic_index (EBookBackendSqliteDB
NULL, NULL, NULL);
g_return_if_fail (index < n_labels);
+ ebsdb_cursor_clear_state (cursor, STATE_PREVIOUS);
ebsdb_cursor_clear_state (cursor, STATE_CURRENT);
- if (cursor->n_sort_fields > 0)
+ if (cursor->n_sort_fields > 0) {
+ cursor->state[STATE_PREVIOUS].values[0] =
+ e_collator_generate_key_for_index (ebsdb->priv->collator, index);
cursor->state[STATE_CURRENT].values[0] =
e_collator_generate_key_for_index (ebsdb->priv->collator, index);
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]