mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
FirefoxImporter: Allow to import bookmarks with empty name
Url will be used as title in this case. Closes #2431
This commit is contained in:
parent
48d18a3b35
commit
71ef1cefd0
|
@ -1,6 +1,6 @@
|
|||
/* ============================================================
|
||||
* Falkon - Qt web browser
|
||||
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -89,7 +89,7 @@ BookmarkItem* FirefoxImporter::importBookmarks()
|
|||
root->setTitle("Firefox Import");
|
||||
|
||||
QSqlQuery query(QSqlDatabase::database(CONNECTION));
|
||||
query.exec("SELECT id, parent, type, title, fk FROM moz_bookmarks WHERE title != '' OR type = 3");
|
||||
query.exec("SELECT id, parent, type, title, fk FROM moz_bookmarks WHERE fk NOT NULL OR type = 3");
|
||||
|
||||
while (query.next()) {
|
||||
Item item;
|
||||
|
@ -128,7 +128,7 @@ BookmarkItem* FirefoxImporter::importBookmarks()
|
|||
foreach (const Item &item, items) {
|
||||
BookmarkItem* parent = hash.value(item.parent);
|
||||
BookmarkItem* bookmark = new BookmarkItem(item.type, parent ? parent : root);
|
||||
bookmark->setTitle(item.title);
|
||||
bookmark->setTitle(item.title.isEmpty() ? item.url.toString() : item.title);
|
||||
bookmark->setUrl(item.url);
|
||||
|
||||
hash.insert(item.id, bookmark);
|
||||
|
|
Loading…
Reference in New Issue
Block a user