[gnome-calculator] Replaced deprecated sourcecompletionitem constructor.
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Replaced deprecated sourcecompletionitem constructor.
- Date: Thu, 27 Jul 2017 17:01:45 +0000 (UTC)
commit 0d2dedf44761510363c802e326078aebbee0fe27
Author: Robert Roth <robert roth off gmail com>
Date: Thu Jul 27 20:01:27 2017 +0300
Replaced deprecated sourcecompletionitem constructor.
src/math-display.vala | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/math-display.vala b/src/math-display.vala
index 1b8dfb6..4a806e7 100644
--- a/src/math-display.vala
+++ b/src/math-display.vala
@@ -433,6 +433,15 @@ public class CompletionProvider : GLib.Object, Gtk.SourceCompletionProvider
return "";
}
+ public virtual Gtk.SourceCompletionItem create_proposal (string label, string text, string details)
+ {
+ var proposal = Gtk.SourceCompletionItem.new2 ();
+ proposal.label = label;
+ proposal.text = text;
+ proposal.info = details;
+ return proposal;
+ }
+
public static void move_iter_to_name_start (ref Gtk.TextIter iter)
{
while (iter.backward_char ())
@@ -518,8 +527,8 @@ public class FunctionCompletionProvider : CompletionProvider
if (function.is_custom_function ())
details_text = "%s(%s)=%s\n%s".printf (function.name, string.joinv (";",
function.arguments),
function.expression, function.description);
- var proposal = new Gtk.SourceCompletionItem (display_text, label_text, null, details_text);
- proposals.append (proposal);
+
+ proposals.append (create_proposal (display_text, label_text, details_text));
}
}
context.add_proposals (this, proposals, true);
@@ -571,8 +580,7 @@ public class VariableCompletionProvider : CompletionProvider
string details_text = _equation.serializer.to_string (_equation.variables.get (variable));
string label_text = variable;
- var proposal = new Gtk.SourceCompletionItem (display_text, label_text, null, details_text);
- proposals.append (proposal);
+ proposals.append (create_proposal (display_text, label_text, details_text));
}
}
context.add_proposals (this, proposals, true);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]