diff options
author | portix <none@none> | 2012-10-26 21:43:31 +0200 |
---|---|---|
committer | portix <none@none> | 2012-10-26 21:43:31 +0200 |
commit | 636103f4496a8005ebaaf3aa10eb3ef95be8e2b6 (patch) | |
tree | 928714c6b7fad2daadbf3bfa25b8915d5a224009 /src | |
parent | 78f702905ada582dbca9ec6fd7d0a7c7345fddf0 (diff) | |
download | dwb-636103f4496a8005ebaaf3aa10eb3ef95be8e2b6.zip |
Indicator for quick/bookmarks
Diffstat (limited to 'src')
-rw-r--r-- | src/dwb.c | 13 | ||||
-rw-r--r-- | src/util.c | 9 | ||||
-rw-r--r-- | src/util.h | 4 |
3 files changed, 26 insertions, 0 deletions
@@ -660,6 +660,19 @@ dwb_update_status_text(GList *gl, GtkAdjustment *a) { g_string_append_c(string, 'u'); g_string_append(string, "</span>]"); } + if (webkit_web_view_get_load_status(WEBVIEW(gl)) == WEBKIT_LOAD_FINISHED) { + const char *uri = webkit_web_view_get_uri(WEBVIEW(gl)); + gboolean has_quickmark = g_list_find_custom(dwb.fc.quickmarks, uri, (GCompareFunc)util_quickmark_compare_uri) != NULL; + gboolean has_bookmark = g_list_find_custom(dwb.fc.bookmarks, uri, (GCompareFunc)util_navigation_compare_uri) != NULL; + if (has_quickmark || has_bookmark) { + g_string_append_c(string, '['); + if (has_quickmark) + g_string_append_c(string, 'Q'); + if (has_bookmark) + g_string_append_c(string, 'B'); + g_string_append_c(string, ']'); + } + } if (v->status->progress != 0) { wchar_t *bar_blocks = PROGRESS_DEFAULT; wchar_t buffer[PBAR_LENGTH + 1] = { 0 }; @@ -213,6 +213,11 @@ int util_navigation_compare_first(Navigation *a, Navigation *b) { return (g_strcmp0(a->first, b->first)); }/*}}}*/ +/* util_navigation_compare_uri {{{*/ +int +util_navigation_compare_uri(Navigation *a, const char *uri) { + return (g_strcmp0(a->first, uri)); +}/*}}}*/ /* util_navigation_sort_first {{{*/ int util_navigation_compare_second(Navigation *a, Navigation *b) { @@ -222,6 +227,10 @@ int util_quickmark_compare(Quickmark *a, Quickmark *b) { return g_strcmp0(a->key, b->key); } +int +util_quickmark_compare_uri(Quickmark *a, const char *uri) { + return g_strcmp0(a->nav->first, uri); +} /* util_keymap_sort_first(KeyMap *, KeyMap *) {{{*/ int util_keymap_sort_first(KeyMap *a, KeyMap *b) { @@ -41,6 +41,7 @@ Arg * util_char_to_arg(char *, DwbType ); // sort int util_navigation_compare_first(Navigation *, Navigation *); int util_navigation_compare_second(Navigation *, Navigation *); +int util_navigation_compare_uri(Navigation *, const char *); int util_keymap_sort_first(KeyMap *, KeyMap *); int util_keymap_sort_second(KeyMap *, KeyMap *); @@ -73,6 +74,7 @@ void dwb_quickmark_free(Quickmark *); Quickmark * dwb_quickmark_new(const char *, const char *, const char *); Quickmark * dwb_quickmark_new_from_line(const char *); int util_quickmark_compare(Quickmark *a, Quickmark *b); +int util_quickmark_compare_uri(Quickmark *a, const char *); // useless char * dwb_return(const char *); @@ -99,5 +101,7 @@ const char * util_str_chug(const char *str); Sanitize util_string_to_sanitize(const char *); char *util_create_json(int, ...); +char *util_create_json(int, ...); + #endif |