X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/4d930992c47140bc47dac2ecfe0c4ca7eca33be7..46d2d147bf0bcbfc6c8a69e1c49e0590b679b7b4:/src/views/dolphinview.cpp diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 1cc8a5f29..1d01b4c98 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -92,6 +92,7 @@ DolphinView::DolphinView(const QUrl &url, QWidget *parent) , m_currentItemUrl() , m_scrollToCurrentItem(false) , m_restoredContentsPosition() + , m_controlWheelAccumulatedDelta(0) , m_selectedUrls() , m_clearSelectionBeforeSelectingNewItems(false) , m_markFirstNewlySelectedItemAsCurrent(false) @@ -1092,11 +1093,12 @@ void DolphinView::slotItemsActivated(const KItemSet &indexes) {}, #endif KGuiItem(i18ncp("@action:button", "Open %1 Item", "Open %1 Items", indexes.count()), QStringLiteral("document-open")), - KStandardGuiItem::cancel()); + KStandardGuiItem::cancel(), + QStringLiteral("ConfirmOpenManyFolders")); #if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) - if (answer != KMessageBox::PrimaryAction) { + if (answer != KMessageBox::PrimaryAction && answer != KMessageBox::Continue) { #else - if (answer != KMessageBox::Yes) { + if (answer != KMessageBox::Yes && answer != KMessageBox::Continue) { #endif return; } @@ -1135,6 +1137,7 @@ void DolphinView::slotItemMiddleClicked(int index) const KFileItem &item = m_model->fileItem(index); const QUrl &url = openItemAsFolderUrl(item); const auto modifiers = QGuiApplication::keyboardModifiers(); + const QString &archiveProtocol = KProtocolManager::protocolForArchiveMimetype(item.mimetype()); if (!url.isEmpty()) { // keep in sync with KUrlNavigator::slotNavigatorButtonClicked if (modifiers & Qt::ShiftModifier) { @@ -1142,13 +1145,15 @@ void DolphinView::slotItemMiddleClicked(int index) } else { Q_EMIT tabRequested(url); } - } else if (isTabsForFilesEnabled()) { + } else if (!archiveProtocol.isEmpty() && isTabsForFilesEnabled()) { // keep in sync with KUrlNavigator::slotNavigatorButtonClicked if (modifiers & Qt::ShiftModifier) { Q_EMIT activeTabRequested(item.url()); } else { Q_EMIT tabRequested(item.url()); } + } else { + Q_EMIT fileMiddleClickActivated(item); } } @@ -2063,9 +2068,9 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray &role, con KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job); job->uiDelegate()->setAutoErrorHandlingEnabled(true); - forceUrlsSelection(newUrl, {newUrl}); - if (!newNameExistsAlready) { + forceUrlsSelection(newUrl, {newUrl}); + // Only connect the result signal if there is no item with the new name // in the model yet, see bug 328262. connect(job, &KJob::result, this, &DolphinView::slotRenamingResult); @@ -2418,3 +2423,5 @@ bool DolphinView::tryShowNameToolTip(QHelpEvent *event) } return false; } + +#include "moc_dolphinview.cpp"