mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
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
This commit is contained in:
parent
9134951cb0
commit
6674c9c387
|
@ -94,10 +94,7 @@ if (KF5Baloo_FOUND AND KF5BalooWidgets_FOUND AND KF5FileMetaData_FOUND)
|
||||||
message(STATUS "Baloo packages are found")
|
message(STATUS "Baloo packages are found")
|
||||||
set(HAVE_BALOO TRUE)
|
set(HAVE_BALOO TRUE)
|
||||||
else()
|
else()
|
||||||
message(WARNING "Baloo packages not found. They are needed for the metadata features of Dolphin.")
|
message(WARNING "Baloo packages not found. They are needed for the metadata features of Dolphin (including the information panel).")
|
||||||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
|
|
||||||
KDELibs4Support # for KFileMetaDataWidget
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
|
@ -98,8 +98,6 @@ set(dolphinprivate_LIB_SRCS
|
||||||
views/dolphinviewactionhandler.cpp
|
views/dolphinviewactionhandler.cpp
|
||||||
views/draganddrophelper.cpp
|
views/draganddrophelper.cpp
|
||||||
views/renamedialog.cpp
|
views/renamedialog.cpp
|
||||||
views/tooltips/dolphinfilemetadatawidget.cpp
|
|
||||||
views/tooltips/tooltipmanager.cpp
|
|
||||||
views/versioncontrol/updateitemstatesthread.cpp
|
views/versioncontrol/updateitemstatesthread.cpp
|
||||||
views/versioncontrol/versioncontrolobserver.cpp
|
views/versioncontrol/versioncontrolobserver.cpp
|
||||||
views/viewmodecontroller.cpp
|
views/viewmodecontroller.cpp
|
||||||
|
@ -114,6 +112,8 @@ set(dolphinprivate_LIB_SRCS
|
||||||
if(HAVE_BALOO)
|
if(HAVE_BALOO)
|
||||||
set(dolphinprivate_LIB_SRCS
|
set(dolphinprivate_LIB_SRCS
|
||||||
${dolphinprivate_LIB_SRCS}
|
${dolphinprivate_LIB_SRCS}
|
||||||
|
views/tooltips/dolphinfilemetadatawidget.cpp
|
||||||
|
views/tooltips/tooltipmanager.cpp
|
||||||
kitemviews/private/kbaloorolesprovider.cpp
|
kitemviews/private/kbaloorolesprovider.cpp
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@ -155,11 +155,6 @@ if(HAVE_BALOO)
|
||||||
KF5::Baloo
|
KF5::Baloo
|
||||||
KF5::BalooWidgets
|
KF5::BalooWidgets
|
||||||
)
|
)
|
||||||
else()
|
|
||||||
target_link_libraries(
|
|
||||||
dolphinprivate PUBLIC
|
|
||||||
KF5::KDELibs4Support # for KFileMetaDataWidget
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(dolphinprivate PROPERTIES
|
set_target_properties(dolphinprivate PROPERTIES
|
||||||
|
@ -204,11 +199,6 @@ set(dolphinstatic_SRCS
|
||||||
dolphintabwidget.cpp
|
dolphintabwidget.cpp
|
||||||
trash/dolphintrash.cpp
|
trash/dolphintrash.cpp
|
||||||
filterbar/filterbar.cpp
|
filterbar/filterbar.cpp
|
||||||
panels/information/filemetadataconfigurationdialog.cpp
|
|
||||||
panels/information/informationpanel.cpp
|
|
||||||
panels/information/informationpanelcontent.cpp
|
|
||||||
panels/information/pixmapviewer.cpp
|
|
||||||
panels/information/phononwidget.cpp
|
|
||||||
panels/places/placespanel.cpp
|
panels/places/placespanel.cpp
|
||||||
panels/places/placesitem.cpp
|
panels/places/placesitem.cpp
|
||||||
panels/places/placesitemeditdialog.cpp
|
panels/places/placesitemeditdialog.cpp
|
||||||
|
@ -252,6 +242,17 @@ set(dolphinstatic_SRCS
|
||||||
global.cpp
|
global.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(HAVE_BALOO)
|
||||||
|
set(dolphinstatic_SRCS
|
||||||
|
${dolphinstatic_SRCS}
|
||||||
|
panels/information/filemetadataconfigurationdialog.cpp
|
||||||
|
panels/information/informationpanel.cpp
|
||||||
|
panels/information/informationpanelcontent.cpp
|
||||||
|
panels/information/pixmapviewer.cpp
|
||||||
|
panels/information/phononwidget.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
kconfig_add_kcfg_files(dolphinstatic_SRCS GENERATE_MOC
|
kconfig_add_kcfg_files(dolphinstatic_SRCS GENERATE_MOC
|
||||||
panels/folders/dolphin_folderspanelsettings.kcfgc
|
panels/folders/dolphin_folderspanelsettings.kcfgc
|
||||||
panels/information/dolphin_informationpanelsettings.kcfgc
|
panels/information/dolphin_informationpanelsettings.kcfgc
|
||||||
|
|
|
@ -1266,6 +1266,8 @@ void DolphinMainWindow::setupDockWidgets()
|
||||||
infoDock->setLocked(lock);
|
infoDock->setLocked(lock);
|
||||||
infoDock->setObjectName(QStringLiteral("infoDock"));
|
infoDock->setObjectName(QStringLiteral("infoDock"));
|
||||||
infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||||
|
|
||||||
|
#ifdef HAVE_BALOO
|
||||||
InformationPanel* infoPanel = new InformationPanel(infoDock);
|
InformationPanel* infoPanel = new InformationPanel(infoDock);
|
||||||
infoPanel->setCustomContextMenuActions({lockLayoutAction});
|
infoPanel->setCustomContextMenuActions({lockLayoutAction});
|
||||||
connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl);
|
connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl);
|
||||||
|
@ -1281,6 +1283,7 @@ void DolphinMainWindow::setupDockWidgets()
|
||||||
infoPanel, &InformationPanel::setSelection);
|
infoPanel, &InformationPanel::setSelection);
|
||||||
connect(this, &DolphinMainWindow::requestItemInfo,
|
connect(this, &DolphinMainWindow::requestItemInfo,
|
||||||
infoPanel, &InformationPanel::requestDelayedItemInfo);
|
infoPanel, &InformationPanel::requestDelayedItemInfo);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Setup "Folders"
|
// Setup "Folders"
|
||||||
DolphinDockWidget* foldersDock = new DolphinDockWidget(i18nc("@title:window", "Folders"));
|
DolphinDockWidget* foldersDock = new DolphinDockWidget(i18nc("@title:window", "Folders"));
|
||||||
|
|
|
@ -19,11 +19,7 @@
|
||||||
|
|
||||||
#include "filemetadataconfigurationdialog.h"
|
#include "filemetadataconfigurationdialog.h"
|
||||||
|
|
||||||
#ifndef HAVE_BALOO
|
|
||||||
#include <kfilemetadataconfigurationwidget.h>
|
|
||||||
#else
|
|
||||||
#include <Baloo/FileMetaDataConfigWidget>
|
#include <Baloo/FileMetaDataConfigWidget>
|
||||||
#endif
|
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KSharedConfig>
|
#include <KSharedConfig>
|
||||||
|
@ -56,12 +52,7 @@ FileMetaDataConfigurationDialog::FileMetaDataConfigurationDialog(QWidget* parent
|
||||||
"be shown:"), this);
|
"be shown:"), this);
|
||||||
m_descriptionLabel->setWordWrap(true);
|
m_descriptionLabel->setWordWrap(true);
|
||||||
|
|
||||||
#ifndef HAVE_BALOO
|
|
||||||
m_configWidget = new KFileMetaDataConfigurationWidget(this);
|
|
||||||
#else
|
|
||||||
m_configWidget = new Baloo::FileMetaDataConfigWidget(this);
|
m_configWidget = new Baloo::FileMetaDataConfigWidget(this);
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
QWidget* mainWidget = new QWidget(this);
|
QWidget* mainWidget = new QWidget(this);
|
||||||
QVBoxLayout* topLayout = new QVBoxLayout(mainWidget);
|
QVBoxLayout* topLayout = new QVBoxLayout(mainWidget);
|
||||||
|
|
|
@ -70,11 +70,7 @@ protected slots:
|
||||||
void slotAccepted();
|
void slotAccepted();
|
||||||
private:
|
private:
|
||||||
QLabel* m_descriptionLabel;
|
QLabel* m_descriptionLabel;
|
||||||
#ifndef HAVE_BALOO
|
|
||||||
KFileMetaDataConfigurationWidget* m_configWidget;
|
|
||||||
#else
|
|
||||||
Baloo::FileMetaDataConfigWidget* m_configWidget;
|
Baloo::FileMetaDataConfigWidget* m_configWidget;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,11 +32,7 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
|
|
||||||
#ifndef HAVE_BALOO
|
|
||||||
#include <KFileMetaDataWidget>
|
|
||||||
#else
|
|
||||||
#include <Baloo/FileMetaDataWidget>
|
#include <Baloo/FileMetaDataWidget>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <panels/places/placesitem.h>
|
#include <panels/places/placesitem.h>
|
||||||
#include <panels/places/placesitemmodel.h>
|
#include <panels/places/placesitemmodel.h>
|
||||||
|
@ -106,19 +102,13 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
|
||||||
const bool previewsShown = InformationPanelSettings::previewsShown();
|
const bool previewsShown = InformationPanelSettings::previewsShown();
|
||||||
m_preview->setVisible(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 = new Baloo::FileMetaDataWidget(parent);
|
||||||
m_metaDataWidget->setDateFormat(static_cast<Baloo::DateFormats>(InformationPanelSettings::dateFormat()));
|
m_metaDataWidget->setDateFormat(static_cast<Baloo::DateFormats>(InformationPanelSettings::dateFormat()));
|
||||||
connect(m_metaDataWidget, &Baloo::FileMetaDataWidget::urlActivated,
|
connect(m_metaDataWidget, &Baloo::FileMetaDataWidget::urlActivated,
|
||||||
this, &InformationPanelContent::urlActivated);
|
this, &InformationPanelContent::urlActivated);
|
||||||
#endif
|
|
||||||
m_metaDataWidget->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
|
m_metaDataWidget->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
|
||||||
m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
|
m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
|
||||||
|
|
||||||
// Encapsulate the MetaDataWidget inside a container that has a dummy widget
|
// Encapsulate the MetaDataWidget inside a container that has a dummy widget
|
||||||
// at the bottom. This prevents that the meta data widget gets vertically stretched
|
// at the bottom. This prevents that the meta data widget gets vertically stretched
|
||||||
// in the case where the height of m_metaDataArea > m_metaDataWidget.
|
// in the case where the height of m_metaDataArea > m_metaDataWidget.
|
||||||
|
@ -194,9 +184,7 @@ void InformationPanelContent::showItem(const KFileItem& item)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_metaDataWidget) {
|
if (m_metaDataWidget) {
|
||||||
#ifdef HAVE_BALOO
|
|
||||||
m_metaDataWidget->setDateFormat(static_cast<Baloo::DateFormats>(InformationPanelSettings::dateFormat()));
|
m_metaDataWidget->setDateFormat(static_cast<Baloo::DateFormats>(InformationPanelSettings::dateFormat()));
|
||||||
#endif
|
|
||||||
m_metaDataWidget->show();
|
m_metaDataWidget->show();
|
||||||
m_metaDataWidget->setItems(KFileItemList() << item);
|
m_metaDataWidget->setItems(KFileItemList() << item);
|
||||||
}
|
}
|
||||||
|
@ -285,12 +273,11 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon
|
||||||
QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
|
QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
|
||||||
configureAction->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
|
configureAction->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
|
||||||
|
|
||||||
#ifdef HAVE_BALOO
|
|
||||||
QAction* dateformatAction = popup.addAction(i18nc("@action:inmenu", "Condensed Date"));
|
QAction* dateformatAction = popup.addAction(i18nc("@action:inmenu", "Condensed Date"));
|
||||||
dateformatAction->setIcon(QIcon::fromTheme(QStringLiteral("change-date-symbolic")));
|
dateformatAction->setIcon(QIcon::fromTheme(QStringLiteral("change-date-symbolic")));
|
||||||
dateformatAction->setCheckable(true);
|
dateformatAction->setCheckable(true);
|
||||||
dateformatAction->setChecked(InformationPanelSettings::dateFormat() == static_cast<int>(Baloo::DateFormats::ShortFormat));
|
dateformatAction->setChecked(InformationPanelSettings::dateFormat() == static_cast<int>(Baloo::DateFormats::ShortFormat));
|
||||||
#endif
|
|
||||||
popup.addSeparator();
|
popup.addSeparator();
|
||||||
foreach (QAction* action, customContextMenuActions) {
|
foreach (QAction* action, customContextMenuActions) {
|
||||||
popup.addAction(action);
|
popup.addAction(action);
|
||||||
|
@ -316,14 +303,12 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon
|
||||||
dialog->show();
|
dialog->show();
|
||||||
connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData);
|
connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_BALOO
|
|
||||||
if (action == dateformatAction) {
|
if (action == dateformatAction) {
|
||||||
int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat);
|
int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat);
|
||||||
|
|
||||||
InformationPanelSettings::setDateFormat(dateFormat);
|
InformationPanelSettings::setDateFormat(dateFormat);
|
||||||
refreshMetaData();
|
refreshMetaData();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InformationPanelContent::showIcon(const KFileItem& item)
|
void InformationPanelContent::showIcon(const KFileItem& item)
|
||||||
|
|
|
@ -78,9 +78,11 @@ BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) :
|
||||||
topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed));
|
topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_BALOO
|
||||||
// 'Show tooltips'
|
// 'Show tooltips'
|
||||||
m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips"));
|
m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips"));
|
||||||
topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showToolTips);
|
topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showToolTips);
|
||||||
|
#endif
|
||||||
|
|
||||||
// 'Show selection marker'
|
// 'Show selection marker'
|
||||||
m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker"));
|
m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker"));
|
||||||
|
@ -98,7 +100,9 @@ BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) :
|
||||||
|
|
||||||
connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
|
connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
|
||||||
connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
|
connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
|
||||||
|
#ifdef HAVE_BALOO
|
||||||
connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
|
connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
|
||||||
|
#endif
|
||||||
connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
|
connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
|
||||||
connect(m_naturalSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
|
connect(m_naturalSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
|
||||||
connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
|
connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
|
||||||
|
@ -118,7 +122,9 @@ void BehaviorSettingsPage::applySettings()
|
||||||
|
|
||||||
const bool useGlobalViewProps = m_globalViewProps->isChecked();
|
const bool useGlobalViewProps = m_globalViewProps->isChecked();
|
||||||
settings->setGlobalViewProps(useGlobalViewProps);
|
settings->setGlobalViewProps(useGlobalViewProps);
|
||||||
|
#ifdef HAVE_BALOO
|
||||||
settings->setShowToolTips(m_showToolTips->isChecked());
|
settings->setShowToolTips(m_showToolTips->isChecked());
|
||||||
|
#endif
|
||||||
settings->setShowSelectionToggle(m_showSelectionToggle->isChecked());
|
settings->setShowSelectionToggle(m_showSelectionToggle->isChecked());
|
||||||
setSortingChoiceValue(settings);
|
setSortingChoiceValue(settings);
|
||||||
settings->setRenameInline(m_renameInline->isChecked());
|
settings->setRenameInline(m_renameInline->isChecked());
|
||||||
|
@ -149,7 +155,9 @@ void BehaviorSettingsPage::loadSettings()
|
||||||
m_localViewProps->setChecked(!useGlobalViewProps);
|
m_localViewProps->setChecked(!useGlobalViewProps);
|
||||||
m_globalViewProps->setChecked(useGlobalViewProps);
|
m_globalViewProps->setChecked(useGlobalViewProps);
|
||||||
|
|
||||||
|
#ifdef HAVE_BALOO
|
||||||
m_showToolTips->setChecked(GeneralSettings::showToolTips());
|
m_showToolTips->setChecked(GeneralSettings::showToolTips());
|
||||||
|
#endif
|
||||||
m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle());
|
m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle());
|
||||||
m_renameInline->setChecked(GeneralSettings::renameInline());
|
m_renameInline->setChecked(GeneralSettings::renameInline());
|
||||||
m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView());
|
m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView());
|
||||||
|
|
|
@ -176,8 +176,10 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
|
||||||
connect(selectionManager, &KItemListSelectionManager::selectionChanged,
|
connect(selectionManager, &KItemListSelectionManager::selectionChanged,
|
||||||
this, &DolphinView::slotSelectionChanged);
|
this, &DolphinView::slotSelectionChanged);
|
||||||
|
|
||||||
|
#ifdef HAVE_BALOO
|
||||||
m_toolTipManager = new ToolTipManager(this);
|
m_toolTipManager = new ToolTipManager(this);
|
||||||
connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated);
|
connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_versionControlObserver = new VersionControlObserver(this);
|
m_versionControlObserver = new VersionControlObserver(this);
|
||||||
m_versionControlObserver->setModel(m_model);
|
m_versionControlObserver->setModel(m_model);
|
||||||
|
@ -1030,7 +1032,9 @@ void DolphinView::slotItemHovered(int index)
|
||||||
const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint());
|
const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint());
|
||||||
itemRect.moveTo(pos);
|
itemRect.moveTo(pos);
|
||||||
|
|
||||||
|
#ifdef HAVE_BALOO
|
||||||
m_toolTipManager->showToolTip(item, itemRect, nativeParentWidget()->windowHandle());
|
m_toolTipManager->showToolTip(item, itemRect, nativeParentWidget()->windowHandle());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
emit requestItemInfo(item);
|
emit requestItemInfo(item);
|
||||||
|
@ -1407,9 +1411,11 @@ void DolphinView::updateViewState()
|
||||||
|
|
||||||
void DolphinView::hideToolTip()
|
void DolphinView::hideToolTip()
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_BALOO
|
||||||
if (GeneralSettings::showToolTips()) {
|
if (GeneralSettings::showToolTips()) {
|
||||||
m_toolTipManager->hideToolTip();
|
m_toolTipManager->hideToolTip();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DolphinView::calculateItemCount(int& fileCount,
|
void DolphinView::calculateItemCount(int& fileCount,
|
||||||
|
|
|
@ -24,11 +24,7 @@
|
||||||
#include <KColorScheme>
|
#include <KColorScheme>
|
||||||
#include <KSeparator>
|
#include <KSeparator>
|
||||||
#include <KStringHandler>
|
#include <KStringHandler>
|
||||||
#ifndef HAVE_BALOO
|
|
||||||
#include <KFileMetaDataWidget>
|
|
||||||
#else
|
|
||||||
#include <Baloo/FileMetaDataWidget>
|
#include <Baloo/FileMetaDataWidget>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QStyleOptionFrame>
|
#include <QStyleOptionFrame>
|
||||||
|
@ -61,19 +57,11 @@ DolphinFileMetaDataWidget::DolphinFileMetaDataWidget(QWidget* parent) :
|
||||||
m_name->setMaximumWidth(fontMetrics.averageCharWidth() * 40);
|
m_name->setMaximumWidth(fontMetrics.averageCharWidth() * 40);
|
||||||
|
|
||||||
// Create widget for the meta data
|
// 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);
|
m_fileMetaDataWidget = new Baloo::FileMetaDataWidget(this);
|
||||||
connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::metaDataRequestFinished,
|
connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::metaDataRequestFinished,
|
||||||
this, &DolphinFileMetaDataWidget::metaDataRequestFinished);
|
this, &DolphinFileMetaDataWidget::metaDataRequestFinished);
|
||||||
connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::urlActivated,
|
connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::urlActivated,
|
||||||
this, &DolphinFileMetaDataWidget::urlActivated);
|
this, &DolphinFileMetaDataWidget::urlActivated);
|
||||||
#endif
|
|
||||||
m_fileMetaDataWidget->setForegroundRole(QPalette::ToolTipText);
|
m_fileMetaDataWidget->setForegroundRole(QPalette::ToolTipText);
|
||||||
m_fileMetaDataWidget->setReadOnly(true);
|
m_fileMetaDataWidget->setReadOnly(true);
|
||||||
|
|
||||||
|
|
|
@ -29,13 +29,9 @@
|
||||||
class KFileItemList;
|
class KFileItemList;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
|
||||||
#ifndef HAVE_BALOO
|
|
||||||
class KFileMetaDataWidget;
|
|
||||||
#else
|
|
||||||
namespace Baloo {
|
namespace Baloo {
|
||||||
class FileMetaDataWidget;
|
class FileMetaDataWidget;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Widget that shows the meta information and a preview of one
|
* @brief Widget that shows the meta information and a preview of one
|
||||||
|
@ -79,11 +75,7 @@ signals:
|
||||||
private:
|
private:
|
||||||
QLabel* m_preview;
|
QLabel* m_preview;
|
||||||
QLabel* m_name;
|
QLabel* m_name;
|
||||||
#ifndef HAVE_BALOO
|
|
||||||
KFileMetaDataWidget* m_fileMetaDataWidget;
|
|
||||||
#else
|
|
||||||
Baloo::FileMetaDataWidget* m_fileMetaDataWidget;
|
Baloo::FileMetaDataWidget* m_fileMetaDataWidget;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user