diff options
author | B. Watson <yalhcru@gmail.com> | 2017-06-25 02:49:12 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-07-01 07:42:25 +0700 |
commit | a2ca8e357f346aaab5c079649b7f0ab99b6a584f (patch) | |
tree | 4b00478d142a2c1ffe36776f6cc47f89273ee864 /network/surf/patches | |
parent | 218b6c3c8a1726e7cc6490e1b93bcbb34753dab0 (diff) | |
download | slackbuilds-a2ca8e357f346aaab5c079649b7f0ab99b6a584f.tar.gz |
network/surf: Updated for version 2.0.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'network/surf/patches')
-rw-r--r-- | network/surf/patches/homepage.diff | 19 | ||||
-rw-r--r-- | network/surf/patches/searchengines.diff | 82 |
2 files changed, 48 insertions, 53 deletions
diff --git a/network/surf/patches/homepage.diff b/network/surf/patches/homepage.diff index f31b8fe89d..4e130a6e88 100644 --- a/network/surf/patches/homepage.diff +++ b/network/surf/patches/homepage.diff @@ -1,15 +1,12 @@ -diff -Naur surf-0.7/surf.c surf-0.7.patched/surf.c ---- surf-0.7/surf.c 2015-12-19 09:59:30.000000000 -0500 -+++ surf-0.7.patched/surf.c 2017-01-21 22:00:00.856364467 -0500 -@@ -1759,8 +1759,11 @@ - default: - usage(); - } ARGEND; -+#define HOMEPAGE "@HOMEPAGE@" +diff -Naur surf-2.0/surf.c surf-2.0.patched/surf.c +--- surf-2.0/surf.c 2017-03-28 12:17:45.000000000 -0400 ++++ surf-2.0.patched/surf.c 2017-06-25 01:33:34.501169322 -0400 +@@ -1751,7 +1751,7 @@ if (argc > 0) arg.v = argv[0]; -+ else -+ arg.v = HOMEPAGE; + else +- arg.v = "about:blank"; ++ arg.v = "@HOMEPAGE@"; setup(); - c = newclient(); + c = newclient(NULL); diff --git a/network/surf/patches/searchengines.diff b/network/surf/patches/searchengines.diff index 77ad9deb80..e4577632e0 100644 --- a/network/surf/patches/searchengines.diff +++ b/network/surf/patches/searchengines.diff @@ -1,8 +1,8 @@ -diff -Naur surf-0.7/config.def.h surf-0.7.patched/config.def.h ---- surf-0.7/config.def.h 2015-12-19 09:59:30.000000000 -0500 -+++ surf-0.7.patched/config.def.h 2017-01-21 22:05:50.709360322 -0500 -@@ -129,6 +129,14 @@ - { MODKEY|GDK_SHIFT_MASK,GDK_g, togglegeolocation, { 0 } }, +diff -Naur surf-2.0/config.def.h surf-2.0.patched/config.def.h +--- surf-2.0/config.def.h 2017-03-28 12:17:45.000000000 -0400 ++++ surf-2.0.patched/config.def.h 2017-06-25 02:20:53.529174137 -0400 +@@ -153,6 +153,13 @@ + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, }; +static SearchEngine searchengines[] = { @@ -10,63 +10,61 @@ diff -Naur surf-0.7/config.def.h surf-0.7.patched/config.def.h + { "g", "https://www.google.com/search?q=%s" }, + { "dict", "http://www.thefreedictionary.com/%s" }, + { "sb", "http://slackbuilds.org/result/?search=%s&sv=@SLACKVER@" }, -+ { "sw", "http://search.slackware.eu/cgi-bin/search.cgi?rm=search&needle=%s&haystack=2&sver=@SVER@&button-search=Search" }, +}; + /* button definitions */ - /* click can be ClkDoc, ClkLink, ClkImg, ClkMedia, ClkSel, ClkEdit, ClkAny */ + /* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ static Button buttons[] = { -diff -Naur surf-0.7/surf.c surf-0.7.patched/surf.c ---- surf-0.7/surf.c 2015-12-19 09:59:30.000000000 -0500 -+++ surf-0.7.patched/surf.c 2017-01-21 22:05:12.304360777 -0500 -@@ -91,6 +91,12 @@ - G_DEFINE_TYPE(CookieJar, cookiejar, SOUP_TYPE_COOKIE_JAR_TEXT) +diff -Naur surf-2.0/surf.c surf-2.0.patched/surf.c +--- surf-2.0/surf.c 2017-03-28 12:17:45.000000000 -0400 ++++ surf-2.0.patched/surf.c 2017-06-25 02:04:32.517172473 -0400 +@@ -129,6 +129,11 @@ + } Button; typedef struct { -+ char *token; -+ char *uri; ++ char *token; ++ char *uri; +} SearchEngine; + -+ +typedef struct { - char *regex; - char *style; + const char *uri; + Parameter config[ParameterLast]; regex_t re; -@@ -178,6 +184,7 @@ - static void navigate(Client *c, const Arg *arg); - static Client *newclient(void); - static void newwindow(Client *c, const Arg *arg, gboolean noembed); +@@ -202,6 +207,7 @@ + static void download(Client *c, WebKitURIResponse *r); + static void closeview(WebKitWebView *v, Client *c); + static void destroywin(GtkWidget* w, Client *c); +static gchar *parseuri(const gchar *uri); + + /* Hotkeys */ static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d); - static gboolean contextmenu(WebKitWebView *view, GtkWidget *menu, - WebKitHitTestResult *target, gboolean keyboard, -@@ -838,8 +845,7 @@ - u = g_strdup_printf("file://%s", rp); - free(rp); +@@ -477,7 +483,7 @@ + url = g_strdup_printf("file://%s", path); + free(path); } else { -- u = g_strrstr(uri, "://") ? g_strdup(uri) -- : g_strdup_printf("http://%s", uri); -+ u = parseuri(uri); +- url = g_strdup_printf("http://%s", uri); ++ url = parseuri(uri); } - setatom(c, AtomUri, uri); -@@ -1172,6 +1178,21 @@ - } + setatom(c, AtomUri, url); +@@ -1461,6 +1467,22 @@ + gtk_main_quit(); } -+static gchar * ++gchar * +parseuri(const gchar *uri) { -+ guint i; ++ guint i; + -+ for (i = 0; i < LENGTH(searchengines); i++) { -+ if (searchengines[i].token == NULL || searchengines[i].uri == NULL || \ -+ *(uri + strlen(searchengines[i].token)) != ' ') -+ continue; -+ if (g_str_has_prefix(uri, searchengines[i].token)) -+ return g_strdup_printf(searchengines[i].uri, uri + strlen(searchengines[i].token) + 1); -+ } ++ for (i = 0; i < LENGTH(searchengines); i++) { ++ if (searchengines[i].token == NULL || searchengines[i].uri == NULL || ++ *(uri + strlen(searchengines[i].token)) != ' ') ++ continue; ++ if (g_str_has_prefix(uri, searchengines[i].token)) ++ return g_strdup_printf(searchengines[i].uri, ++ uri + strlen(searchengines[i].token) + 1); ++ } + -+ return g_strrstr(uri, "://") ? g_strdup(uri) : g_strdup_printf("http://%s", uri); ++ return g_strdup_printf("http://%s", uri); +} + void |