]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Cleanup unused colors. Use const. Use KColorScheme danger.
[dolphin.git] / src / dolphinmainwindow.cpp
index f7ec5f511f9ad64d0ba28afbd380a360a5f681c5..e755e7281708a200527ea0c2a9f520fb39534ddf 100644 (file)
@@ -306,7 +306,7 @@ void DolphinMainWindow::changeUrl(const QUrl &url)
     updateViewActions();
     updateGoActions();
 
-    emit urlChanged(url);
+    Q_EMIT urlChanged(url);
 }
 
 void DolphinMainWindow::slotTerminalDirectoryChanged(const QUrl& url)
@@ -341,7 +341,7 @@ void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
         compareFilesAction->setEnabled(false);
     }
 
-    emit selectionChanged(selection);
+    Q_EMIT selectionChanged(selection);
 }
 
 void DolphinMainWindow::updateHistory()
@@ -427,7 +427,7 @@ void DolphinMainWindow::openInNewTab()
     const KFileItemList& list = m_activeViewContainer->view()->selectedItems();
     bool tabCreated = false;
 
-    foreach (const KFileItem& item, list) {
+    for (const KFileItem& item : list) {
         const QUrl& url = DolphinView::openItemAsFolderUrl(item);
         if (!url.isEmpty()) {
             openNewTabAfterCurrentTab(url);
@@ -861,7 +861,8 @@ void DolphinMainWindow::replaceLocation()
 void DolphinMainWindow::togglePanelLockState()
 {
     const bool newLockState = !GeneralSettings::lockPanels();
-    foreach (QObject* child, children()) {
+    const auto childrenObjects = children();
+    for (QObject* child : childrenObjects) {
         DolphinDockWidget* dock = qobject_cast<DolphinDockWidget*>(child);
         if (dock) {
             dock->setLocked(newLockState);
@@ -1261,7 +1262,7 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer)
     updateSearchAction();
 
     const QUrl url = viewContainer->url();
-    emit urlChanged(url);
+    Q_EMIT urlChanged(url);
 }
 
 void DolphinMainWindow::tabCountChanged(int count)
@@ -2083,7 +2084,8 @@ bool DolphinMainWindow::addActionToMenu(QAction* action, QMenu* menu)
     Q_ASSERT(menu);
 
     const KToolBar* toolBarWidget = toolBar();
-    foreach (const QWidget* widget, action->associatedWidgets()) {
+    const auto associatedWidgets = action->associatedWidgets();
+    for (const QWidget* widget : associatedWidgets) {
         if (widget == toolBarWidget) {
             return false;
         }
@@ -2106,7 +2108,7 @@ void DolphinMainWindow::refreshViews()
         updateWindowTitle();
     }
 
-    emit settingsChanged();
+    Q_EMIT settingsChanged();
 }
 
 void DolphinMainWindow::clearStatusBar()