[evolution-data-server/openismus-work-master: 58/150] 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: 58/150] EBookBackendSqliteDB: Cursor API enhancements.
- Date: Thu, 24 Oct 2013 15:35:20 +0000 (UTC)
commit dfe0285122773713ee0cbda7f049603e4b432318
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 b0da558..4be51e9 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -5840,6 +5840,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;
}
@@ -5970,10 +5971,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]