From d8282e929468dccb60d95da65483631c6556b937 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Wed, 29 Mar 2017 13:37:02 +0200 Subject: Update name of the delete action in the .rc files Summary: Small regression in commit 68bb0ec22a. We need to use the new (standard) name for the delete action, otherwise it won't be properly enabled/disabled. BUG: 378154 FIXED-IN: 17.03.90 Reviewers: emmanuelp Differential Revision: https://phabricator.kde.org/D5248 --- src/dolphinpart.rc | 8 ++++---- src/dolphinui.rc | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/dolphinpart.rc b/src/dolphinpart.rc index 725320b28..01bd60009 100644 --- a/src/dolphinpart.rc +++ b/src/dolphinpart.rc @@ -1,12 +1,12 @@ - + &Edit - + @@ -53,14 +53,14 @@ - + - + diff --git a/src/dolphinui.rc b/src/dolphinui.rc index c44665656..935488246 100644 --- a/src/dolphinui.rc +++ b/src/dolphinui.rc @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -81,7 +81,7 @@ - + -- cgit v1.3 From 65467d80198b222e4f01b40004a73f888fb5a82b Mon Sep 17 00:00:00 2001 From: Athanasios Kanellopoulos Date: Sat, 29 Apr 2017 12:59:30 +0200 Subject: Sort the tag-values alphabetically in the "Tags" column Up until now tag-values have appeared unsorted in the Tags column when the selected View Mode is "Details". In older versions of Dolphin (in KDE4) the tags-values were alphabetically sorted in the Tags column, which means that back then this was the desired behavior. This commit restores this functionality. BUG: 377589 FIXED-IN: 17.04.1 REVIEW: 130068 --- src/kitemviews/private/kbaloorolesprovider.cpp | 7 ++++++- src/kitemviews/private/kbaloorolesprovider.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp index 16e3935ca..d6c15afcd 100644 --- a/src/kitemviews/private/kbaloorolesprovider.cpp +++ b/src/kitemviews/private/kbaloorolesprovider.cpp @@ -29,6 +29,7 @@ #include #include +#include struct KBalooRolesProviderSingleton { @@ -159,7 +160,11 @@ KBalooRolesProvider::KBalooRolesProvider() : QString KBalooRolesProvider::tagsFromValues(const QStringList& values) const { - return values.join(QStringLiteral(", ")); + QStringList alphabeticalOrderTags = values; + QCollator coll; + coll.setNumericMode(true); + std::sort(alphabeticalOrderTags.begin(), alphabeticalOrderTags.end(), [&](const QString& s1, const QString& s2){ return coll.compare(s1, s2) < 0; }); + return alphabeticalOrderTags.join(QStringLiteral(", ")); } QString KBalooRolesProvider::orientationFromValue(int value) const diff --git a/src/kitemviews/private/kbaloorolesprovider.h b/src/kitemviews/private/kbaloorolesprovider.h index a9bd2e8ef..65b59793c 100644 --- a/src/kitemviews/private/kbaloorolesprovider.h +++ b/src/kitemviews/private/kbaloorolesprovider.h @@ -62,6 +62,7 @@ protected: private: /** * @return User visible string for the given tag-values. + * The tag-values are sorted in alphabetical order. */ QString tagsFromValues(const QStringList& values) const; -- cgit v1.3 From 73f885f9d3513bdfed2d22b21d0d1a88fe4f6a7a Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sat, 29 Apr 2017 18:47:13 +0200 Subject: Don't ignore tag clicks in the tooltips Summary: Now that we can use the metadata widgets in the tooltips, we can also open the tags:// url if the user clicks some tag in a tooltip. The behavior is now consistent with the metadata widget in the information panel. Test Plan: Click a tag when the metadata tooltip shows up. Reviewers: emmanuelp Subscribers: #konqueror, #dolphin Differential Revision: https://phabricator.kde.org/D5658 --- src/dolphinmainwindow.cpp | 2 ++ src/views/dolphinview.cpp | 1 + src/views/dolphinview.h | 6 ++++++ src/views/tooltips/dolphinfilemetadatawidget.cpp | 4 ++++ src/views/tooltips/dolphinfilemetadatawidget.h | 6 ++++++ src/views/tooltips/tooltipmanager.cpp | 2 ++ src/views/tooltips/tooltipmanager.h | 7 +++++++ 7 files changed, 28 insertions(+) (limited to 'src') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index a163ef7fd..e28e540d1 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1453,6 +1453,8 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container) this, static_cast(&DolphinMainWindow::goBack)); connect(view, &DolphinView::goForwardRequested, this, static_cast(&DolphinMainWindow::goForward)); + connect(view, &DolphinView::urlActivated, + this, &DolphinMainWindow::handleUrl); const KUrlNavigator* navigator = container->urlNavigator(); connect(navigator, &KUrlNavigator::urlChanged, diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 63f6252ed..e60e85fdb 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -182,6 +182,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) : this, &DolphinView::slotSelectionChanged); m_toolTipManager = new ToolTipManager(this); + connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated); m_versionControlObserver = new VersionControlObserver(this); m_versionControlObserver->setModel(m_model); diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 5e69fd37b..6b62b5da6 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -544,6 +544,12 @@ signals: */ void toggleActiveViewRequested(); + /** + * Is emitted when the user clicks a tag or a link + * in the metadata widget of a tooltip. + */ + void urlActivated(const QUrl& url); + protected: /** Changes the zoom level if Control is pressed during a wheel event. */ virtual void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE; diff --git a/src/views/tooltips/dolphinfilemetadatawidget.cpp b/src/views/tooltips/dolphinfilemetadatawidget.cpp index 755636c6c..52eeb3b71 100644 --- a/src/views/tooltips/dolphinfilemetadatawidget.cpp +++ b/src/views/tooltips/dolphinfilemetadatawidget.cpp @@ -67,10 +67,14 @@ DolphinFileMetaDataWidget::DolphinFileMetaDataWidget(QWidget* parent) : m_fileMetaDataWidget = new KFileMetaDataWidget(this); connect(m_fileMetaDataWidget, &KFileMetaDataWidget::metaDataRequestFinished, this, &DolphinFileMetaDataWidget::metaDataRequestFinished); + connect(m_fileMetaDataWidget, &KFileMetaDataWidget::urlActivated, + this, &DolphinFileMetaDataWidget::urlActivated); #else m_fileMetaDataWidget = new Baloo::FileMetaDataWidget(this); connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::metaDataRequestFinished, this, &DolphinFileMetaDataWidget::metaDataRequestFinished); + connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::urlActivated, + this, &DolphinFileMetaDataWidget::urlActivated); #endif m_fileMetaDataWidget->setForegroundRole(QPalette::ToolTipText); m_fileMetaDataWidget->setReadOnly(true); diff --git a/src/views/tooltips/dolphinfilemetadatawidget.h b/src/views/tooltips/dolphinfilemetadatawidget.h index cf796250d..c5c228766 100644 --- a/src/views/tooltips/dolphinfilemetadatawidget.h +++ b/src/views/tooltips/dolphinfilemetadatawidget.h @@ -69,6 +69,12 @@ signals: */ void metaDataRequestFinished(const KFileItemList& items); + /** + * Is emitted when the user clicks a tag or a link + * in the metadata widget. + */ + void urlActivated(const QUrl& url); + private: QLabel* m_preview; QLabel* m_name; diff --git a/src/views/tooltips/tooltipmanager.cpp b/src/views/tooltips/tooltipmanager.cpp index 4a9f91359..4c5825635 100644 --- a/src/views/tooltips/tooltipmanager.cpp +++ b/src/views/tooltips/tooltipmanager.cpp @@ -86,6 +86,8 @@ void ToolTipManager::showToolTip(const KFileItem& item, const QRectF& itemRect, m_fileMetaDataWidget = new DolphinFileMetaDataWidget(); connect(m_fileMetaDataWidget, &DolphinFileMetaDataWidget::metaDataRequestFinished, this, &ToolTipManager::slotMetaDataRequestFinished); + connect(m_fileMetaDataWidget, &DolphinFileMetaDataWidget::urlActivated, + this, &ToolTipManager::urlActivated); m_contentRetrievalTimer->start(); m_showToolTipTimer->start(); diff --git a/src/views/tooltips/tooltipmanager.h b/src/views/tooltips/tooltipmanager.h index 9c504c898..9f1f104f1 100644 --- a/src/views/tooltips/tooltipmanager.h +++ b/src/views/tooltips/tooltipmanager.h @@ -58,6 +58,13 @@ public: */ void hideToolTip(); +signals: + /** + * Is emitted when the user clicks a tag or a link + * in the metadata widget. + */ + void urlActivated(const QUrl& url); + private slots: void startContentRetrieval(); void setPreviewPix(const KFileItem& item, const QPixmap& pix); -- cgit v1.3