[tracker/direct-access-refactor] squash
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/direct-access-refactor] squash
- Date: Mon, 19 Jul 2010 10:13:18 +0000 (UTC)
commit 52c865e765a2c66e507610cad070b81915df3214
Author: Philip Van Hoof <philip codeminded be>
Date: Mon Jul 19 12:11:28 2010 +0200
squash
src/libtracker-bus/tracker-bus-array-cursor.vala | 78 ++++++++++-----------
1 files changed, 37 insertions(+), 41 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus-array-cursor.vala b/src/libtracker-bus/tracker-bus-array-cursor.vala
index f3a6cd8..97b9f31 100644
--- a/src/libtracker-bus/tracker-bus-array-cursor.vala
+++ b/src/libtracker-bus/tracker-bus-array-cursor.vala
@@ -15,60 +15,56 @@
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
- *
- * Author: Philip Van Hoof <philip codeminded be>
*/
-namespace Tracker {
- namespace Bus {
- public class ArrayCursor : Tracker.Sparql.Cursor {
- int rows;
- int current_row;
- char **results;
- int cols;
-
- public ArrayCursor (owned char** mresults, int mrows, int mcols) {
- rows = mrows;
- cols = mcols;
- results = mresults;
- }
+namespace Tracker.Bus {
+ public class ArrayCursor : Tracker.Sparql.Cursor {
+ int rows;
+ int current_row;
+ char **results;
+ int cols;
- public override int n_columns { get { return cols; } }
+ public ArrayCursor (owned char** mresults, int mrows, int mcols) {
+ rows = mrows;
+ cols = mcols;
+ results = mresults;
+ }
- public override unowned string? get_string (int column, out long length = null) {
- char **row;
- unowned string str;
+ public override int n_columns { get { return cols; } }
- if (rows < 1) {
- return null;
- }
+ public override unowned string? get_string (int column, out long length = null) {
+ char **row;
+ unowned string str;
- row = results + current_row;
- str = (string) row[column];
+ if (rows < 1) {
+ return null;
+ }
- if ((&length) != null) {
- length = str.length;
- }
+ row = results + current_row;
+ str = (string) row[column];
- return str;
+ if ((&length) != null) {
+ length = str.length;
}
- public override bool next (Cancellable? cancellable = null) throws GLib.Error {
- if (current_row >= rows - 1) {
- return false;
- }
- current_row++;
- return true;
- }
+ return str;
+ }
- public override async bool next_async (Cancellable? cancellable = null) throws GLib.Error {
- /* This cursor isn't blocking, it's fine to just call next here */
- return next (cancellable);
+ public override bool next (Cancellable? cancellable = null) throws GLib.Error {
+ if (current_row >= rows - 1) {
+ return false;
}
+ current_row++;
+ return true;
+ }
- public override void rewind () {
- current_row = 0;
- }
+ public override async bool next_async (Cancellable? cancellable = null) throws GLib.Error {
+ /* This cursor isn't blocking, it's fine to just call next here */
+ return next (cancellable);
+ }
+
+ public override void rewind () {
+ current_row = 0;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]