#include <KPluginMetaData>
#include <KSharedConfig>
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
#include "private/kbaloorolesprovider.h"
#include <Baloo/File>
#include <Baloo/FileMonitor>
m_recentlyChangedItems(),
m_changedItems(),
m_directoryContentsCounter(nullptr)
- #ifdef HAVE_BALOO
+ #if HAVE_BALOO
, m_balooFileMonitor(nullptr)
#endif
{
m_resolvableRoles.insert("size");
m_resolvableRoles.insert("type");
m_resolvableRoles.insert("isExpandable");
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
m_resolvableRoles += KBalooRolesProvider::instance().roles();
#endif
connect(m_directoryContentsCounter, &KDirectoryContentsCounter::result,
this, &KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived);
- const auto plugins = KPluginMetaData::findPlugins(QStringLiteral("kf5/overlayicon"));
+ const auto plugins = KPluginMetaData::findPlugins(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR)) + QStringLiteral("/overlayicon"));
for (const KPluginMetaData &data : plugins) {
auto instance = QPluginLoader(data.fileName()).instance();
auto plugin = qobject_cast<KOverlayIconPlugin *>(instance);
if (m_roles != roles) {
m_roles = roles;
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
// Check whether there is at least one role that must be resolved
// with the help of Baloo. If this is the case, a (quite expensive)
// resolving will be done in KFileItemModelRolesUpdater::rolesData() and
const bool allItemsRemoved = (m_model->count() == 0);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
if (m_balooFileMonitor) {
// Don't let the FileWatcher watch for removed items
if (allItemsRemoved) {
void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& file)
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
const KFileItem item = m_model->fileItem(QUrl::fromLocalFile(file));
if (item.isNull()) {
void KFileItemModelRolesUpdater::applyChangedBalooRolesForItem(const KFileItem &item)
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
Baloo::File file(item.localPath());
file.load();
}
data.insert("iconOverlays", overlays);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
if (m_balooFileMonitor) {
m_balooFileMonitor->addFile(item.localPath());
applyChangedBalooRolesForItem(item);