┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/tooltips
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2017-04-29 18:47:13 +0200
committerElvis Angelaccio <[email protected]>2017-05-08 16:04:19 +0200
commit73f885f9d3513bdfed2d22b21d0d1a88fe4f6a7a (patch)
treec466e746ab006136ca4175d3920a3d60a2709f54 /src/views/tooltips
parente74910cfdfd9db40b6950dc4fe030443cf285552 (diff)
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
Diffstat (limited to 'src/views/tooltips')
-rw-r--r--src/views/tooltips/dolphinfilemetadatawidget.cpp4
-rw-r--r--src/views/tooltips/dolphinfilemetadatawidget.h6
-rw-r--r--src/views/tooltips/tooltipmanager.cpp2
-rw-r--r--src/views/tooltips/tooltipmanager.h7
4 files changed, 19 insertions, 0 deletions
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);