From 1b88652b8569118dff1a0e61d85326e8c5d91d51 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 29 Aug 2011 20:13:39 +0200 Subject: [PATCH] Renamed some signals for consistency with KItemViews classes --- src/dolphinpart.cpp | 8 ++++---- src/dolphinpart.h | 2 +- src/dolphinviewcontainer.cpp | 20 +++++++++---------- src/dolphinviewcontainer.h | 2 +- src/kitemviews/kitemlistcontroller.cpp | 5 +++-- src/kitemviews/kitemlistcontroller.h | 2 +- .../kitemlistkeyboardsearchmanager.cpp | 2 +- .../kitemlistkeyboardsearchmanager_p.h | 14 +++++++------ src/views/dolphinview.cpp | 7 ++++--- src/views/dolphinview.h | 2 +- 10 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index df1d8b738..89ea457ca 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -82,8 +82,8 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL this, SLOT(slotMessage(QString))); connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(slotErrorMessage(QString))); - connect(m_view, SIGNAL(itemTriggered(KFileItem)), - this, SLOT(slotItemTriggered(KFileItem))); + connect(m_view, SIGNAL(itemActivated(KFileItem)), + this, SLOT(slotItemActivated(KFileItem))); connect(m_view, SIGNAL(tabRequested(KUrl)), this, SLOT(createNewWindow(KUrl))); connect(m_view, SIGNAL(requestContextMenu(KFileItem,KUrl,QList)), @@ -329,7 +329,7 @@ void DolphinPart::slotRequestItemInfo(const KFileItem& item) } } -void DolphinPart::slotItemTriggered(const KFileItem& item) +void DolphinPart::slotItemActivated(const KFileItem& item) { KParts::OpenUrlArguments args; // Forget about the known mimetype if a target URL is used. @@ -348,7 +348,7 @@ void DolphinPart::slotItemTriggered(const KFileItem& item) void DolphinPart::createNewWindow(const KUrl& url) { // TODO: Check issue N176832 for the missing QAIV signal; task 177399 - maybe this code - // should be moved into DolphinPart::slotItemTriggered() + // should be moved into DolphinPart::slotItemActivated() emit m_extension->createNewWindow(url); } diff --git a/src/dolphinpart.h b/src/dolphinpart.h index 17650469d..fb4ed0afc 100644 --- a/src/dolphinpart.h +++ b/src/dolphinpart.h @@ -128,7 +128,7 @@ private Q_SLOTS: /** * Handles clicking on an item */ - void slotItemTriggered(const KFileItem& item); + void slotItemActivated(const KFileItem& item); /** * Creates a new window showing the content of \a url. */ diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index dcfeca0fd..b670aa540 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -93,20 +93,20 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) : connect(m_searchBox, SIGNAL(returnPressed(QString)), this, SLOT(requestFocus())); m_view = new DolphinView(url, this); - connect(m_view, SIGNAL(urlChanged(KUrl)), m_urlNavigator, SLOT(setUrl(KUrl))); + connect(m_view, SIGNAL(urlChanged(KUrl)), m_urlNavigator, SLOT(setUrl(KUrl))); connect(m_view, SIGNAL(writeStateChanged(bool)), this, SIGNAL(writeStateChanged(bool))); connect(m_view, SIGNAL(requestItemInfo(KFileItem)), this, SLOT(showItemInfo(KFileItem))); - connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString))); - connect(m_view, SIGNAL(infoMessage(QString)), this, SLOT(showInfoMessage(QString))); - connect(m_view, SIGNAL(itemTriggered(KFileItem)), this, SLOT(slotItemTriggered(KFileItem))); - connect(m_view, SIGNAL(redirection(KUrl,KUrl)), this, SLOT(redirect(KUrl,KUrl))); + connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString))); + connect(m_view, SIGNAL(infoMessage(QString)), this, SLOT(showInfoMessage(QString))); + connect(m_view, SIGNAL(itemActivated(KFileItem)), this, SLOT(slotItemActivated(KFileItem))); + connect(m_view, SIGNAL(redirection(KUrl,KUrl)), this, SLOT(redirect(KUrl,KUrl))); connect(m_view, SIGNAL(startedPathLoading(KUrl)), this, SLOT(slotStartedPathLoading())); connect(m_view, SIGNAL(finishedPathLoading(KUrl)), this, SLOT(slotFinishedPathLoading())); connect(m_view, SIGNAL(itemCountChanged()), this, SLOT(delayedStatusBarUpdate())); connect(m_view, SIGNAL(pathLoadingProgress(int)), this, SLOT(updateProgress(int))); - connect(m_view, SIGNAL(infoMessage(QString)), this, SLOT(showInfoMessage(QString))); - connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString))); - connect(m_view, SIGNAL(urlIsFileError(KUrl)), this, SLOT(openFile(KUrl))); + connect(m_view, SIGNAL(infoMessage(QString)), this, SLOT(showInfoMessage(QString))); + connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString))); + connect(m_view, SIGNAL(urlIsFileError(KUrl)), this, SLOT(openFile(KUrl))); connect(m_view, SIGNAL(selectionChanged(KFileItemList)), this, SLOT(delayedStatusBarUpdate())); connect(m_view, SIGNAL(operationCompletedMessage(QString)), this, SLOT(showOperationCompletedMessage(QString))); connect(m_view, SIGNAL(urlAboutToBeChanged(KUrl)), this, SLOT(slotViewUrlAboutToBeChanged(KUrl))); @@ -373,7 +373,7 @@ void DolphinViewContainer::slotFinishedPathLoading() } } -void DolphinViewContainer::slotItemTriggered(const KFileItem& item) +void DolphinViewContainer::slotItemActivated(const KFileItem& item) { KUrl url = item.targetUrl(); @@ -414,7 +414,7 @@ void DolphinViewContainer::slotItemTriggered(const KFileItem& item) void DolphinViewContainer::openFile(const KUrl& url) { const KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url); - slotItemTriggered(item); + slotItemActivated(item); } void DolphinViewContainer::showItemInfo(const KFileItem& item) diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index 7aea304b8..ee9f83dea 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -173,7 +173,7 @@ private slots: * directory is opened in the view. If the item is a file, the file * gets started by the corresponding application. */ - void slotItemTriggered(const KFileItem& item); + void slotItemActivated(const KFileItem& item); /** * Opens a the file \a url by opening the corresponding application. diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 615cc9c6d..e1277bdd4 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -48,7 +48,8 @@ KItemListController::KItemListController(QObject* parent) : m_pressedMousePos(), m_oldSelection() { - connect(m_keyboardManager, SIGNAL(requestItemActivation(QString,bool)), this, SLOT(slotKeyboardActivationRequested(QString,bool))); + connect(m_keyboardManager, SIGNAL(changeCurrentItem(QString,bool)), + this, SLOT(slotChangeCurrentItem(QString,bool))); } KItemListController::~KItemListController() @@ -237,7 +238,7 @@ bool KItemListController::keyPressEvent(QKeyEvent* event) return true; } -void KItemListController::slotKeyboardActivationRequested(const QString& text, bool searchFromNextItem) +void KItemListController::slotChangeCurrentItem(const QString& text, bool searchFromNextItem) { if (!m_model) { return; diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index 2e33948aa..4ce5b804b 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -134,7 +134,7 @@ private slots: */ void slotRubberBandChanged(); - void slotKeyboardActivationRequested(const QString& text, bool searchFromNextItem); + void slotChangeCurrentItem(const QString& text, bool searchFromNextItem); private: /** diff --git a/src/kitemviews/kitemlistkeyboardsearchmanager.cpp b/src/kitemviews/kitemlistkeyboardsearchmanager.cpp index 34633d65c..9552a7582 100644 --- a/src/kitemviews/kitemlistkeyboardsearchmanager.cpp +++ b/src/kitemviews/kitemlistkeyboardsearchmanager.cpp @@ -48,7 +48,7 @@ void KItemListKeyboardSearchManager::addKeys(const QString& keys) const bool searchFromNextItem = m_searchedString.isEmpty(); if (!keys.isEmpty()) { m_searchedString.append(keys); - emit requestItemActivation(m_searchedString, searchFromNextItem); + emit changeCurrentItem(m_searchedString, searchFromNextItem); } m_keyboardInputTime.start(); } diff --git a/src/kitemviews/kitemlistkeyboardsearchmanager_p.h b/src/kitemviews/kitemlistkeyboardsearchmanager_p.h index cf41f3bed..3441dd7bc 100644 --- a/src/kitemviews/kitemlistkeyboardsearchmanager_p.h +++ b/src/kitemviews/kitemlistkeyboardsearchmanager_p.h @@ -54,14 +54,16 @@ public: void addKeys(const QString& keys); signals: - /** - * Is emitted when a text is to be searched. - * @param searchFromNextItem if true, start searching - * from item next to current item. Otherwise, search from - * current item. + * Is emitted if the current item should be changed corresponding + * to \a text. + * @param searchFromNextItem If true start searching from item next to the + * current item. Otherwise, search from the + * current item. */ - void requestItemActivation(const QString& string, bool searchFromNextItem); + // TODO: Think about getting rid of the bool parameter + // (see http://doc.qt.nokia.com/qq/qq13-apis.html#thebooleanparametertrap) + void changeCurrentItem(const QString& string, bool searchFromNextItem); private: QString m_searchedString; diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 629b7590e..01ac9cc94 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -114,7 +114,7 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) : this, SLOT(updateSortFoldersFirst(bool))); connect(m_dolphinViewController, SIGNAL(additionalInfoChanged(QList)), this, SLOT(updateAdditionalInfo(QList)));*/ - //connect(m_dolphinViewController, SIGNAL(itemTriggered(KFileItem)), + //connect(m_dolphinViewController, SIGNAL(itemActivated(KFileItem)), // this, SLOT(triggerItem(KFileItem))); //connect(m_dolphinViewController, SIGNAL(tabRequested(KUrl)), // this, SIGNAL(tabRequested(KUrl))); @@ -695,7 +695,7 @@ void DolphinView::slotItemActivated(int index) if (selectedItems.isEmpty()) return; if (selectedItems.count() == 1) { - emit itemTriggered(fileItemModel()->fileItem(index)); // caught by DolphinViewContainer or DolphinPart + emit itemActivated(fileItemModel()->fileItem(index)); // caught by DolphinViewContainer or DolphinPart } else { foreach (int i, selectedItems) { @@ -703,7 +703,7 @@ void DolphinView::slotItemActivated(int index) if (fileItem.isDir()) { emit tabRequested(fileItem.url()); } else { - emit itemTriggered(fileItem); + emit itemActivated(fileItem); } } } @@ -719,6 +719,7 @@ void DolphinView::slotItemMiddleClicked(int index) void DolphinView::slotContextMenuRequested(int index, const QPointF& pos) { + Q_UNUSED(pos); if (GeneralSettings::showToolTips()) { m_toolTipManager->hideToolTip(); } diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 7a2db6889..7c81ea8fc 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -420,7 +420,7 @@ signals: /** * Is emitted when clicking on an item with the left mouse button. */ - void itemTriggered(const KFileItem& item); + void itemActivated(const KFileItem& item); /** * Is emitted if items have been added or deleted. -- 2.47.3