Fixed empty title.
This commit is contained in:
parent
1e354a797e
commit
5dbaea7a83
@ -76,12 +76,13 @@ class BookmarkManager(QObject):
|
||||
if not line.strip():
|
||||
# Ignore empty or whitespace-only lines.
|
||||
continue
|
||||
try:
|
||||
url, title = line.split(maxsplit=1)
|
||||
except ValueError:
|
||||
message.error(0, "Invalid bookmark '{}'".format(line))
|
||||
else:
|
||||
self.bookmarks[url] = title
|
||||
|
||||
parts = line.split(maxsplit=1)
|
||||
if len(parts) == 2:
|
||||
self.bookmarks[parts[0]] = parts[1]
|
||||
elif len(parts) == 1:
|
||||
self.bookmarks[parts[0]] = ''
|
||||
|
||||
filename = os.path.join(standarddir.config(), 'bookmarks/urls')
|
||||
objreg.get('save-manager').add_saveable(
|
||||
'bookmark-manager', self.save, self.changed,
|
||||
|
@ -102,8 +102,7 @@ class CommandDispatcher:
|
||||
|
||||
def _current_title(self):
|
||||
"""Convenience method to get the current title."""
|
||||
title = self._current_widget().title()
|
||||
return title if title else "(null)"
|
||||
return self._current_widget().title()
|
||||
|
||||
def _current_widget(self):
|
||||
"""Get the currently active widget from a command."""
|
||||
|
Loading…
Reference in New Issue
Block a user