[geary/bug/728002-webkit2: 37/140] Mark ClientWebView::get_string_result and call sites as nullable.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/bug/728002-webkit2: 37/140] Mark ClientWebView::get_string_result and call sites as nullable.
- Date: Tue, 31 Jan 2017 23:01:39 +0000 (UTC)
commit 9e5e90ceb87269ada36e2627874c7eb1db4642cc
Author: Michael James Gratton <mike vee net>
Date: Fri Dec 2 00:55:50 2016 +1100
Mark ClientWebView::get_string_result and call sites as nullable.
src/client/components/client-web-view.vala | 2 +-
.../conversation-viewer/conversation-web-view.vala | 12 ++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/client/components/client-web-view.vala b/src/client/components/client-web-view.vala
index 153aef3..4d78075 100644
--- a/src/client/components/client-web-view.vala
+++ b/src/client/components/client-web-view.vala
@@ -104,7 +104,7 @@ public class ClientWebView : WebKit.WebView {
// XXX unref result?
}
- protected static string get_string_result(WebKit.JavascriptResult result)
+ protected static string? get_string_result(WebKit.JavascriptResult result)
throws JSError {
JS.GlobalContext context = result.get_global_context();
JS.Value js_str_value = result.get_value();
diff --git a/src/client/conversation-viewer/conversation-web-view.vala
b/src/client/conversation-viewer/conversation-web-view.vala
index bc28fa4..91743f4 100644
--- a/src/client/conversation-viewer/conversation-web-view.vala
+++ b/src/client/conversation-viewer/conversation-web-view.vala
@@ -37,16 +37,20 @@ public class ConversationWebView : ClientWebView {
/**
* Returns the current selection, for prefill as find text.
*/
- public async string get_selection_for_find() throws Error{
- WebKit.JavascriptResult result = yield this.run_javascript("geary.getSelectionForFind();", null);
+ public async string? get_selection_for_find() throws Error{
+ WebKit.JavascriptResult result = yield this.run_javascript(
+ "geary.getSelectionForFind();", null
+ );
return get_string_result(result);
}
/**
* Returns the current selection, for quoting in a message.
*/
- public async string get_selection_for_quoting() throws Error {
- WebKit.JavascriptResult result = yield this.run_javascript("geary.getSelectionForQuoting();", null);
+ public async string? get_selection_for_quoting() throws Error {
+ WebKit.JavascriptResult result = yield this.run_javascript(
+ "geary.getSelectionForQuoting();", null
+ );
return get_string_result(result);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]