From 71ef1cefd0ae3a8c3d5666c33dc4f6d0aec8c028 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sun, 8 Oct 2017 14:10:11 +0200 Subject: [PATCH] FirefoxImporter: Allow to import bookmarks with empty name Url will be used as title in this case. Closes #2431 --- src/lib/bookmarks/bookmarksimport/firefoximporter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/bookmarks/bookmarksimport/firefoximporter.cpp b/src/lib/bookmarks/bookmarksimport/firefoximporter.cpp index fc00d8406..9e3b3e79c 100644 --- a/src/lib/bookmarks/bookmarksimport/firefoximporter.cpp +++ b/src/lib/bookmarks/bookmarksimport/firefoximporter.cpp @@ -1,6 +1,6 @@ /* ============================================================ -* Falkon - Qt web browser -* Copyright (C) 2010-2014 David Rosca +* QupZilla - Qt web browser +* Copyright (C) 2010-2017 David Rosca * * 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);