[tracker/direct-access: 69/85] libtracker-bus: Make sure current_row is set to -1 and next() is always required
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/direct-access: 69/85] libtracker-bus: Make sure current_row is set to -1 and next() is always required
- Date: Tue, 20 Jul 2010 14:10:25 +0000 (UTC)
commit 004522e06ede6a833c13b35492eb24e58d82ac2e
Author: Martyn Russell <martyn lanedo com>
Date: Mon Jul 19 15:19:21 2010 +0100
libtracker-bus: Make sure current_row is set to -1 and next() is always required
src/libtracker-bus/tracker-array-cursor.vala | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-array-cursor.vala b/src/libtracker-bus/tracker-array-cursor.vala
index d82b5cd..99abf86 100644
--- a/src/libtracker-bus/tracker-array-cursor.vala
+++ b/src/libtracker-bus/tracker-array-cursor.vala
@@ -19,7 +19,7 @@
internal class Tracker.Bus.ArrayCursor : Tracker.Sparql.Cursor {
int rows;
- int current_row;
+ int current_row = -1;
char **results;
int cols;
@@ -31,7 +31,8 @@ internal class Tracker.Bus.ArrayCursor : Tracker.Sparql.Cursor {
public override int n_columns { get { return cols; } }
- public override unowned string? get_string (int column, out long length = null) {
+ public override unowned string? get_string (int column, out long length = null)
+ requires (current_row >= 0) {
char **row;
unowned string str;
@@ -40,7 +41,7 @@ internal class Tracker.Bus.ArrayCursor : Tracker.Sparql.Cursor {
}
row = results + current_row;
- str = (string) row[column];
+ str = (string) row[column];
if (&length != null) {
length = str.length;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]