mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 12:46:35 +01:00
sidebar: port foreach -> range-based for
Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
This commit is contained in:
parent
1a3f887145
commit
da73eb5c77
@ -88,9 +88,9 @@ void BookmarksSidebar::openBookmarkInNewPrivateWindow(BookmarkItem* item)
|
||||
|
||||
void BookmarksSidebar::deleteBookmarks()
|
||||
{
|
||||
QList<BookmarkItem*> items = ui->tree->selectedBookmarks();
|
||||
const QList<BookmarkItem*> items = ui->tree->selectedBookmarks();
|
||||
|
||||
foreach (BookmarkItem* item, items) {
|
||||
for (BookmarkItem* item : items) {
|
||||
if (m_bookmarks->canBeModified(item)) {
|
||||
m_bookmarks->removeBookmark(item);
|
||||
}
|
||||
@ -113,9 +113,9 @@ void BookmarksSidebar::createContextMenu(const QPoint &pos)
|
||||
connect(actDelete, &QAction::triggered, this, &BookmarksSidebar::deleteBookmarks);
|
||||
|
||||
bool canBeDeleted = false;
|
||||
QList<BookmarkItem*> items = ui->tree->selectedBookmarks();
|
||||
const QList<BookmarkItem*> items = ui->tree->selectedBookmarks();
|
||||
|
||||
foreach (BookmarkItem* item, items) {
|
||||
for (BookmarkItem* item : items) {
|
||||
if (m_bookmarks->canBeModified(item)) {
|
||||
canBeDeleted = true;
|
||||
break;
|
||||
|
@ -118,7 +118,7 @@ void SideBarManager::createMenu(QMenu* menu)
|
||||
act->setChecked(m_activeBar == QL1S("History"));
|
||||
group->addAction(act);
|
||||
|
||||
foreach (const QPointer<SideBarInterface> &sidebar, s_sidebars) {
|
||||
for (const QPointer<SideBarInterface> &sidebar : qAsConst(s_sidebars)) {
|
||||
if (sidebar) {
|
||||
QAction* act = sidebar.data()->createMenuAction();
|
||||
act->setData(s_sidebars.key(sidebar));
|
||||
@ -146,7 +146,8 @@ void SideBarManager::removeSidebar(SideBarInterface *interface)
|
||||
|
||||
s_sidebars.remove(id);
|
||||
|
||||
foreach (BrowserWindow* window, mApp->windows()) {
|
||||
const auto windows = mApp->windows();
|
||||
for (BrowserWindow* window : windows) {
|
||||
window->sideBarManager()->sideBarRemoved(id);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user