]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't ignore tag clicks in the tooltips
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 29 Apr 2017 16:47:13 +0000 (18:47 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Mon, 8 May 2017 14:04:19 +0000 (16:04 +0200)
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
src/views/dolphinview.cpp
src/views/dolphinview.h
src/views/tooltips/dolphinfilemetadatawidget.cpp
src/views/tooltips/dolphinfilemetadatawidget.h
src/views/tooltips/tooltipmanager.cpp
src/views/tooltips/tooltipmanager.h

index a163ef7fd03d07c354b0c928610b0626a972f588..e28e540d15ebb97974fcd7d65dd222b078409a79 100644 (file)
@@ -1453,6 +1453,8 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
             this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::goBack));
     connect(view, &DolphinView::goForwardRequested,
             this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::goForward));
+    connect(view, &DolphinView::urlActivated,
+            this, &DolphinMainWindow::handleUrl);
 
     const KUrlNavigator* navigator = container->urlNavigator();
     connect(navigator, &KUrlNavigator::urlChanged,
index 63f6252ed41cf177a6118c76e5ccce6097d637d3..e60e85fdbcec4a46455fe265b0deda53e8f20eef 100644 (file)
@@ -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);
index 5e69fd37bbb22bb8a24cd45e9ac96c3010632c0c..6b62b5da68c1f7474abff80510fc3d24508c7ddc 100644 (file)
@@ -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;
index 755636c6cf5db097c16509547ddafb114e24a2d2..52eeb3b710a57b7afa921184e670ae9cfe968d2f 100644 (file)
@@ -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);
index cf796250d187ac161d750b64b4f528efd5c7ede6..c5c228766bef3eb3ef93ba4b77e0c420990de124 100644 (file)
@@ -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;
index 4a9f91359897c03c2565878bbe1d9b666d68a029..4c5825635504577bb44c63ffb0b57a29a2f066bb 100644 (file)
@@ -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();
index 9c504c898514d08a561abb0a387a9926655fb068..9f1f104f1a57b48ef7a80a4bfd0b0d68a37b968a 100644 (file)
@@ -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);