1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Show unsorted bookmarks in bookmarks menu.

This commit is contained in:
nowrep 2012-09-08 19:42:40 +02:00
parent de6ce70038
commit a79522be4d

View File

@ -832,6 +832,25 @@ void QupZilla::aboutToShowBookmarksMenu()
m_menuBookmarks->addMenu(tempFolder);
}
m_menuBookmarks->addSeparator();
query.exec("SELECT title, url, icon FROM bookmarks WHERE folder='unsorted'");
while (query.next()) {
QString title = query.value(0).toString();
const QUrl &url = query.value(1).toUrl();
const QIcon &icon = qIconProvider->iconFromImage(QImage::fromData(query.value(2).toByteArray()));
if (title.length() > 40) {
title.truncate(40);
title += "..";
}
Action* act = new Action(icon, title);
act->setData(url);
connect(act, SIGNAL(triggered()), this, SLOT(loadActionUrl()));
connect(act, SIGNAL(middleClicked()), this, SLOT(loadActionUrlInNewNotSelectedTab()));
m_menuBookmarks->addAction(act);
}
m_menuBookmarksAction->setVisible(m_bookmarksToolbar->isVisible());
}