mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
[Bookmarks] Fixed assert when migrating bookmarks
Assert when user had bookmark with folder that doesn't exists Also save bookmarks as soon as they are migrated Closes #1213
This commit is contained in:
parent
b880a920ff
commit
851e19ce01
|
@ -262,7 +262,12 @@ void Bookmarks::init()
|
|||
m_folderUnsorted->setTitle(tr("Unsorted Bookmarks"));
|
||||
m_folderUnsorted->setDescription(tr("All other bookmarks"));
|
||||
|
||||
if (!BookmarksTools::migrateBookmarksIfNecessary(this)) {
|
||||
if (BookmarksTools::migrateBookmarksIfNecessary(this)) {
|
||||
// Bookmarks migrated just now, let's save them ASAP
|
||||
saveBookmarks();
|
||||
}
|
||||
else {
|
||||
// Bookmarks don't need to be migrated, just load them as usual
|
||||
loadBookmarks();
|
||||
}
|
||||
|
||||
|
|
|
@ -376,7 +376,7 @@ bool BookmarksTools::migrateBookmarksIfNecessary(Bookmarks* bookmarks)
|
|||
const QUrl url = query.value(2).toUrl();
|
||||
|
||||
BookmarkItem* parent = folders.value(folder);
|
||||
if (folder.isEmpty()) {
|
||||
if (!parent) {
|
||||
parent = bookmarks->unsortedFolder();
|
||||
}
|
||||
Q_ASSERT(parent);
|
||||
|
|
Loading…
Reference in New Issue
Block a user