~midori/midori/innernodeselect

« back to all changes in this revision

Viewing changes to katze/midori-uri.vala

  • Committer: Tarmac
  • Author(s): Paweł Forysiuk, Christian Dywan
  • Date: 2013-11-05 18:00:59 UTC
  • mfrom: (6448.1.33 less-warnings)
  • Revision ID: tarmac-20131105180059-dypdrl07lyejesr3
Resolve compiler warnings in current trunk

Add EXTRA_WARNINGS flag to increase verbosity
Respect VALAC for the Vala compiler if defined
Sort out Vala 0.16 build issues
Make warnings fatal for bzr builds

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
namespace Midori {
18
18
    public class URI : Object {
19
19
        public static string? parse_hostname (string? uri, out string path) {
20
 
            /* path may be null. */
21
 
            if (&path != null)
22
 
                path = null;
 
20
            path = null;
23
21
            if (uri == null)
24
22
                return uri;
25
23
            unowned string? hostname = uri.chr (-1, '/');
27
25
             || hostname.chr (-1, ' ') != null)
28
26
                return null;
29
27
            hostname = hostname.offset (2);
30
 
            if (&path != null) {
31
 
                if ((path = hostname.chr (-1, '/')) != null)
32
 
                    return hostname.split ("/")[0];
33
 
            }
 
28
            if ((path = hostname.chr (-1, '/')) != null)
 
29
                return hostname.split ("/")[0];
34
30
            return hostname;
35
31
        }
36
32
        /* Deprecated: 0.4.3 */
53
49
            return uri;
54
50
        }
55
51
        public static string get_base_domain (string uri) {
56
 
            string ascii = to_ascii (uri);
57
52
#if HAVE_LIBSOUP_2_40_0
58
53
            try {
 
54
                string ascii = to_ascii (uri);
59
55
                return Soup.tld_get_base_domain (ascii);
60
56
            } catch (Error error) {
61
57
                /* This is fine, we fallback to hostname */
205
201
 
206
202
            /* No SHA256: no known usage and no need for strong encryption */
207
203
 
208
 
            if (&checksum != null)
209
 
                checksum = fragment != null
210
 
                    ? fragment.offset (delimiter.length) : null;
211
 
            if (&label != null)
212
 
                label = display;
 
204
            checksum = fragment != null ? fragment.offset (delimiter.length) : null;
 
205
            label = display;
213
206
            return type;
214
207
        }
215
208
    }