Allow to enable/disable title in completions on compile time.
authorDaniel Carl <danielcarl@gmx.de>
Tue, 16 Jul 2013 21:11:59 +0000 (23:11 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Tue, 16 Jul 2013 21:11:59 +0000 (23:11 +0200)
config.mk
src/bookmark.c
src/completion.c
src/completion.h
src/history.c

index e9a41e5..3217c87 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -13,6 +13,7 @@ CPPFLAGS += -DFEATURE_COOKIE
 CPPFLAGS += -DFEATURE_SEARCH_HIGHLIGHT
 CPPFLAGS += -DFEATURE_NO_SCROLLBARS
 #CPPFLAGS += -DFEATURE_GTK_PROGRESSBAR
+CPPFLAGS += -DFEATURE_TITLE_IN_COMPLETION
 
 LIBS = libsoup-2.4
 
index 1f1b6cd..84ce880 100644 (file)
@@ -122,7 +122,10 @@ gboolean bookmark_fill_completion(GtkListStore *store, const char *input)
             gtk_list_store_set(
                 store, &iter,
                 COMPLETION_STORE_FIRST, bm->uri,
-                COMPLETION_STORE_SECOND, bm->title, -1
+#ifdef FEATURE_TITLE_IN_COMPLETION
+                COMPLETION_STORE_SECOND, bm->title,
+#endif
+                -1
             );
             found = true;
         }
@@ -139,7 +142,10 @@ gboolean bookmark_fill_completion(GtkListStore *store, const char *input)
                 gtk_list_store_set(
                     store, &iter,
                     COMPLETION_STORE_FIRST, bm->uri,
-                    COMPLETION_STORE_SECOND, bm->title, -1
+#ifdef FEATURE_TITLE_IN_COMPLETION
+                    COMPLETION_STORE_SECOND, bm->title,
+#endif
+                    -1
                 );
                 found = true;
             }
index eb79209..b1ce400 100644 (file)
@@ -178,6 +178,7 @@ static void init_completion(GtkTreeModel *model)
     gtk_tree_view_column_set_min_width(column, 2 * width/3);
 
     /* prepare second column */
+#ifdef FEATURE_TITLE_IN_COMPLETION
     column = gtk_tree_view_column_new();
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
     gtk_tree_view_append_column(GTK_TREE_VIEW(comp.tree), column);
@@ -190,6 +191,7 @@ static void init_completion(GtkTreeModel *model)
     );
     gtk_tree_view_column_pack_start(column, renderer, true);
     gtk_tree_view_column_add_attribute(column, renderer, "text", COMPLETION_STORE_SECOND);
+#endif
 
     /* use max 1/3 of window height for the completion */
 #ifdef HAS_GTK3
index 7a3ea26..e628b39 100644 (file)
@@ -24,7 +24,9 @@
 
 enum {
     COMPLETION_STORE_FIRST,
+#ifdef FEATURE_TITLE_IN_COMPLETION
     COMPLETION_STORE_SECOND,
+#endif
     COMPLETION_STORE_NUM
 };
 
index d09d2a9..8072962 100644 (file)
@@ -141,7 +141,10 @@ gboolean history_fill_completion(GtkListStore *store, HistoryType type, const ch
             gtk_list_store_set(
                 store, &iter,
                 COMPLETION_STORE_FIRST, item->first,
-                COMPLETION_STORE_SECOND, item->second, -1
+#ifdef FEATURE_TITLE_IN_COMPLETION
+                COMPLETION_STORE_SECOND, item->second,
+#endif
+                -1
             );
             found = true;
         }
@@ -156,7 +159,10 @@ gboolean history_fill_completion(GtkListStore *store, HistoryType type, const ch
                 gtk_list_store_set(
                     store, &iter,
                     COMPLETION_STORE_FIRST, item->first,
-                    COMPLETION_STORE_SECOND, item->second, -1
+#ifdef FEATURE_TITLE_IN_COMPLETION
+                    COMPLETION_STORE_SECOND, item->second,
+#endif
+                    -1
                 );
                 found = true;
             }
@@ -170,7 +176,10 @@ gboolean history_fill_completion(GtkListStore *store, HistoryType type, const ch
                 gtk_list_store_set(
                     store, &iter,
                     COMPLETION_STORE_FIRST, item->first,
-                    COMPLETION_STORE_SECOND, item->second, -1
+#ifdef FEATURE_TITLE_IN_COMPLETION
+                    COMPLETION_STORE_SECOND, item->second,
+#endif
+                    -1
                 );
                 found = true;
             }