]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphintabbar.cpp
Merge branch 'release/20.12'
[dolphin.git] / src / dolphintabbar.cpp
index 484a9f3a07e7f6f03e5b7c8c53c79f07ff73d6fe..67a61b0315810ebb2c9d204f5b2df2c74c436827 100644 (file)
@@ -1,31 +1,17 @@
-/***************************************************************************
- * Copyright (C) 2014 by Emmanuel Pescosta <emmanuelpescosta099@gmail.com> *
- *                                                                         *
- *   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  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2014 Emmanuel Pescosta <emmanuelpescosta099@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #include "dolphintabbar.h"
 
-#include <QTimer>
-#include <QDragEnterEvent>
 #include <KLocalizedString>
+
+#include <QDragEnterEvent>
 #include <QMenu>
-#include <QIcon>
-#include <QUrl>
 #include <QMimeData>
+#include <QTimer>
 
 DolphinTabBar::DolphinTabBar(QWidget* parent) :
     QTabBar(parent),
@@ -85,7 +71,7 @@ void DolphinTabBar::dropEvent(QDropEvent* event)
     const int index = tabAt(event->pos());
 
     if (index >= 0 && mimeData->hasUrls()) {
-        emit tabDropEvent(index, event);
+        Q_EMIT tabDropEvent(index, event);
     }
 
     QTabBar::dropEvent(event);
@@ -110,7 +96,7 @@ void DolphinTabBar::mouseReleaseEvent(QMouseEvent *event)
     if (index >= 0 && index == m_tabToBeClosedOnMiddleMouseButtonRelease
         && event->button() == Qt::MiddleButton) {
         // Mouse middle click on a tab closes this tab.
-        emit tabCloseRequested(index);
+        Q_EMIT tabCloseRequested(index);
         return;
     }
 
@@ -124,7 +110,7 @@ void DolphinTabBar::mouseDoubleClickEvent(QMouseEvent* event)
     if (index < 0) {
         // Double click on the empty tabbar area opens a new activated tab
         // with the url from the current tab.
-        emit openNewActivatedTab(currentIndex());
+        Q_EMIT openNewActivatedTab(currentIndex());
         return;
     }
 
@@ -146,19 +132,19 @@ void DolphinTabBar::contextMenuEvent(QContextMenuEvent* event)
 
         QAction* selectedAction = menu.exec(event->globalPos());
         if (selectedAction == newTabAction) {
-            emit openNewActivatedTab(index);
+            Q_EMIT openNewActivatedTab(index);
         } else if (selectedAction == detachTabAction) {
-            emit tabDetachRequested(index);
+            Q_EMIT tabDetachRequested(index);
         } else if (selectedAction == closeOtherTabsAction) {
             const int tabCount = count();
             for (int i = 0; i < index; i++) {
-                emit tabCloseRequested(0);
+                Q_EMIT tabCloseRequested(0);
             }
             for (int i = index + 1; i < tabCount; i++) {
-                emit tabCloseRequested(1);
+                Q_EMIT tabCloseRequested(1);
             }
         } else if (selectedAction == closeTabAction) {
-            emit tabCloseRequested(index);
+            Q_EMIT tabCloseRequested(index);
         }
 
         return;