[gnote] Sort notebooks case-insensitively and using Unicode
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Sort notebooks case-insensitively and using Unicode
- Date: Sat, 18 May 2013 19:36:40 +0000 (UTC)
commit 8a1cda97cd6099dd79ad33bdd62577391459907e
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sat May 18 22:11:06 2013 +0300
Sort notebooks case-insensitively and using Unicode
Fixes Bug 700448.
src/notebooks/notebookmanager.cpp | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/notebooks/notebookmanager.cpp b/src/notebooks/notebookmanager.cpp
index 94b6438..6773c95 100644
--- a/src/notebooks/notebookmanager.cpp
+++ b/src/notebooks/notebookmanager.cpp
@@ -20,8 +20,6 @@
*/
-#include <string.h>
-
#include <glibmm.h>
#include <glibmm/i18n.h>
#include <gtkmm/treemodelsort.h>
@@ -439,8 +437,13 @@ namespace gnote {
return 1;
}
- return strcmp(notebook_a->get_name().c_str(),
- notebook_b->get_name().c_str());
+ Glib::ustring a_name(notebook_a->get_name());
+ a_name = a_name.lowercase();
+ Glib::ustring b_name(notebook_b->get_name());
+ b_name = b_name.lowercase();
+ return a_name== b_name
+ ? 0
+ : a_name<b_name ? -1 : 1;
}
/// <summary>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]