Allow to switch off queue feature via config.h.
authorDaniel Carl <danielcarl@gmx.de>
Tue, 30 Jul 2013 21:12:47 +0000 (23:12 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Tue, 30 Jul 2013 21:34:53 +0000 (23:34 +0200)
doc/vimb.1
src/bookmark.c
src/bookmark.h
src/command.c
src/command.h
src/config.def.h
src/default.h
src/hints.c
src/hints.h
src/main.c
src/main.h

index d2d7572..f551d7a 100644 (file)
@@ -240,7 +240,8 @@ Start hinting to open inputboxes or textareas with external editor.
 Start hinting to download hinted links into configured download directory.
 .TP
 .BI "hint-push [" QUERY "]"
-Start hinting to push hinted URI into the read it later queue.
+Start hinting to push hinted URI into the read it later queue. If PROJECT hab
+been compiled with QUEUE feature.
 
 .SS Yank
 .TP
@@ -330,14 +331,16 @@ page.
 
 .SS Queue
 The queue allows to mark URLs for later reding (something like a read it later
-list). This list is shared between the single instances of PROJECT.
+list). This list is shared between the single instances of PROJECT. Only
+available if PROJECT has been compiled with QUEUE feature.
 .TP
 .BI "push [" URI ]
-Push \fIURI\fP or if not given current URI into the queue.
+Push \fIURI\fP or if not given
+current URI into the queue.
 .TP
 .B pop
-Open the oldest queue entry in current browser window and remove it from the
-queue.
+Open the oldest queue entry
+in current browser window and remove it from the queue.
 
 .SS Misc
 .TP
@@ -583,7 +586,8 @@ Start hinting to open editable form fileds with external editor.
 Start hinting to download the linkes resource.
 .TP
 .B ;\-p
-Start hinting to push hinted URI into queue.
+If PROJECT has been compiled with QUEUE feature. Start hinting to push hinted
+URI into queue.
 .TP
 .B y
 Yank the URI or current page into clipboard.
@@ -674,7 +678,8 @@ Holds the bookmarks saved with command `bookmark-add'.
 .RE
 .I $XDG_CONFIG_HOME/PROJECT/queue
 .RS
-Holds the read it later queue filled by `hint-push' or `push'.
+Holds the read it later queue filled by `hint-push' or `push' if PROJECT has
+been compiled with QUEUE feature.
 .RE
 .I $XDG_CONFIG_HOME/PROJECT/scripts.js
 .RS
index cdcdd78..330e196 100644 (file)
@@ -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)
 {
index c1986d4..8ecf929 100644 (file)
@@ -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 */
index 82921c2..a770b2d 100644 (file)
@@ -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)
 {
index b12dccb..321c76d 100644 (file)
@@ -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 */
index e42a1f4..3fb4937 100644 (file)
@@ -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
index 18c6065..c612fe0 100644 (file)
@@ -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",
index a79ec62..007832a 100644 (file)
@@ -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);
index 6f835b9..a2f5380 100644 (file)
@@ -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);
index c95256e..3f25eea 100644 (file)
@@ -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);
 
index 060aa5f..6e6854d 100644 (file)
@@ -210,7 +210,9 @@ typedef enum {
     FILES_COMMAND,
     FILES_SEARCH,
     FILES_BOOKMARK,
+#ifdef FEATURE_QUEUE
     FILES_QUEUE,
+#endif
     FILES_USER_STYLE,
     FILES_LAST
 } VbFile;