1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

sidebar: port foreach -> range-based for

Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
This commit is contained in:
Juraj Oravec 2019-12-30 20:35:42 +01:00
parent 1a3f887145
commit da73eb5c77
No known key found for this signature in database
GPG Key ID: 63ACB65056BC8D07
2 changed files with 7 additions and 6 deletions

View File

@ -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;

View File

@ -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);
}
}