Fixed to use 'bookmarks/urls' file instead of bookmarks.
This commit is contained in:
parent
c4fc5c0c43
commit
d93732a6b3
@ -25,6 +25,7 @@ OrderedDict. This is because we read them from a file at start and write them
|
|||||||
to a file on shutdown, so it makes sense to keep them as strings here.
|
to a file on shutdown, so it makes sense to keep them as strings here.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
@ -66,8 +67,11 @@ class BookmarkManager(QObject):
|
|||||||
if standarddir.config() is None:
|
if standarddir.config() is None:
|
||||||
self._lineparser = None
|
self._lineparser = None
|
||||||
else:
|
else:
|
||||||
|
bookmarks_directory = os.path.join(standarddir.config(), 'bookmarks')
|
||||||
|
if not os.path.isdir(bookmarks_directory):
|
||||||
|
os.makedirs(bookmarks_directory)
|
||||||
self._lineparser = lineparser.LineParser(
|
self._lineparser = lineparser.LineParser(
|
||||||
standarddir.config(), 'bookmarks', parent=self)
|
standarddir.config(), 'bookmarks/urls', parent=self)
|
||||||
for line in self._lineparser:
|
for line in self._lineparser:
|
||||||
if not line.strip():
|
if not line.strip():
|
||||||
# Ignore empty or whitespace-only lines.
|
# Ignore empty or whitespace-only lines.
|
||||||
@ -78,7 +82,7 @@ class BookmarkManager(QObject):
|
|||||||
message.error(0, "Invalid bookmark '{}'".format(line))
|
message.error(0, "Invalid bookmark '{}'".format(line))
|
||||||
else:
|
else:
|
||||||
self.bookmarks[url] = title
|
self.bookmarks[url] = title
|
||||||
filename = os.path.join(standarddir.config(), 'bookmarks')
|
filename = os.path.join(standarddir.config(), 'bookmarks/urls')
|
||||||
objreg.get('save-manager').add_saveable(
|
objreg.get('save-manager').add_saveable(
|
||||||
'bookmark-manager', self.save, self.changed,
|
'bookmark-manager', self.save, self.changed,
|
||||||
filename=filename)
|
filename=filename)
|
||||||
|
Loading…
Reference in New Issue
Block a user