mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Allow compiling with the frameworks branches of Baloo
This commit is contained in:
parent
8611c990f0
commit
497e2b2fef
|
@ -1,17 +1,17 @@
|
|||
find_package(Baloo)
|
||||
find_package(Baloo 4.97)
|
||||
set_package_properties(Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
|
||||
URL "http://www.kde.org"
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "For adding desktop-wide search and tagging support to dolphin"
|
||||
)
|
||||
|
||||
find_package(BalooWidgets)
|
||||
find_package(BalooWidgets 4.97)
|
||||
set_package_properties(BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
|
||||
URL "http://www.kde.org"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
find_package(KFileMetaData)
|
||||
find_package(KFileMetaData 4.97)
|
||||
set_package_properties(KFileMetaData PROPERTIES
|
||||
URL "https://projects.kde.org/kfilemetadata"
|
||||
TYPE OPTIONAL
|
||||
|
@ -120,7 +120,7 @@ kde4_add_kcfg_files(dolphinprivate_LIB_SRCS
|
|||
kde4_add_library(dolphinprivate SHARED ${dolphinprivate_LIB_SRCS})
|
||||
|
||||
target_link_libraries(
|
||||
dolphinprivate
|
||||
dolphinprivate PUBLIC
|
||||
konq
|
||||
KF5::NewStuff
|
||||
KF5::KDE4Support
|
||||
|
@ -128,10 +128,11 @@ target_link_libraries(
|
|||
|
||||
if(HAVE_BALOO)
|
||||
target_link_libraries(
|
||||
dolphinprivate
|
||||
${BALOO_LIBRARIES}
|
||||
dolphinprivate PUBLIC
|
||||
KF5::FileMetaData
|
||||
${BALOO_CORE_LIBRARY}
|
||||
${BALOO_FILE_LIBRARY}
|
||||
${BALOO_WIDGETS_LIBRARY}
|
||||
${KFILEMETADATA_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -139,8 +140,6 @@ if(X11_Xrender_FOUND)
|
|||
target_link_libraries(dolphinprivate ${X11_Xrender_LIB})
|
||||
endif(X11_Xrender_FOUND)
|
||||
|
||||
target_link_libraries(dolphinprivate ${KDE4_PLASMA_LIBS})
|
||||
|
||||
set_target_properties(dolphinprivate PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
|
||||
install(TARGETS dolphinprivate ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
||||
|
@ -246,19 +245,12 @@ target_link_libraries(kdeinit_dolphin
|
|||
KF5::KDE4Support
|
||||
)
|
||||
|
||||
if(HAVE_BALOO)
|
||||
target_link_libraries(kdeinit_dolphin
|
||||
${BALOO_LIBRARIES}
|
||||
${BALOO_WIDGETS_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (KActivities_FOUND)
|
||||
if (KF5Activities_FOUND)
|
||||
target_link_libraries(
|
||||
kdeinit_dolphin
|
||||
${KACTIVITIES_LIBRARY}
|
||||
KF5::Activities
|
||||
)
|
||||
endif (KActivities_FOUND)
|
||||
endif()
|
||||
|
||||
install(TARGETS kdeinit_dolphin ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(TARGETS dolphin ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
|
|
@ -282,8 +282,8 @@ void KFileItemModelRolesUpdater::setRoles(const QSet<QByteArray>& roles)
|
|||
|
||||
if (hasBalooRole && !m_balooFileMonitor) {
|
||||
m_balooFileMonitor = new Baloo::FileMonitor(this);
|
||||
connect(m_balooFileMonitor, SIGNAL(fileMetaDataChanged(QString)),
|
||||
this, SLOT(applyChangedBalooRoles(QString)));
|
||||
connect(m_balooFileMonitor, &Baloo::FileMonitor::fileMetaDataChanged,
|
||||
this, &KFileItemModelRolesUpdater::applyChangedBalooRoles);
|
||||
} else if (!hasBalooRole && m_balooFileMonitor) {
|
||||
delete m_balooFileMonitor;
|
||||
m_balooFileMonitor = 0;
|
||||
|
@ -706,7 +706,7 @@ void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& itemUrl)
|
|||
}
|
||||
|
||||
Baloo::FileFetchJob* job = new Baloo::FileFetchJob(item.localPath());
|
||||
connect(job, SIGNAL(finished(KJob*)), this, SLOT(applyChangedBalooRolesJobFinished(KJob*)));
|
||||
connect(job, &Baloo::FileFetchJob::finished, this, &KFileItemModelRolesUpdater::applyChangedBalooRolesJobFinished);
|
||||
job->setProperty("item", QVariant::fromValue(item));
|
||||
job->start();
|
||||
#else
|
||||
|
@ -738,12 +738,12 @@ void KFileItemModelRolesUpdater::applyChangedBalooRolesJobFinished(KJob* kjob)
|
|||
data.insert(it.key(), it.value());
|
||||
}
|
||||
|
||||
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
disconnect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
const int index = m_model->index(item);
|
||||
m_model->setData(index, data);
|
||||
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
connect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -116,12 +116,15 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
|
|||
|
||||
#ifndef HAVE_BALOO
|
||||
m_metaDataWidget = new KFileMetaDataWidget(parent);
|
||||
connect(m_metaDataWidget, &KFileMetaDataWidget::urlActivated,
|
||||
this, &InformationPanelContent::urlActivated);
|
||||
#else
|
||||
m_metaDataWidget = new Baloo::FileMetaDataWidget(parent);
|
||||
connect(m_metaDataWidget, &Baloo::FileMetaDataWidget::urlActivated,
|
||||
this, &InformationPanelContent::urlActivated);
|
||||
#endif
|
||||
m_metaDataWidget->setFont(KGlobalSettings::smallestReadableFont());
|
||||
m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
|
||||
connect(m_metaDataWidget, &KFileMetaDataWidget::urlActivated, this, &InformationPanelContent::urlActivated);
|
||||
|
||||
// Encapsulate the MetaDataWidget inside a container that has a dummy widget
|
||||
// at the bottom. This prevents that the meta data widget gets vertically stretched
|
||||
|
|
|
@ -71,13 +71,15 @@ FileMetaDataToolTip::FileMetaDataToolTip(QWidget* parent) :
|
|||
// Create widget for the meta data
|
||||
#ifndef HAVE_BALOO
|
||||
m_fileMetaDataWidget = new KFileMetaDataWidget(this);
|
||||
connect(m_fileMetaDataWidget, &KFileMetaDataWidget::metaDataRequestFinished,
|
||||
this, &FileMetaDataToolTip::metaDataRequestFinished);
|
||||
#else
|
||||
m_fileMetaDataWidget = new Baloo::FileMetaDataWidget(this);
|
||||
connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::metaDataRequestFinished,
|
||||
this, &FileMetaDataToolTip::metaDataRequestFinished);
|
||||
#endif
|
||||
m_fileMetaDataWidget->setForegroundRole(QPalette::ToolTipText);
|
||||
m_fileMetaDataWidget->setReadOnly(true);
|
||||
connect(m_fileMetaDataWidget, &KFileMetaDataWidget::metaDataRequestFinished,
|
||||
this, &FileMetaDataToolTip::metaDataRequestFinished);
|
||||
|
||||
QVBoxLayout* textLayout = new QVBoxLayout();
|
||||
textLayout->addWidget(m_name);
|
||||
|
|
Loading…
Reference in a new issue