Skip to content

Commit b8584dd

Browse files
authored
Drop old Soup support (#1000)
1 parent 01e4516 commit b8584dd

File tree

8 files changed

+7
-61
lines changed

8 files changed

+7
-61
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
You'll need the following dependencies:
99
* libcamel1.2-dev
1010
* libedataserver1.2-dev
11-
* libedataserverui1.2-dev
11+
* libedataserverui1.2-dev >=3.45.1
1212
* libfolks-dev
1313
* libgee-0.8-dev
1414
* libglib2.0-dev

docs/meson.build

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,9 @@ basic_command = [
2121
'--use-svg-images'
2222
]
2323

24-
if libedataserverui_dep.version().version_compare('>=3.45.1')
25-
basic_command += [
26-
'--pkg', 'webkit2gtk-4.1',
27-
'--define=HAS_SOUP_3'
28-
]
29-
else
30-
basic_command += [
31-
'--pkg', 'webkit2gtk-4.0',
32-
]
33-
endif
24+
basic_command += [
25+
'--pkg', 'webkit2gtk-4.0',
26+
]
3427

3528
all_doc_target = custom_target(
3629
'full documentation',

meson.build

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@ gee_dep = dependency('gee-0.8')
1717
handy_dep = dependency('libhandy-1', version: '>=1.1.90')
1818
camel_dep = dependency('camel-1.2', version: '>= 3.28')
1919
libedataserver_dep = dependency('libedataserver-1.2', version: '>= 3.28')
20-
libedataserverui_dep = dependency('libedataserverui-1.2', version: '>= 3.28')
21-
if libedataserverui_dep.version().version_compare('>=3.45.1')
22-
add_project_arguments('--define=HAS_SOUP_3', language: 'vala')
23-
webkit2_dep = dependency('webkit2gtk-4.1')
24-
webkit2_web_extension_dep = dependency('webkit2gtk-web-extension-4.1')
25-
else
26-
webkit2_dep = dependency('webkit2gtk-4.0', version: '>=2.28')
27-
webkit2_web_extension_dep = dependency('webkit2gtk-web-extension-4.0', version: '>=2.28')
28-
endif
20+
libedataserverui_dep = dependency('libedataserverui-1.2', version: '>=3.45.1')
21+
webkit2_dep = dependency('webkit2gtk-4.1')
22+
webkit2_web_extension_dep = dependency('webkit2gtk-web-extension-4.1')
2923
libportal_dep = dependency('libportal')
3024
libportal_gtk_dep = dependency('libportal-gtk3')
3125
folks_dep = dependency('folks')

src/Application.vala

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public class Mail.Application : Gtk.Application {
6161
string to = null;
6262

6363
try {
64-
#if HAS_SOUP_3
6564
GLib.Uri? mailto= null;
6665
try {
6766
mailto = GLib.Uri.parse (mailto_uri, GLib.UriFlags.NONE);
@@ -86,26 +85,6 @@ public class Mail.Application : Gtk.Application {
8685
new Composer (to, mailto.get_query ()).present ();
8786
});
8887
}
89-
#else
90-
Soup.URI mailto = new Soup.URI (mailto_uri);
91-
if (mailto == null) {
92-
throw new OptionError.BAD_VALUE ("Argument is not a URL.");
93-
}
94-
95-
if (mailto.scheme != "mailto") {
96-
throw new OptionError.BAD_VALUE ("Cannot open non-mailto: URL");
97-
}
98-
99-
to = Soup.URI.decode (mailto.path);
100-
101-
if (main_window.is_session_started) {
102-
new Composer (to, mailto.query).present ();
103-
} else {
104-
main_window.session_started.connect (() => {
105-
new Composer (to, mailto.query).present ();
106-
});
107-
}
108-
#endif
10988
} catch (OptionError e) {
11089
warning ("Argument parsing error. %s", e.message);
11190
}

src/Composer.vala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,7 @@ public class Mail.Composer : Hdy.ApplicationWindow {
375375
foreach (unowned string param in params) {
376376
var terms = param.split ("=");
377377
if (terms.length == 2) {
378-
#if HAS_SOUP_3
379378
result[terms[0].down ()] = (GLib.Uri.unescape_string (terms[1]));
380-
#else
381-
result[terms[0].down ()] = (Soup.URI.decode (terms[1]));
382-
#endif
383379
} else {
384380
critical ("Invalid mailto URL");
385381
}
@@ -517,11 +513,7 @@ public class Mail.Composer : Hdy.ApplicationWindow {
517513
private void on_mouse_target_changed (WebKit.WebView web_view, WebKit.HitTestResult hit_test, uint mods) {
518514
if (hit_test.context_is_link ()) {
519515
var url = hit_test.get_link_uri ();
520-
#if HAS_SOUP_3
521516
var hover_url = url != null ? GLib.Uri.unescape_string (url) : null;
522-
#else
523-
var hover_url = url != null ? Soup.URI.decode (url) : null;
524-
#endif
525517

526518
if (hover_url == null) {
527519
message_url_overlay.hide ();

src/MainWindow.vala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ public class Mail.MainWindow : Hdy.ApplicationWindow {
136136
message_overlay.no_show_all = true;
137137

138138
message_list.hovering_over_link.connect ((label, url) => {
139-
#if HAS_SOUP_3
140139
var hover_url = url != null ? GLib.Uri.unescape_string (url) : null;
141-
#else
142-
var hover_url = url != null ? Soup.URI.decode (url) : null;
143-
#endif
144140

145141
if (hover_url == null) {
146142
message_overlay.hide ();

src/WebView.vala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,7 @@ public class Mail.WebView : WebKit.WebView {
258258
}
259259

260260
private bool handle_internal_response (WebKit.URISchemeRequest request) {
261-
#if HAS_SOUP_3
262261
string uri = GLib.Uri.unescape_string (request.get_uri ());
263-
#else
264-
string uri = Soup.URI.decode (request.get_uri ());
265-
#endif
266262
InputStream? buf = this.internal_resources[uri];
267263
if (buf != null) {
268264
request.finish (buf, -1, null);

webkit-extension/MailPage.vala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,13 @@ public class Mail.Page : Object {
186186

187187
private bool on_send_request (WebKit.WebPage page, WebKit.URIRequest request, WebKit.URIResponse? response) {
188188
bool should_load = false;
189-
#if HAS_SOUP_3
190189
GLib.Uri? uri = null;
191190
try {
192191
uri = GLib.Uri.parse (request.get_uri (), GLib.UriFlags.NONE);
193192
} catch (Error e) {
194193
warning ("Could not parse uri: %s", e.message);
195194
return should_load;
196195
}
197-
#else
198-
Soup.URI? uri = new Soup.URI (request.get_uri ());
199-
#endif
200196
if (uri != null && uri.get_scheme () in ALLOWED_SCHEMES) {
201197
// Always load internal resources
202198
should_load = true;

0 commit comments

Comments
 (0)