diff options
| author | David Faure <[email protected]> | 2008-01-21 19:42:16 +0000 |
|---|---|---|
| committer | David Faure <[email protected]> | 2008-01-21 19:42:16 +0000 |
| commit | af333d9c7a8f344ed7f2a5cae02b383a5d0ee792 (patch) | |
| tree | cb587a35800cf91a0697b81088782ef0d543f279 /src/dolphinpart.cpp | |
| parent | c00478bbc1001d10dcfc04e9b0ea251620837e85 (diff) | |
Make sort/descending available in dolphinpart
svn path=/branches/KDE/4.0/kdebase/apps/; revision=764444
Diffstat (limited to 'src/dolphinpart.cpp')
| -rw-r--r-- | src/dolphinpart.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 2c4c1eaa3..e7c919ad8 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -93,6 +93,8 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QStringLi this, SLOT(slotUrlChanged(KUrl))); connect(m_view, SIGNAL(modeChanged()), this, SLOT(updateViewActions())); + connect(m_view, SIGNAL(sortOrderChanged(Qt::SortOrder)), + this, SLOT(slotSortOrderChanged(Qt::SortOrder))); QClipboard* clipboard = QApplication::clipboard(); connect(clipboard, SIGNAL(dataChanged()), @@ -144,6 +146,13 @@ void DolphinPart::createActions() propertiesAction->setShortcut(Qt::ALT+Qt::Key_Return); connect(propertiesAction, SIGNAL(triggered()), SLOT(slotProperties())); + // View menu + + // TODO sort_by_* + + KAction* sortDescending = DolphinView::createSortDescendingAction(actionCollection()); + connect(sortDescending, SIGNAL(triggered()), m_view, SLOT(toggleSortOrder())); + // Go menu KAction* newDirAction = DolphinView::createNewDirAction(actionCollection()); @@ -431,4 +440,11 @@ void DolphinPart::createDir() KonqOperations::newDir(m_view, url()); } +void DolphinPart::slotSortOrderChanged(Qt::SortOrder order) +{ + KToggleAction* descending = static_cast<KToggleAction*>(actionCollection()->action("descending")); + const bool sortDescending = (order == Qt::DescendingOrder); + descending->setChecked(sortDescending); +} + #include "dolphinpart.moc" |
