diff --git a/app/imageopscontextmanageritem.cpp b/app/imageopscontextmanageritem.cpp --- a/app/imageopscontextmanageritem.cpp +++ b/app/imageopscontextmanageritem.cpp @@ -190,7 +190,7 @@ // Since we only support image operations on one image for now, // disable actions if several images are selected and the document // view is not visible. - if (contextManager()->selectedFileItemList().count() != 1) { + if (contextManager()->selectedFileItemList().count() > 1) { canModify = false; } } diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -1269,7 +1269,9 @@ bool hasPrevious; bool hasNext; QModelIndex currentIndex = d->mContextManager->selectionModel()->currentIndex(); - if (currentIndex.isValid() && !d->indexIsDirOrArchive(currentIndex)) { + if (d->mContextManager->selectionModel()->hasSelection() + && currentIndex.isValid() + && !d->indexIsDirOrArchive(currentIndex)) { int row = currentIndex.row(); QModelIndex prevIndex = d->mDirModel->index(row - 1, 0); QModelIndex nextIndex = d->mDirModel->index(row + 1, 0); diff --git a/app/sidebar.cpp b/app/sidebar.cpp --- a/app/sidebar.cpp +++ b/app/sidebar.cpp @@ -138,6 +138,7 @@ void SideBarGroup::clear() { if (d->mContainer) { + d->mContainer->hide(); d->mContainer->deleteLater(); } diff --git a/lib/contextmanager.h b/lib/contextmanager.h --- a/lib/contextmanager.h +++ b/lib/contextmanager.h @@ -89,7 +89,6 @@ private Q_SLOTS: void slotDirModelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); - void slotCurrentChanged(const QModelIndex&); void emitQueuedSignals(); void slotRowsAboutToBeRemoved(const QModelIndex& /*parent*/, int start, int end); void slotRowsInserted(); diff --git a/lib/contextmanager.cpp b/lib/contextmanager.cpp --- a/lib/contextmanager.cpp +++ b/lib/contextmanager.cpp @@ -125,7 +125,6 @@ d->mSelectionModel = new QItemSelectionModel(d->mDirModel); connect(d->mSelectionModel, &QItemSelectionModel::selectionChanged, this, &ContextManager::slotSelectionChanged); - connect(d->mSelectionModel, &QItemSelectionModel::currentChanged, this, &ContextManager::slotCurrentChanged); d->mSelectedFileItemListNeedsUpdate = false; } @@ -246,14 +245,11 @@ d->mSelectedFileItemListNeedsUpdate = true; if (!d->mSelectionModel->hasSelection()) { setCurrentUrl(QUrl()); + } else { + QUrl url = d->mDirModel->urlForIndex(d->mSelectionModel->currentIndex()); + setCurrentUrl(url); } - d->queueSignal("selectionChanged"); -} - -void Gwenview::ContextManager::slotCurrentChanged(const QModelIndex& index) -{ - QUrl url = d->mDirModel->urlForIndex(index); - setCurrentUrl(url); + emit selectionChanged(); } void ContextManager::emitQueuedSignals()