[hackers] [surf] Style inquisition. || Christoph Lohmann

From: <git_AT_suckless.org>
Date: Sun, 17 Feb 2013 00:39:51 +0100

commit 69004b2ff67c5747e3f03fcffad1192741ea9419
Author: Christoph Lohmann <20h_AT_r-36.net>
Date: Sun Feb 17 00:37:43 2013 +0100

    Style inquisition.

diff --git a/surf.c b/surf.c
index fc61381..ba00e5b 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -169,6 +169,7 @@ beforerequest(WebKitWebView *w, WebKitWebFrame *f, WebKitWebResource *r,
                 WebKitNetworkRequest *req, WebKitNetworkResponse *resp,
                 gpointer d) {
         const gchar *uri = webkit_network_request_get_uri(req);
+
         if(g_str_has_suffix(uri, "/favicon.ico"))
                 webkit_network_request_set_uri(req, "about:blank");
 }
_AT_@ -291,7 +292,8 @@ evalscript(JSContextRef js, char *script, char* scriptname) {
 
         jsscript = JSStringCreateWithUTF8CString(script);
         jsscriptname = JSStringCreateWithUTF8CString(scriptname);
- JSEvaluateScript(js, jsscript, JSContextGetGlobalObject(js), jsscriptname, 0, &exception);
+ JSEvaluateScript(js, jsscript, JSContextGetGlobalObject(js),
+ jsscriptname, 0, &exception);
         JSStringRelease(jsscript);
         JSStringRelease(jsscriptname);
 }
_AT_@ -302,7 +304,8 @@ runscript(WebKitWebFrame *frame) {
         GError *error;
 
         if(g_file_get_contents(scriptfile, &script, NULL, &error)) {
- evalscript(webkit_web_frame_get_global_context(frame), script, scriptfile);
+ evalscript(webkit_web_frame_get_global_context(frame),
+ script, scriptfile);
         }
 }
 
_AT_@ -310,10 +313,15 @@ static void
 clipboard(Client *c, const Arg *arg) {
         gboolean paste = *(gboolean *)arg;
 
- if(paste)
- gtk_clipboard_request_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), pasteuri, c);
- else
- gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), c->linkhover ? c->linkhover : geturi(c), -1);
+ if(paste) {
+ gtk_clipboard_request_text(
+ gtk_clipboard_get(GDK_SELECTION_PRIMARY),
+ pasteuri, c);
+ } else {
+ gtk_clipboard_set_text(
+ gtk_clipboard_get(GDK_SELECTION_PRIMARY),
+ c->linkhover ? c->linkhover : geturi(c), -1);
+ }
 }
 
 static char *
_AT_@ -426,11 +434,13 @@ getatom(Client *c, int a) {
         XGetWindowProperty(dpy, GDK_WINDOW_XID(GTK_WIDGET(c->win)->window),
                         atoms[a], 0L, BUFSIZ, False, XA_STRING,
                         &adummy, &idummy, &ldummy, &ldummy, &p);
- if(p)
+ if(p) {
                 strncpy(buf, (char *)p, LENGTH(buf)-1);
- else
+ } else {
                 buf[0] = '
Received on Sun Feb 17 2013 - 00:39:51 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 21 2013 - 19:27:07 CET