Use history item's url as title if no title.

This commit is contained in:
Imran Sobir 2017-02-07 16:06:19 +05:00
parent f5e75ff870
commit be12b4cccf

View File

@ -185,15 +185,19 @@ def qute_history(url):
continue continue
# Skip items not on curr_date # Skip items not on curr_date
# Skip redirects and items without title # Skip redirects
# Skip qute:// links # Skip qute:// links
is_internal = item.url.scheme() == 'qute' is_internal = item.url.scheme() == 'qute'
is_not_today = item_atime.date() != curr_date is_not_today = item_atime.date() != curr_date
if item.redirect or is_internal or not item.title or is_not_today: if item.redirect or is_internal or is_not_today:
continue continue
# Use item's url as title if there's no title.
item_url = item.url.toDisplayString()
item_title = item.title if item.title else item_url
display_atime = item_atime.strftime("%X") display_atime = item_atime.strftime("%X")
yield (item.url.toDisplayString(), item.title, display_atime)
yield (item_url, item_title, display_atime)
try: try:
history = reversed(history_iter()) history = reversed(history_iter())