From 6674c9c387d0986e99698332727bf797257bf07d Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Mon, 13 Aug 2018 23:36:35 +0200 Subject: Port away from kdelibs4support Summary: It was only used as fallback when baloo was not found, but `KFileMetaDataWidget` is useless without nepomuk. The result of this patch is that the information panel and the tooltips won't be available from platforms without baloo (instead of being available but broken). The baloo dependency remains optional. Closes T8720 Test Plan: Build dolphin with `cmake -DCMAKE_DISABLE_FIND_PACKAGE_KF5Baloo=ON ..` and make sure it doesn't show tooltips or the information panel. Reviewers: #dolphin, broulik, ngraham Subscribers: kfm-devel Tags: #dolphin Maniphest Tasks: T8720 Differential Revision: https://phabricator.kde.org/D14814 --- src/views/dolphinview.cpp | 6 ++++++ src/views/tooltips/dolphinfilemetadatawidget.cpp | 12 ------------ src/views/tooltips/dolphinfilemetadatawidget.h | 8 -------- 3 files changed, 6 insertions(+), 20 deletions(-) (limited to 'src/views') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 342c22638..a0c5ef38b 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -176,8 +176,10 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) : connect(selectionManager, &KItemListSelectionManager::selectionChanged, this, &DolphinView::slotSelectionChanged); +#ifdef HAVE_BALOO m_toolTipManager = new ToolTipManager(this); connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated); +#endif m_versionControlObserver = new VersionControlObserver(this); m_versionControlObserver->setModel(m_model); @@ -1030,7 +1032,9 @@ void DolphinView::slotItemHovered(int index) const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint()); itemRect.moveTo(pos); +#ifdef HAVE_BALOO m_toolTipManager->showToolTip(item, itemRect, nativeParentWidget()->windowHandle()); +#endif } emit requestItemInfo(item); @@ -1407,9 +1411,11 @@ void DolphinView::updateViewState() void DolphinView::hideToolTip() { +#ifdef HAVE_BALOO if (GeneralSettings::showToolTips()) { m_toolTipManager->hideToolTip(); } +#endif } void DolphinView::calculateItemCount(int& fileCount, diff --git a/src/views/tooltips/dolphinfilemetadatawidget.cpp b/src/views/tooltips/dolphinfilemetadatawidget.cpp index 1df6a6673..f4a688ea8 100644 --- a/src/views/tooltips/dolphinfilemetadatawidget.cpp +++ b/src/views/tooltips/dolphinfilemetadatawidget.cpp @@ -24,11 +24,7 @@ #include #include #include -#ifndef HAVE_BALOO -#include -#else #include -#endif #include #include @@ -61,19 +57,11 @@ DolphinFileMetaDataWidget::DolphinFileMetaDataWidget(QWidget* parent) : m_name->setMaximumWidth(fontMetrics.averageCharWidth() * 40); // Create widget for the meta data -#ifndef HAVE_BALOO - 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 1e2cfadb6..b9dbd98a1 100644 --- a/src/views/tooltips/dolphinfilemetadatawidget.h +++ b/src/views/tooltips/dolphinfilemetadatawidget.h @@ -29,13 +29,9 @@ class KFileItemList; class QLabel; -#ifndef HAVE_BALOO -class KFileMetaDataWidget; -#else namespace Baloo { class FileMetaDataWidget; } -#endif /** * @brief Widget that shows the meta information and a preview of one @@ -79,11 +75,7 @@ signals: private: QLabel* m_preview; QLabel* m_name; -#ifndef HAVE_BALOO - KFileMetaDataWidget* m_fileMetaDataWidget; -#else Baloo::FileMetaDataWidget* m_fileMetaDataWidget; -#endif }; #endif -- cgit v1.3