summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2013-07-30 23:12:47 +0200
committerDaniel Carl <danielcarl@gmx.de>2013-07-30 23:34:53 +0200
commitc0ca690173cf62e3a861d45b06c5cbbfcef01851 (patch)
treeb86e6e6132a4abfaf56b1b34b57a5553301ea5d7 /src
parentc540528c16d560db412b72106fd4566ac1082eec (diff)
Allow to switch off queue feature via config.h.
Diffstat (limited to 'src')
-rw-r--r--src/bookmark.c2
-rw-r--r--src/bookmark.h2
-rw-r--r--src/command.c11
-rw-r--r--src/command.h4
-rw-r--r--src/config.def.h1
-rw-r--r--src/default.h2
-rw-r--r--src/hints.c8
-rw-r--r--src/hints.h2
-rw-r--r--src/main.c2
-rw-r--r--src/main.h2
10 files changed, 33 insertions, 3 deletions
diff --git a/src/bookmark.c b/src/bookmark.c
index cdcdd78..330e196 100644
--- a/src/bookmark.c
+++ b/src/bookmark.c
@@ -148,6 +148,7 @@ gboolean bookmark_fill_completion(GtkListStore *store, const char *input)
return found;
}
+#ifdef FEATURE_QUEUE
/**
* Push a uri to the end of the queue.
*
@@ -184,6 +185,7 @@ char *bookmark_queue_pop(void)
}
return uri;
}
+#endif /* FEATURE_QUEUE */
static GList *load(const char *file)
{
diff --git a/src/bookmark.h b/src/bookmark.h
index c1986d4..8ecf929 100644
--- a/src/bookmark.h
+++ b/src/bookmark.h
@@ -23,7 +23,9 @@
gboolean bookmark_add(const char *uri, const char *title, const char *tags);
gboolean bookmark_remove(const char *uri);
gboolean bookmark_fill_completion(GtkListStore *store, const char *input);
+#ifdef FEATURE_QUEUE
gboolean bookmark_queue_push(const char *uri);
char *bookmark_queue_pop(void);
+#endif
#endif /* end of include guard: _BOOKMARK_H */
diff --git a/src/command.c b/src/command.c
index 82921c2..a770b2d 100644
--- a/src/command.c
+++ b/src/command.c
@@ -94,7 +94,9 @@ static CommandInfo cmd_list[] = {
{"hint-image-tabopen", NULL, command_hints, {HINTS_TYPE_IMAGE | HINTS_PROCESS_OPEN | HINTS_OPEN_NEW}},
{"hint-editor", NULL, command_hints, {HINTS_TYPE_EDITABLE}},
{"hint-save", NULL, command_hints, {HINTS_TYPE_LINK | HINTS_PROCESS_SAVE}},
+#ifdef FEATURE_QUEUE
{"hint-push", NULL, command_hints, {HINTS_TYPE_LINK | HINTS_PROCESS_PUSH}},
+#endif
{"yank-uri", "yu", command_yank, {VB_CLIPBOARD_PRIMARY | VB_CLIPBOARD_SECONDARY | COMMAND_YANK_URI}},
{"yank-selection", "ys", command_yank, {VB_CLIPBOARD_PRIMARY | VB_CLIPBOARD_SECONDARY | COMMAND_YANK_SELECTION}},
{"search-forward", NULL, command_search, {VB_SEARCH_FORWARD}},
@@ -122,8 +124,10 @@ static CommandInfo cmd_list[] = {
{"descent!", NULL, command_descent, {1}},
{"save", NULL, command_save, {COMMAND_SAVE_CURRENT}},
{"shellcmd", NULL, command_shellcmd, {0}},
+#ifdef FEATURE_QUEUE
{"push", NULL, command_queue, {COMMAND_QUEUE_PUSH}},
{"pop", NULL, command_queue, {COMMAND_QUEUE_POP}},
+#endif
};
static void editor_resume(GPid pid, int status, OpenEditorData *data);
@@ -487,9 +491,12 @@ gboolean command_hints(const Arg *arg)
prefix = ";y";
} else if (mode & HINTS_PROCESS_SAVE) {
prefix = ";s";
- } else if (mode & HINTS_PROCESS_PUSH) {
+ }
+#ifdef FEATURE_QUEUE
+ else if (mode & HINTS_PROCESS_PUSH) {
prefix = ";p";
}
+#endif
break;
case HINTS_TYPE_IMAGE:
@@ -891,6 +898,7 @@ gboolean command_shellcmd(const Arg *arg)
return false;
}
+#ifdef FEATURE_QUEUE
gboolean command_queue(const Arg *arg)
{
gboolean res = false;
@@ -915,6 +923,7 @@ gboolean command_queue(const Arg *arg)
}
return res;
}
+#endif
gboolean command_editor(const Arg *arg)
{
diff --git a/src/command.h b/src/command.h
index b12dccb..321c76d 100644
--- a/src/command.h
+++ b/src/command.h
@@ -44,10 +44,12 @@ enum {
COMMAND_SAVE_URI
};
+#ifdef FEATURE_QUEUE
enum {
COMMAND_QUEUE_PUSH,
COMMAND_QUEUE_POP
};
+#endif
typedef gboolean (*Command)(const Arg *arg);
@@ -86,6 +88,8 @@ gboolean command_nextprev(const Arg *arg);
gboolean command_descent(const Arg *arg);
gboolean command_save(const Arg *arg);
gboolean command_shellcmd(const Arg *arg);
+#ifdef FEATURE_QUEUE
gboolean command_queue(const Arg *arg);
+#endif
#endif /* end of include guard: _COMMAND_H */
diff --git a/src/config.def.h b/src/config.def.h
index e42a1f4..3fb4937 100644
--- a/src/config.def.h
+++ b/src/config.def.h
@@ -27,6 +27,7 @@
#define FEATURE_NO_SCROLLBARS
/*#define FEATURE_GTK_PROGRESSBAR*/
#define FEATURE_TITLE_IN_COMPLETION
+#define FEATURE_QUEUE
/* time in seconds after that message will be removed from inputbox if the
diff --git a/src/default.h b/src/default.h
index 18c6065..c612fe0 100644
--- a/src/default.h
+++ b/src/default.h
@@ -68,7 +68,9 @@ static char *default_config[] = {
"nmap ;I=hint-image-tabopen",
"nmap ;e=hint-editor",
"nmap ;s=hint-save",
+#ifdef FEATURE_QUEUE
"nmap ;p=hint-push",
+#endif
"nmap y=yank-uri",
"nmap Y=yank-selection",
"nmap p=open-clipboard",
diff --git a/src/hints.c b/src/hints.c
index a79ec62..007832a 100644
--- a/src/hints.c
+++ b/src/hints.c
@@ -169,11 +169,15 @@ static void run_script(char *js)
a.s = v;
a.i = COMMAND_SAVE_URI;
command_save(&a);
- } else if (mode & HINTS_PROCESS_PUSH) {
+ }
+#ifdef FEATURE_QUEUE
+ else if (mode & HINTS_PROCESS_PUSH) {
a.s = v;
a.i = COMMAND_QUEUE_PUSH;
command_queue(&a);
- } else {
+ }
+#endif
+ else {
a.i = VB_CLIPBOARD_PRIMARY | VB_CLIPBOARD_SECONDARY;
a.s = v;
command_yank(&a);
diff --git a/src/hints.h b/src/hints.h
index 6f835b9..a2f5380 100644
--- a/src/hints.h
+++ b/src/hints.h
@@ -34,7 +34,9 @@ enum {
HINTS_PROCESS_SAVE = (1 << 5),
/* additional flag for HINTS_PROCESS_OPEN */
HINTS_OPEN_NEW = (1 << 6),
+#ifdef FEATURE_QUEUE
HINTS_PROCESS_PUSH = (1 << 7),
+#endif
};
void hints_init(WebKitWebFrame *frame);
diff --git a/src/main.c b/src/main.c
index c95256e..3f25eea 100644
--- a/src/main.c
+++ b/src/main.c
@@ -863,8 +863,10 @@ static void init_files(void)
vb.files[FILES_BOOKMARK] = g_build_filename(path, "bookmark", NULL);
util_create_file_if_not_exists(vb.files[FILES_BOOKMARK]);
+#ifdef FEATURE_QUEUE
vb.files[FILES_QUEUE] = g_build_filename(path, "queue", NULL);
util_create_file_if_not_exists(vb.files[FILES_QUEUE]);
+#endif
vb.files[FILES_SCRIPT] = g_build_filename(path, "scripts.js", NULL);
diff --git a/src/main.h b/src/main.h
index 060aa5f..6e6854d 100644
--- a/src/main.h
+++ b/src/main.h
@@ -210,7 +210,9 @@ typedef enum {
FILES_COMMAND,
FILES_SEARCH,
FILES_BOOKMARK,
+#ifdef FEATURE_QUEUE
FILES_QUEUE,
+#endif
FILES_USER_STYLE,
FILES_LAST
} VbFile;