[shotwell/wip/ricotz/vala: 2/2] Accept string.char_count()/get_next_char() using long or int for new valac
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell/wip/ricotz/vala: 2/2] Accept string.char_count()/get_next_char() using long or int for new valac
- Date: Mon, 29 Oct 2018 20:37:50 +0000 (UTC)
commit 69691dc6de705addc918a82d0b567fbe3d324f19
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Oct 29 21:35:43 2018 +0100
Accept string.char_count()/get_next_char() using long or int for new valac
src/dialogs/EntryMultiCompletion.vala | 2 +-
src/util/string.vala | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/dialogs/EntryMultiCompletion.vala b/src/dialogs/EntryMultiCompletion.vala
index 8700f216..136fa4f8 100644
--- a/src/dialogs/EntryMultiCompletion.vala
+++ b/src/dialogs/EntryMultiCompletion.vala
@@ -48,7 +48,7 @@ public class EntryMultiCompletion : Gtk.EntryCompletion {
} else {
if (normed_key.contains(delimiter)) {
// check whether cursor is before last delimiter
- int offset = normed_key.char_count(normed_key.last_index_of_char(delimiter[0]));
+ var offset = normed_key.char_count(normed_key.last_index_of_char(delimiter[0]));
int position = ((Gtk.Entry) get_entry()).get_position();
if (position <= offset)
return false; // TODO: Autocompletion for tags not last in list
diff --git a/src/util/string.vala b/src/util/string.vala
index bf7e6054..01a16a49 100644
--- a/src/util/string.vala
+++ b/src/util/string.vala
@@ -226,7 +226,11 @@ public string strip_leading_zeroes(string str) {
public string remove_diacritics(string istring) {
var builder = new StringBuilder ();
unichar ch;
+#if VALA_0_44
+ long i = 0L;
+#else
int i = 0;
+#endif
while(istring.normalize().get_next_char(ref i, out ch)) {
switch(ch.type()) {
case UnicodeType.CONTROL:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]