-/***************************************************************************
- * Copyright (C) 2006-2009 by Peter Penz <peter.penz19@gmail.com> *
- * Copyright (C) 2006 by Gregor Kališnik <gregor@podnapisi.net> *
- * *
- * 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: 2006-2009 Peter Penz <peter.penz19@gmail.com>
+ * SPDX-FileCopyrightText: 2006 Gregor Kališnik <gregor@podnapisi.net>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
#include "dolphinview.h"
connect(controller, &KItemListController::escapePressed, this, &DolphinView::stopLoading);
connect(controller, &KItemListController::modelChanged, this, &DolphinView::slotModelChanged);
connect(controller, &KItemListController::selectedItemTextPressed, this, &DolphinView::slotSelectedItemTextPressed);
+ connect(controller, &KItemListController::increaseZoom, this, &DolphinView::slotIncreaseZoom);
+ connect(controller, &KItemListController::decreaseZoom, this, &DolphinView::slotDecreaseZoom);
+ connect(controller, &KItemListController::swipeUp, this, &DolphinView::slotSwipeUp);
connect(m_model, &KFileItemModel::directoryLoadingStarted, this, &DolphinView::slotDirectoryLoadingStarted);
connect(m_model, &KFileItemModel::directoryLoadingCompleted, this, &DolphinView::slotDirectoryLoadingCompleted);
if (GeneralSettings::showToolTips()) {
m_toolTipManager->hideToolTip(behavior);
}
+#else
+ Q_UNUSED(behavior)
#endif
}
markUrlAsCurrent(current);
markUrlsAsSelected(selected);
}
+
+void DolphinView::copyPathToClipboard()
+{
+ const KFileItemList list = selectedItems();
+ if (list.isEmpty()) {
+ return;
+ }
+ const KFileItem& item = list.at(0);
+ QString path = item.localPath();
+ if (path.isEmpty()) {
+ path = item.url().toDisplayString();
+ }
+ QClipboard* clipboard = QApplication::clipboard();
+ if (clipboard == nullptr) {
+ return;
+ }
+ clipboard->setText(path);
+}
+
+void DolphinView::slotIncreaseZoom()
+{
+ setZoomLevel(zoomLevel() + 1);
+}
+
+void DolphinView::slotDecreaseZoom()
+{
+ setZoomLevel(zoomLevel() - 1);
+}
+
+void DolphinView::slotSwipeUp()
+{
+ emit goUpRequested();
+}