┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/informationpanelcontent.cpp
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2018-08-13 23:36:35 +0200
committerElvis Angelaccio <[email protected]>2018-08-21 01:03:33 +0200
commit6674c9c387d0986e99698332727bf797257bf07d (patch)
tree79a337408615d7cb64da7175c2086bf89839ef5c /src/panels/information/informationpanelcontent.cpp
parent9134951cb01b252b2ae1ac60f5cc9c2ef6868d4e (diff)
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
Diffstat (limited to 'src/panels/information/informationpanelcontent.cpp')
-rw-r--r--src/panels/information/informationpanelcontent.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp
index 0cba0cdf0..bb30cc81c 100644
--- a/src/panels/information/informationpanelcontent.cpp
+++ b/src/panels/information/informationpanelcontent.cpp
@@ -32,11 +32,7 @@
#include <QMenu>
#include <QTextDocument>
-#ifndef HAVE_BALOO
-#include <KFileMetaDataWidget>
-#else
#include <Baloo/FileMetaDataWidget>
-#endif
#include <panels/places/placesitem.h>
#include <panels/places/placesitemmodel.h>
@@ -106,19 +102,13 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
const bool previewsShown = InformationPanelSettings::previewsShown();
m_preview->setVisible(previewsShown);
-#ifndef HAVE_BALOO
- m_metaDataWidget = new KFileMetaDataWidget(parent);
- connect(m_metaDataWidget, &KFileMetaDataWidget::urlActivated,
- this, &InformationPanelContent::urlActivated);
-#else
m_metaDataWidget = new Baloo::FileMetaDataWidget(parent);
m_metaDataWidget->setDateFormat(static_cast<Baloo::DateFormats>(InformationPanelSettings::dateFormat()));
connect(m_metaDataWidget, &Baloo::FileMetaDataWidget::urlActivated,
this, &InformationPanelContent::urlActivated);
-#endif
m_metaDataWidget->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
-
+
// Encapsulate the MetaDataWidget inside a container that has a dummy widget
// at the bottom. This prevents that the meta data widget gets vertically stretched
// in the case where the height of m_metaDataArea > m_metaDataWidget.
@@ -194,9 +184,7 @@ void InformationPanelContent::showItem(const KFileItem& item)
}
if (m_metaDataWidget) {
-#ifdef HAVE_BALOO
m_metaDataWidget->setDateFormat(static_cast<Baloo::DateFormats>(InformationPanelSettings::dateFormat()));
-#endif
m_metaDataWidget->show();
m_metaDataWidget->setItems(KFileItemList() << item);
}
@@ -285,12 +273,11 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon
QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
configureAction->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
-#ifdef HAVE_BALOO
QAction* dateformatAction = popup.addAction(i18nc("@action:inmenu", "Condensed Date"));
dateformatAction->setIcon(QIcon::fromTheme(QStringLiteral("change-date-symbolic")));
dateformatAction->setCheckable(true);
dateformatAction->setChecked(InformationPanelSettings::dateFormat() == static_cast<int>(Baloo::DateFormats::ShortFormat));
-#endif
+
popup.addSeparator();
foreach (QAction* action, customContextMenuActions) {
popup.addAction(action);
@@ -316,14 +303,12 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon
dialog->show();
connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData);
}
-#ifdef HAVE_BALOO
if (action == dateformatAction) {
int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat);
InformationPanelSettings::setDateFormat(dateFormat);
refreshMetaData();
}
-#endif
}
void InformationPanelContent::showIcon(const KFileItem& item)