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