From: Elvis Angelaccio Date: Sat, 12 May 2018 18:52:15 +0000 (+0200) Subject: Fix broken build without baloo-widgets master X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/2912894d4f13907bb05be0a2a0d4e432668d9817 Fix broken build without baloo-widgets master D11245 introduced a dependency on baloo-widgets master, but baloo-widgets is only an optional dependency. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c71790e52..707160f53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "Baloo Core libraries" PURPOSE "For adding desktop-wide search and tagging support to dolphin" ) -find_package(KF5BalooWidgets 4.97) +find_package(KF5BalooWidgets 18.07.70) set_package_properties(KF5BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets" URL "http://www.kde.org" TYPE OPTIONAL diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 0d6987bb0..0cba0cdf0 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -112,12 +112,12 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) : this, &InformationPanelContent::urlActivated); #else m_metaDataWidget = new Baloo::FileMetaDataWidget(parent); + m_metaDataWidget->setDateFormat(static_cast(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); - m_metaDataWidget->setDateFormat(static_cast(InformationPanelSettings::dateFormat())); // Encapsulate the MetaDataWidget inside a container that has a dummy widget // at the bottom. This prevents that the meta data widget gets vertically stretched @@ -194,7 +194,9 @@ void InformationPanelContent::showItem(const KFileItem& item) } if (m_metaDataWidget) { +#ifdef HAVE_BALOO m_metaDataWidget->setDateFormat(static_cast(InformationPanelSettings::dateFormat())); +#endif m_metaDataWidget->show(); m_metaDataWidget->setItems(KFileItemList() << item); } @@ -283,10 +285,12 @@ void InformationPanelContent::configureSettings(const QList& 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(Baloo::DateFormats::ShortFormat)); +#endif popup.addSeparator(); foreach (QAction* action, customContextMenuActions) { popup.addAction(action); @@ -303,11 +307,6 @@ void InformationPanelContent::configureSettings(const QList& customCon if (action == previewAction) { m_preview->setVisible(isChecked); InformationPanelSettings::setPreviewsShown(isChecked); - } else if (action == dateformatAction) { - int dateFormat = static_cast(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat); - - InformationPanelSettings::setDateFormat(dateFormat); - refreshMetaData(); } else if (action == configureAction) { FileMetaDataConfigurationDialog* dialog = new FileMetaDataConfigurationDialog(this); dialog->setDescription(i18nc("@label::textbox", @@ -317,6 +316,14 @@ void InformationPanelContent::configureSettings(const QList& customCon dialog->show(); connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData); } +#ifdef HAVE_BALOO + if (action == dateformatAction) { + int dateFormat = static_cast(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat); + + InformationPanelSettings::setDateFormat(dateFormat); + refreshMetaData(); + } +#endif } void InformationPanelContent::showIcon(const KFileItem& item)