X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/7b6ace6466cf349a4ce7a080d5e978aa0a7043e2..136e2ae3d75677ec008e7b5973b8e73bc38e9530:/src/dolphincontroller.cpp diff --git a/src/dolphincontroller.cpp b/src/dolphincontroller.cpp index cfa0d62c8..b3801bda8 100644 --- a/src/dolphincontroller.cpp +++ b/src/dolphincontroller.cpp @@ -31,6 +31,7 @@ Qt::MouseButtons DolphinController::m_mouseButtons = Qt::NoButton; DolphinController::DolphinController(DolphinView* dolphinView) : QObject(dolphinView), m_zoomLevel(0), + m_nameFilter(), m_url(), m_dolphinView(dolphinView), m_itemView(0) @@ -45,6 +46,7 @@ void DolphinController::setUrl(const KUrl& url) { if (m_url != url) { m_url = url; + emit cancelPreviews(); emit urlChanged(url); } } @@ -104,6 +106,11 @@ void DolphinController::indicateSortOrderChange(Qt::SortOrder order) emit sortOrderChanged(order); } +void DolphinController::indicateSortFoldersFirstChange(bool foldersFirst) +{ + emit sortFoldersFirstChanged(foldersFirst); +} + void DolphinController::indicateAdditionalInfoChange(const KFileItemDelegate::InformationList& info) { emit additionalInfoChanged(info); @@ -114,6 +121,19 @@ void DolphinController::indicateActivationChange(bool active) emit activationChanged(active); } +void DolphinController::setNameFilter(const QString& nameFilter) +{ + if (nameFilter != m_nameFilter) { + m_nameFilter = nameFilter; + emit nameFilterChanged(nameFilter); + } +} + +QString DolphinController::nameFilter() const +{ + return m_nameFilter; +} + void DolphinController::setZoomLevel(int level) { Q_ASSERT(level >= ZoomLevelInfo::minimumLevel()); @@ -124,11 +144,6 @@ void DolphinController::setZoomLevel(int level) } } -void DolphinController::triggerScrollToCurrentItem() -{ - emit scrollToCurrentItem(); -} - void DolphinController::handleKeyPressEvent(QKeyEvent* event) { Q_ASSERT(m_itemView != 0); @@ -138,7 +153,7 @@ void DolphinController::handleKeyPressEvent(QKeyEvent* event) const bool trigger = currentIndex.isValid() && ((event->key() == Qt::Key_Return) || (event->key() == Qt::Key_Enter)) - && (selModel->selectedIndexes().count() > 0); + && !selModel->selectedIndexes().isEmpty(); if (trigger) { const QModelIndexList indexList = selModel->selectedIndexes(); foreach (const QModelIndex& index, indexList) {