[gnote] Remove string_index_of from search
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Remove string_index_of from search
- Date: Sun, 22 Jan 2017 19:01:48 +0000 (UTC)
commit ef0fd9517760d097dff14a9177e8552263d74773
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Jan 22 20:50:14 2017 +0200
Remove string_index_of from search
src/search.cpp | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/search.cpp b/src/search.cpp
index 04fe696..0493d7e 100644
--- a/src/search.cpp
+++ b/src/search.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2011,2013-2014 Aurimas Cernius
+ * Copyright (C) 2011,2013-2014,2017 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -122,22 +122,22 @@ namespace gnote {
if (!match_case) {
note_text = note_text.lowercase();
}
-
+
for(std::vector<std::string>::const_iterator iter = words.begin();
iter != words.end(); ++iter) {
- const std::string & word(*iter);
+ const Glib::ustring word(*iter);
- int idx = 0;
+ Glib::ustring::size_type idx = 0;
bool this_word_found = false;
if (word.empty())
continue;
while (true) {
- idx = sharp::string_index_of(note_text, word, idx);
+ idx = note_text.find(word, idx);
- if (idx == -1) {
+ if (idx == Glib::ustring::npos) {
if (this_word_found) {
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]