[multimedia/elisa] /: Remove Baloo indexing, only use internal indexer.
Christoph Cullmann
null at kde.org
Fri Nov 17 11:29:34 GMT 2023
Git commit 3f13dd2544738f7755a62208b7c7a0f534c7ea60 by Christoph Cullmann.
Committed on 17/11/2023 at 12:29.
Pushed by cullmann into branch 'master'.
Remove Baloo indexing, only use internal indexer.
Less code to maintain, less potential bugs for the users and less confusion.
M +1 -19 .flatpak-manifest.json
M +0 -1 .kde-ci.yml
M +0 -8 CMakeLists.txt
M +0 -1 README.packagers
M +0 -2 config-upnp-qt.h.cmake
M +1 -4 doc/index.docbook
M +0 -1 elisa.categories
M +1 -1 org.kde.elisa.appdata.xml
M +0 -61 src/CMakeLists.txt
D +0 -108 src/baloo/baloodetector.cpp
D +0 -58 src/baloo/baloodetector.h
D +0 -31 src/baloo/baloolistener.cpp
D +0 -37 src/baloo/baloolistener.h
D +0 -471 src/baloo/localbaloofilelisting.cpp
D +0 -73 src/baloo/localbaloofilelisting.h
M +1 -6 src/file/localfilelisting.cpp
M +0 -34 src/filescanner.cpp
M +0 -2 src/filescanner.h
M +0 -16 src/localFileConfiguration/elisaconfigurationdialog.cpp
M +0 -16 src/localFileConfiguration/elisaconfigurationdialog.h
M +4 -143 src/musiclistenersmanager.cpp
M +0 -22 src/musiclistenersmanager.h
M +0 -2 src/plugins.qmltypes
M +0 -42 src/qml/SettingsForm.qml
https://invent.kde.org/multimedia/elisa/-/commit/3f13dd2544738f7755a62208b7c7a0f534c7ea60
diff --git a/.flatpak-manifest.json b/.flatpak-manifest.json
index b0d52e71d..357588893 100644
--- a/.flatpak-manifest.json
+++ b/.flatpak-manifest.json
@@ -7,7 +7,7 @@
"command": "elisa",
"tags": ["nightly"],
"desktop-file-name-suffix": " (Nightly)",
- "finish-args": ["--share=ipc", "--socket=x11", "--socket=wayland", "--filesystem=home", "--socket=pulseaudio", "--device=dri", "--socket=session-bus", "--env=BALOO_DB_PATH=.local/share/baloo" ],
+ "finish-args": ["--share=ipc", "--socket=x11", "--socket=wayland", "--filesystem=home", "--socket=pulseaudio", "--device=dri", "--socket=session-bus"],
"modules": [
{
@@ -74,24 +74,6 @@
}
]
},
- {
- "config-opts": ["-DENABLE_TESTING=OFF", "-DCMAKE_INSTALL_LIBDIR=lib", "-DLMDB_DIR=/app"],
- "name": "baloo",
- "buildsystem": "cmake-ninja",
- "builddir": true,
- "sources": [
- {
- "type": "git",
- "url": "https://invent.kde.org/frameworks/baloo.git",
- "tag": "v5.92.0",
- "x-checker-data": {
- "type": "git",
- "tag-pattern": "^v([\\d.]+)$"
- },
- "commit": "5aa4d1eb22b00802405b0c2e2a4446a223e50fd2"
- }
- ]
- },
{
"name": "elisa",
"buildsystem": "cmake-ninja",
diff --git a/.kde-ci.yml b/.kde-ci.yml
index 9c86acb66..af31ba3cc 100644
--- a/.kde-ci.yml
+++ b/.kde-ci.yml
@@ -24,7 +24,6 @@ Dependencies:
- 'on': ['Linux/Qt6', 'FreeBSD/Qt6']
'require':
- 'frameworks/baloo': '@latest-kf6'
'frameworks/kdbusaddons': '@latest-kf6'
Options:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 813c7e459..bd037aaa3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,13 +85,6 @@ set_package_properties(KF6IconThemes PROPERTIES
DESCRIPTION "Support for icon themes."
TYPE REQUIRED)
-if (NOT WIN32)
-find_package(KF6Baloo ${REQUIRED_KF_VERSION} CONFIG QUIET)
-set_package_properties(KF6Baloo PROPERTIES
- DESCRIPTION "Baloo provides file searching and indexing."
- TYPE RECOMMENDED)
-endif()
-
find_package(KF6FileMetaData ${REQUIRED_KF_VERSION} CONFIG QUIET)
set_package_properties(KF6FileMetaData PROPERTIES
DESCRIPTION "Provides a simple library for extracting metadata."
@@ -169,7 +162,6 @@ include(ECMGenerateDBusServiceFile)
include(CMakePackageConfigHelpers)
include(ECMDeprecationSettings)
-set(KFBaloo_FOUND ${KF6Baloo_FOUND})
set(KFXmlGui_FOUND ${KF6XmlGui_FOUND})
set(KFCrash_FOUND ${KF6Crash_FOUND})
set(KFDBusAddons_FOUND ${KF6DBusAddons_FOUND})
diff --git a/README.packagers b/README.packagers
index 3786487d8..d9c104df8 100644
--- a/README.packagers
+++ b/README.packagers
@@ -33,7 +33,6 @@ Elisa has the following dependencies:
-- RECOMMENDED:
- * Baloo (required version >= 5.70.0), Baloo provides file searching and indexing.
* KFileMetaData (required version >= 5.70.0), Provides a simple library for extracting metadata.
* KXmlGui (required version >= 5.70.0), Framework for managing menu and toolbar actions.
* KConfigWidgets (required version >= 5.70.0), Widgets for configuration dialogs.
diff --git a/config-upnp-qt.h.cmake b/config-upnp-qt.h.cmake
index d63455536..4a82f3723 100644
--- a/config-upnp-qt.h.cmake
+++ b/config-upnp-qt.h.cmake
@@ -2,8 +2,6 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later
-#cmakedefine01 KFBaloo_FOUND
-
#cmakedefine01 KFXmlGui_FOUND
#cmakedefine01 KFCrash_FOUND
diff --git a/doc/index.docbook b/doc/index.docbook
index 62cef50aa..240141606 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -86,10 +86,7 @@ control of their data.
<title>Using &elisa;</title>
<para>
-&elisa; indexes your music either by using Baloo if possible or by searching in a list of paths configured by the user through a dedicated interface.
-</para>
-<para>
-In case the Baloo support is activated and your setup is not working, a notification is shown with hints allowing to deactivate the indexer or to activate the Baloo indexer and to feed &elisa; with music tracks.
+&elisa; indexes your music by searching in a list of paths configured by the user through a dedicated interface.
</para>
<para>
In case the file indexer is not finding anything, a notification is shown with a button to open the configuration interface.
diff --git a/elisa.categories b/elisa.categories
index 2d17f19f6..6df2bba4c 100644
--- a/elisa.categories
+++ b/elisa.categories
@@ -3,4 +3,3 @@ org.kde.elisa.database elisa (database) DEFAULT_SEVERITY [INFO] IDENTIFIER [orgK
org.kde.elisa.indexer elisa (indexer) DEFAULT_SEVERITY [INFO] IDENTIFIER [orgKdeElisaIndexer]
org.kde.elisa.player.vlc elisa (vlc) DEFAULT_SEVERITY [INFO] IDENTIFIER [orgKdeElisaPlayerVlc]
org.kde.elisa.player.qtMultimedia elisa (qtmultimedia) DEFAULT_SEVERITY [INFO] IDENTIFIER [orgKdeElisaPlayerQtMultimedia]
-org.kde.elisa.baloo elisa (baloo) DEFAULT_SEVERITY [INFO] IDENTIFIER [orgKdeElisaBaloo]
diff --git a/org.kde.elisa.appdata.xml b/org.kde.elisa.appdata.xml
index d94063e03..786656ed8 100644
--- a/org.kde.elisa.appdata.xml
+++ b/org.kde.elisa.appdata.xml
@@ -155,7 +155,7 @@ SPDX-License-Identifier: CC0-1.0
<p xml:lang="uk">За допомогою Elisa ви можете здійснювати навігацію вашою музичною збіркою за жанром, виконавцем, альбомом або композицією, прослуховувати інтернет-радіо, створювати списки відтворення та керувати ними, переглядати тексти пісень тощо.</p>
<p xml:lang="x-test">xxWith Elisa, you can browse your local music collection by genre, artist, album, or track, listen to online radio, create and manage playlists, display lyrics, and more.xx</p>
<p xml:lang="zh-CN">您可以通过 Elisa 按照流派、艺人、专辑、曲目等条件浏览您的本地音乐。它还支持收听网络电台、创建并管理播放列表、显示歌词等功能。</p>
- <p>Indexing your music is lightning fast thanks to integration with KDE's Baloo file indexer, or it can use a built-in indexer if Baloo isn't available or in use. And Elisa supports your full KDE color scheme when used on the Plasma desktop, or else the standard light and dark modes.</p>
+ <p>Elisa supports your full KDE color scheme when used on the Plasma desktop, or else the standard light and dark modes.</p>
<p xml:lang="bg">Индексирането на вашата музика става светкавично бързо благодарение на интеграцията с KDE's Baloo или, ако Baloo не се използва, с вградена програма за индексиране. Elisa напълно поддържа цветовата схема на KDE, ако се използва Plasma, иначе са налични стандартните светла и тъмна тема. </p>
<p xml:lang="ca">Indexar la música és ràpid com un llamp gràcies a la integració amb l'indexador de fitxers Baloo de KDE, o es pot utilitzar un indexador integrat si el Baloo no està disponible o en ús. I l'Elisa admet l'esquema de color KDE complet quan s'utilitza a l'escriptori Plasma, o els modes clars i foscos estàndard.</p>
<p xml:lang="ca-valencia">Indexar la música és ràpid com un llamp gràcies a la integració amb l'indexador de fitxers Baloo de KDE, o es pot utilitzar un indexador integrat si Baloo no està disponible o en ús. I Elisa admet l'esquema de color KDE complet quan s'utilitza a l'escriptori Plasma, o els modes clars i foscos estàndard.</p>
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3ba04cc89..fab4ccf91 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -145,40 +145,6 @@ if (KF6KIO_FOUND)
)
endif()
-if (KF6Baloo_FOUND)
- if (Qt6DBus_FOUND)
- ecm_qt_declare_logging_category(elisaLib_SOURCES
- HEADER "baloo/baloocommon.h"
- IDENTIFIER "orgKdeElisaBaloo"
- CATEGORY_NAME "org.kde.elisa.baloo"
- DEFAULT_SEVERITY Info
- )
-
- set(elisaLib_SOURCES
- ${elisaLib_SOURCES}
- baloo/localbaloofilelisting.cpp
- baloo/baloolistener.cpp
- baloo/baloodetector.cpp
- )
-
- qt_add_dbus_interface(elisaLib_SOURCES
- ${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.main.xml
- baloo/main)
-
- qt_add_dbus_interface(elisaLib_SOURCES
- ${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.fileindexer.xml
- baloo/fileindexer)
-
- qt_add_dbus_interface(elisaLib_SOURCES
- ${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.scheduler.xml
- baloo/scheduler)
-
- qt_add_dbus_adaptor(elisaLib_SOURCES
- ${BALOO_DBUS_INTERFACES_DIR}/org.kde.BalooWatcherApplication.xml
- baloo/localbaloofilelisting.h LocalBalooFileListing)
- endif()
-endif()
-
if (Qt6DBus_FOUND)
set(elisaLib_SOURCES
${elisaLib_SOURCES}
@@ -201,24 +167,6 @@ if (UPNPQT_FOUND)
)
endif()
-if (KF6Baloo_FOUND)
- if (Qt6DBus_FOUND)
- qt_add_dbus_interface(elisaLib_SOURCES
- ${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.fileindexer.xml
- baloo/fileindexer)
-
- qt_add_dbus_interface(elisaLib_SOURCES
- ${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.scheduler.xml
- baloo/scheduler)
-
- set(elisaLib_SOURCES
- ${elisaLib_SOURCES}
- ../src/baloo/baloolistener.cpp
- ../src/baloo/localbaloofilelisting.cpp
- )
- endif()
-endif()
-
kconfig_add_kcfg_files(elisaLib_SOURCES ../src/elisa_settings.kcfgc GENERATE_MOC )
set(elisaLib_SOURCES
${elisaLib_SOURCES}
@@ -263,15 +211,6 @@ if (KF6ConfigWidgets_FOUND)
)
endif()
-if (KF6Baloo_FOUND)
- if (Qt6DBus_FOUND)
- target_link_libraries(elisaLib
- LINK_PUBLIC
- KF6::Baloo
- )
- endif()
-endif()
-
if (Qt6DBus_FOUND)
target_link_libraries(elisaLib
LINK_PUBLIC
diff --git a/src/baloo/baloodetector.cpp b/src/baloo/baloodetector.cpp
deleted file mode 100644
index 332ceaf2c..000000000
--- a/src/baloo/baloodetector.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien at yahoo.fr>
-
- SPDX-License-Identifier: LGPL-3.0-or-later
- */
-
-#include "baloodetector.h"
-
-#include "baloo/baloocommon.h"
-
-#include <Baloo/IndexerConfig>
-
-#include <QDBusConnection>
-#include <QDBusConnectionInterface>
-
-BalooDetector::BalooDetector(QObject *parent) : QObject(parent)
-{
- connect(&mBalooWatcher, &QDBusServiceWatcher::serviceRegistered,
- this, &BalooDetector::serviceRegistered);
- connect(&mBalooWatcher, &QDBusServiceWatcher::serviceUnregistered,
- this, &BalooDetector::serviceUnregistered);
-}
-
-bool BalooDetector::balooAvailability() const
-{
- return mBalooAvailability;
-}
-
-void BalooDetector::checkBalooAvailability()
-{
- bool problemDetected = false;
-
- problemDetected = problemDetected || checkBalooConfiguration();
-
- mBalooWatcher.setWatchedServices({QStringLiteral("org.kde.baloo")});
-
- problemDetected = problemDetected || checkBalooServiceIsRunning();
-
- signalBalooAvailability(problemDetected);
-}
-
-void BalooDetector::serviceRegistered(const QString &service)
-{
- Q_UNUSED(service);
-
- bool problemDetected = false;
-
- problemDetected = problemDetected || checkBalooConfiguration();
- problemDetected = problemDetected || checkBalooServiceIsRunning();
-
- signalBalooAvailability(problemDetected);
-}
-
-void BalooDetector::serviceUnregistered(const QString &service)
-{
- Q_UNUSED(service);
-
- if (mBalooAvailability) {
- qCInfo(orgKdeElisaBaloo) << "Baloo service is no longer detected and seems not be running. Disabling Elisa support for using Baloo indexer.";
-
- mBalooAvailability = false;
- Q_EMIT balooAvailabilityChanged();
- }
-}
-
-bool BalooDetector::checkBalooConfiguration()
-{
- Baloo::IndexerConfig balooConfiguration;
-
- auto problemDetected = !balooConfiguration.fileIndexingEnabled();
-
- if (problemDetected) {
- qCInfo(orgKdeElisaBaloo) << "Baloo indexer has been configured to be deactivated. Disabling Elisa support for using Baloo indexer.";
- }
-
- return problemDetected;
-}
-
-bool BalooDetector::checkBalooServiceIsRunning()
-{
- auto problemDetected = !QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.baloo"));
-
- if (problemDetected) {
- qCInfo(orgKdeElisaBaloo) << "Baloo service is not detected and seems not be running. Disabling Elisa support for using Baloo indexer.";
- }
-
- return problemDetected;
-}
-
-void BalooDetector::signalBalooAvailability(bool isNotAvailable)
-{
- if (!isNotAvailable) {
- if (!mBalooAvailability || mBalooAvailabilityFirstChange) {
- mBalooAvailability = true;
- Q_EMIT balooAvailabilityChanged();
- }
- } else {
- if (mBalooAvailability || mBalooAvailabilityFirstChange) {
- mBalooAvailability = false;
- Q_EMIT balooAvailabilityChanged();
- }
- }
-
- mBalooAvailabilityFirstChange = false;
-}
-
-
-#include "moc_baloodetector.cpp"
diff --git a/src/baloo/baloodetector.h b/src/baloo/baloodetector.h
deleted file mode 100644
index b04b76235..000000000
--- a/src/baloo/baloodetector.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien at yahoo.fr>
-
- SPDX-License-Identifier: LGPL-3.0-or-later
- */
-
-#ifndef BALOODETECTOR_H
-#define BALOODETECTOR_H
-
-#include <QObject>
-#include <QDBusServiceWatcher>
-
-class BalooDetector : public QObject
-{
-
- Q_OBJECT
-
- Q_PROPERTY(bool balooAvailability
- READ balooAvailability
- NOTIFY balooAvailabilityChanged)
-
-public:
-
- explicit BalooDetector(QObject *parent = nullptr);
-
- [[nodiscard]] bool balooAvailability() const;
-
-Q_SIGNALS:
-
- void balooAvailabilityChanged();
-
-public Q_SLOTS:
-
- void checkBalooAvailability();
-
-private Q_SLOTS:
-
- void serviceRegistered(const QString &service);
-
- void serviceUnregistered(const QString &service);
-
-private:
-
- bool checkBalooConfiguration();
-
- bool checkBalooServiceIsRunning();
-
- void signalBalooAvailability(bool isNotAvailable);
-
- QDBusServiceWatcher mBalooWatcher;
-
- bool mBalooAvailabilityFirstChange = true;
-
- bool mBalooAvailability = false;
-
-};
-
-#endif // BALOODETECTOR_H
diff --git a/src/baloo/baloolistener.cpp b/src/baloo/baloolistener.cpp
deleted file mode 100644
index 8d22944de..000000000
--- a/src/baloo/baloolistener.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien at yahoo.fr>
-
- SPDX-License-Identifier: LGPL-3.0-or-later
- */
-
-#include "baloolistener.h"
-
-#include "localbaloofilelisting.h"
-#include "databaseinterface.h"
-
-#include <QThread>
-
-class BalooListenerPrivate
-{
-public:
-
- LocalBalooFileListing mBalooFileIndexer;
-
-};
-
-BalooListener::BalooListener(QObject *parent) : AbstractFileListener(parent), d(new BalooListenerPrivate)
-{
- setFileListing(&d->mBalooFileIndexer);
-}
-
-BalooListener::~BalooListener()
-= default;
-
-
-#include "moc_baloolistener.cpp"
diff --git a/src/baloo/baloolistener.h b/src/baloo/baloolistener.h
deleted file mode 100644
index d28d4316b..000000000
--- a/src/baloo/baloolistener.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien at yahoo.fr>
-
- SPDX-License-Identifier: LGPL-3.0-or-later
- */
-
-#ifndef BALOOLISTENER_H
-#define BALOOLISTENER_H
-
-#include "../abstractfile/abstractfilelistener.h"
-
-#include <QObject>
-
-#include <memory>
-
-class BalooListenerPrivate;
-
-class BalooListener : public AbstractFileListener
-{
- Q_OBJECT
-
-public:
- explicit BalooListener(QObject *parent = nullptr);
-
- ~BalooListener() override;
-
-Q_SIGNALS:
-
-public Q_SLOTS:
-
-private:
-
- std::unique_ptr<BalooListenerPrivate> d;
-
-};
-
-#endif // BALOOLISTENER_H
diff --git a/src/baloo/localbaloofilelisting.cpp b/src/baloo/localbaloofilelisting.cpp
deleted file mode 100644
index ee039d9e7..000000000
--- a/src/baloo/localbaloofilelisting.cpp
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien at yahoo.fr>
-
- SPDX-License-Identifier: LGPL-3.0-or-later
- */
-
-#include "localbaloofilelisting.h"
-
-#include "baloo/baloocommon.h"
-
-#include "elisa_settings.h"
-#include "elisautils.h"
-
-#include "baloo/scheduler.h"
-#include "baloo/fileindexer.h"
-#include "baloo/main.h"
-
-#include "baloowatcherapplicationadaptor.h"
-
-#include "filescanner.h"
-
-#include <Baloo/Query>
-#include <Baloo/File>
-#include <Baloo/IndexerConfig>
-
-
-
-#include <QDBusConnection>
-#include <QDBusConnectionInterface>
-#include <QDBusServiceWatcher>
-
-#include <QThread>
-#include <QFileInfo>
-#include <QAtomicInt>
-#include <QScopedPointer>
-
-#include <algorithm>
-
-class LocalBalooFileListingPrivate
-{
-public:
-
- Baloo::Query mQuery;
-
- QDBusServiceWatcher mServiceWatcher;
-
- QScopedPointer<org::kde::baloo::main> mBalooMainInterface;
-
- QScopedPointer<org::kde::baloo::fileindexer> mBalooIndexer;
-
- QScopedPointer<org::kde::baloo::scheduler> mBalooScheduler;
-
- BalooWatcherApplicationAdaptor *mDbusAdaptor = nullptr;
-
- QAtomicInt mStopRequest = 0;
-
- bool mIsRegisteredToBaloo = false;
-
- bool mIsRegisteringToBaloo = false;
-
- bool mIsRegisteredToBalooWatcher = false;
-
- bool mIsRegisteringToBalooWatcher = false;
-
-};
-
-LocalBalooFileListing::LocalBalooFileListing(QObject *parent)
- : AbstractFileListing(parent), d(std::make_unique<LocalBalooFileListingPrivate>())
-{
- d->mQuery.addType(QStringLiteral("Audio"));
- setHandleNewFiles(false);
-
- auto sessionBus = QDBusConnection::sessionBus();
-
- d->mDbusAdaptor = new BalooWatcherApplicationAdaptor(this);
-
- sessionBus.registerObject(QStringLiteral("/org/kde/BalooWatcherApplication"), d->mDbusAdaptor, QDBusConnection::ExportAllContents);
-
- connect(&d->mServiceWatcher, &QDBusServiceWatcher::serviceRegistered,
- this, &LocalBalooFileListing::serviceRegistered);
- connect(&d->mServiceWatcher, &QDBusServiceWatcher::serviceOwnerChanged,
- this, &LocalBalooFileListing::serviceOwnerChanged);
- connect(&d->mServiceWatcher, &QDBusServiceWatcher::serviceUnregistered,
- this, &LocalBalooFileListing::serviceUnregistered);
-
- d->mServiceWatcher.setConnection(sessionBus);
- d->mServiceWatcher.addWatchedService(QStringLiteral("org.kde.baloo"));
-
- if (sessionBus.interface()->isServiceRegistered(QStringLiteral("org.kde.baloo"))) {
- registerToBaloo();
- }
-}
-
-LocalBalooFileListing::~LocalBalooFileListing()
-{
- d->mDbusAdaptor->setParent(nullptr);
- d->mDbusAdaptor->deleteLater();
-}
-
-void LocalBalooFileListing::applicationAboutToQuit()
-{
- AbstractFileListing::applicationAboutToQuit();
- d->mStopRequest = 1;
-}
-
-bool isSubPath(const QString &subPath, const QString &parentPath)
-{
- const auto parentUrl = QUrl::fromLocalFile(parentPath);
- const auto childUrl = QUrl::fromLocalFile(subPath);
- return parentUrl == childUrl || parentUrl.isParentOf(childUrl);
-}
-
-QList<QString> filterParentPaths(const QString &child, const QList<QString> &paths)
-{
- const auto predicate = [&child](const QString &path) {return isSubPath(child, path);};
- QList<QString> parents;
- std::copy_if(paths.cbegin(), paths.cend(), std::back_inserter(parents), predicate);
- return parents;
-}
-
-QList<QString> filterChildPaths(const QString &parent, const QList<QString> &paths)
-{
- const auto predicate = [&parent](const QString &path) {return isSubPath(path, parent);};
- QList<QString> children;
- std::copy_if(paths.cbegin(), paths.cend(), std::back_inserter(children), predicate);
- return children;
-}
-
-// Assumes all of `paths` are either parents or children of each other
-// E.g. deepestPath({"/path/to/my/files", "/path/to/my"}) == "/path/to/my/files"
-QString deepestPath(const QList<QString> &paths)
-{
- const auto op = [](const QString &acc, const QString &path) {return isSubPath(acc, path) ? acc : path;};
- return std::reduce(++paths.cbegin(), paths.cend(), paths.first(), op);
-}
-
-bool canHandlePath(const QString &path, const QList<QString> &includePaths, const QList<QString> &excludePaths)
-{
- const auto parentIncludePaths = filterParentPaths(path, includePaths);
- if (parentIncludePaths.isEmpty()) {
- return false;
- }
- // E.g. we want to scan `/home/music` but the path `/home/music/album` is excluded
- const auto childExcludePaths = filterChildPaths(path, excludePaths);
- if (!childExcludePaths.isEmpty()) {
- return false;
- }
- const auto parentExcludePaths = filterParentPaths(path, excludePaths);
- if (parentExcludePaths.isEmpty()) {
- return true;
- }
-
- const auto closestIncludePath = deepestPath(parentIncludePaths);
- const auto closestExcludePath = deepestPath(parentExcludePaths);
- return isSubPath(closestIncludePath, closestExcludePath);
-}
-
-bool LocalBalooFileListing::canHandleRootPaths() const
-{
- const Baloo::IndexerConfig balooConfiguration;
- const auto includePaths = balooConfiguration.includeFolders();
- const auto excludePaths = balooConfiguration.excludeFolders();
-
- return std::all_of(allRootPaths().cbegin(), allRootPaths().cend(),
- [&includePaths, &excludePaths](const auto &path) {
- return canHandlePath(path, includePaths, excludePaths);
- }
- );
-}
-
-void LocalBalooFileListing::newBalooFile(const QString &fileName)
-{
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::newBalooFile" << fileName;
-
- if (!isActive()) {
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::newBalooFile is inactive";
- return;
- }
-
- auto scanFileInfo = QFileInfo(fileName);
-
- if (!scanFileInfo.exists()) {
- return;
- }
-
- if (!fileScanner().shouldScanFile(fileName)) {
- return;
- }
-
- Q_EMIT indexingStarted();
-
- auto newFile = QUrl::fromLocalFile(fileName);
-
- auto newTrack = scanOneFile(newFile, scanFileInfo, DoNotWatchFileSystemChanges);
-
- if (newTrack.isValid()) {
- QFileInfo newFileInfo(fileName);
-
- addFileInDirectory(newFile, QUrl::fromLocalFile(newFileInfo.absoluteDir().absolutePath()), DoNotWatchFileSystemChanges);
-
- emitNewFiles({newTrack});
- }
-
- Q_EMIT indexingFinished();
-}
-
-void LocalBalooFileListing::registeredToBaloo(QDBusPendingCallWatcher *watcher)
-{
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registeredToBaloo";
-
- if (!watcher) {
- return;
- }
-
- QDBusPendingReply<> reply = *watcher;
- if (reply.isError()) {
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registeredToBaloo" << reply.error().name() << reply.error().message();
- d->mIsRegisteredToBaloo = false;
- } else {
- d->mIsRegisteredToBaloo = true;
- }
-
- d->mIsRegisteringToBaloo = false;
-
- watcher->deleteLater();
-}
-
-void LocalBalooFileListing::registeredToBalooWatcher(QDBusPendingCallWatcher *watcher)
-{
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registeredToBalooWatcher";
-
- if (!watcher) {
- return;
- }
-
- QDBusPendingReply<> reply = *watcher;
- if (reply.isError()) {
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registeredToBalooWatcher" << reply.error().name() << reply.error().message();
- d->mIsRegisteredToBalooWatcher = false;
- } else {
- d->mIsRegisteredToBalooWatcher = true;
- }
-
- d->mIsRegisteringToBalooWatcher = false;
-
- watcher->deleteLater();
-}
-
-void LocalBalooFileListing::registerToBaloo()
-{
- if (d->mIsRegisteringToBaloo || d->mIsRegisteringToBalooWatcher) {
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registerToBaloo" << "already registering";
- return;
- }
-
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registerToBaloo";
-
- d->mIsRegisteringToBaloo = true;
- d->mIsRegisteringToBalooWatcher = true;
-
- auto sessionBus = QDBusConnection::sessionBus();
-
- d->mBalooMainInterface.reset(new org::kde::baloo::main(QStringLiteral("org.kde.baloo"), QStringLiteral("/"),
- sessionBus, this));
-
- if (!d->mBalooMainInterface->isValid()) {
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registerToBaloo" << "invalid org.kde.baloo/main interface";
- return;
- }
-
- d->mBalooIndexer.reset(new org::kde::baloo::fileindexer(QStringLiteral("org.kde.baloo"), QStringLiteral("/fileindexer"),
- sessionBus, this));
-
- if (!d->mBalooIndexer->isValid()) {
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registerToBaloo" << "invalid org.kde.baloo/fileindexer interface";
- return;
- }
-
- connect(d->mBalooIndexer.data(), &org::kde::baloo::fileindexer::finishedIndexingFile,
- this, &LocalBalooFileListing::newBalooFile);
-
- d->mBalooScheduler.reset(new org::kde::baloo::scheduler(QStringLiteral("org.kde.baloo"), QStringLiteral("/scheduler"),
- sessionBus, this));
-
- if (!d->mBalooScheduler->isValid()) {
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registerToBaloo" << "invalid org.kde.baloo/scheduler interface";
- return;
- }
-
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::registerToBaloo" << "call registerMonitor";
- auto answer = d->mBalooIndexer->registerMonitor();
-
- if (answer.isError()) {
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::executeInit" << answer.error().name() << answer.error().message();
- }
-
- auto pendingCallWatcher = new QDBusPendingCallWatcher(answer);
-
- connect(pendingCallWatcher, &QDBusPendingCallWatcher::finished, this, &LocalBalooFileListing::registeredToBaloo);
- if (pendingCallWatcher->isFinished()) {
- registeredToBaloo(pendingCallWatcher);
- }
-}
-
-void LocalBalooFileListing::renamedFiles(const QString &from, const QString &to, const QStringList &listFiles)
-{
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::renamedFiles" << from << to << listFiles;
-}
-
-void LocalBalooFileListing::serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner)
-{
- Q_UNUSED(oldOwner);
- Q_UNUSED(newOwner);
-
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::serviceOwnerChanged" << serviceName << oldOwner << newOwner;
-
- if (serviceName == QLatin1String("org.kde.baloo") && !newOwner.isEmpty()) {
- d->mIsRegisteredToBaloo = false;
- d->mIsRegisteredToBalooWatcher = false;
- registerToBaloo();
- }
-}
-
-void LocalBalooFileListing::serviceRegistered(const QString &serviceName)
-{
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::serviceRegistered" << serviceName;
-
- if (serviceName == QLatin1String("org.kde.baloo")) {
- registerToBaloo();
- }
-}
-
-void LocalBalooFileListing::serviceUnregistered(const QString &serviceName)
-{
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::serviceUnregistered" << serviceName;
-
- if (serviceName == QLatin1String("org.kde.baloo")) {
- d->mIsRegisteredToBaloo = false;
- d->mIsRegisteredToBalooWatcher = false;
- }
-}
-
-void LocalBalooFileListing::executeInit(QHash<QUrl, QDateTime> allFiles)
-{
- if (!isActive()) {
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::executeInit is inactive";
- return;
- }
-
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::executeInit" << "with" << allFiles.size() << "files";
- AbstractFileListing::executeInit(std::move(allFiles));
-}
-
-void LocalBalooFileListing::triggerRefreshOfContent()
-{
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerRefreshOfContent";
-
- if (!isActive()) {
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerRefreshOfContent is inactive";
- return;
- }
-
- Q_EMIT indexingStarted();
-
- AbstractFileListing::triggerRefreshOfContent();
-
- const auto &rootPaths = allRootPaths();
- bool hasSingleRootPath = (rootPaths.size() == 1);
- auto singleRootPath = rootPaths.at(0);
-
- auto resultIterator = d->mQuery.exec();
- auto newFiles = DataTypes::ListTrackDataType();
-
- while(resultIterator.next() && d->mStopRequest == 0) {
- const auto &fileName = resultIterator.filePath();
-
- if (hasSingleRootPath) {
- if (!fileName.startsWith(singleRootPath)) {
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerRefreshOfContent" << fileName << "does not match root paths";
- continue;
- }
- } else {
- bool isIncluded = false;
- for (const auto &oneRootPath : rootPaths) {
- if (fileName.startsWith(oneRootPath)) {
- isIncluded = true;
- break;
- }
- }
- if (!isIncluded) {
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerRefreshOfContent" << fileName << "does not match root paths";
- continue;
- }
- }
-
- const auto &newFileUrl = QUrl::fromLocalFile(resultIterator.filePath());
-
- auto scanFileInfo = QFileInfo(fileName);
-
- if (!scanFileInfo.exists()) {
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerRefreshOfContent" << fileName << "file does not exists";
- continue;
- }
-
- auto itExistingFile = allFiles().find(newFileUrl);
- if (itExistingFile != allFiles().end()) {
- if (*itExistingFile >= scanFileInfo.metadataChangeTime()) {
- allFiles().erase(itExistingFile);
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerRefreshOfContent" << fileName << "file not modified since last scan";
- continue;
- }
- }
-
- const auto currentDirectory = QUrl::fromLocalFile(scanFileInfo.absoluteDir().absolutePath());
-
- addFileInDirectory(newFileUrl, currentDirectory, DoNotWatchFileSystemChanges);
-
- const auto &newTrack = scanOneFile(newFileUrl, scanFileInfo, DoNotWatchFileSystemChanges);
-
- if (newTrack.isValid()) {
- newFiles.push_back(newTrack);
- if (newFiles.size() > 500 && d->mStopRequest == 0) {
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerRefreshOfContent" << "insert new tracks in database" << newFiles.count();
- emitNewFiles(newFiles);
- newFiles.clear();
- }
- } else {
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerRefreshOfContent" << fileName << "invalid track" << newTrack;
- }
- }
-
- if (!newFiles.isEmpty() && d->mStopRequest == 0) {
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerRefreshOfContent" << "insert new tracks in database" << newFiles.count();
- emitNewFiles(newFiles);
- }
-
- setWaitEndTrackRemoval(false);
-
- checkFilesToRemove();
-
- if (!waitEndTrackRemoval()) {
- Q_EMIT indexingFinished();
- }
-}
-
-void LocalBalooFileListing::triggerStop()
-{
- qCDebug(orgKdeElisaBaloo()) << "LocalBalooFileListing::triggerStop";
- AbstractFileListing::triggerStop();
-}
-
-DataTypes::TrackDataType LocalBalooFileListing::scanOneFile(const QUrl &scanFile, const QFileInfo &scanFileInfo, FileSystemWatchingModes watchForFileSystemChanges)
-{
-
- auto trackData = fileScanner().scanOneBalooFile(scanFile, scanFileInfo);
-
- if (!trackData.isValid()) {
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::scanOneFile" << scanFile << "falling back to plain file metadata analysis";
- trackData = AbstractFileListing::scanOneFile(scanFile, scanFileInfo, watchForFileSystemChanges);
- }
-
- if (trackData.isValid()) {
- addCover(trackData);
- } else {
- qCDebug(orgKdeElisaBaloo) << "LocalBalooFileListing::scanOneFile" << scanFile << "invalid track";
- }
-
- return trackData;
-}
-
-#include "moc_localbaloofilelisting.cpp"
diff --git a/src/baloo/localbaloofilelisting.h b/src/baloo/localbaloofilelisting.h
deleted file mode 100644
index de369a94b..000000000
--- a/src/baloo/localbaloofilelisting.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien at yahoo.fr>
-
- SPDX-License-Identifier: LGPL-3.0-or-later
- */
-
-#ifndef LOCALBALOOFILELISTING_H
-#define LOCALBALOOFILELISTING_H
-
-#include "../abstractfile/abstractfilelisting.h"
-
-#include <QObject>
-#include <QString>
-#include <QUrl>
-#include <QHash>
-
-#include <memory>
-
-class LocalBalooFileListingPrivate;
-class QDBusPendingCallWatcher;
-
-class LocalBalooFileListing : public AbstractFileListing
-{
-
- Q_OBJECT
-
-public:
-
- explicit LocalBalooFileListing(QObject *parent = nullptr);
-
- ~LocalBalooFileListing() override;
-
- void applicationAboutToQuit() override;
-
- [[nodiscard]] bool canHandleRootPaths() const override;
-
-Q_SIGNALS:
-
-public Q_SLOTS:
-
- void renamedFiles(const QString &from, const QString &to, const QStringList &listFiles);
-
- void serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner);
-
- void serviceRegistered(const QString &serviceName);
-
- void serviceUnregistered(const QString &serviceName);
-
-private Q_SLOTS:
-
- void newBalooFile(const QString &fileName);
-
- void registeredToBaloo(QDBusPendingCallWatcher *watcher);
-
- void registeredToBalooWatcher(QDBusPendingCallWatcher *watcher);
-
-private:
-
- void registerToBaloo();
-
- void executeInit(QHash<QUrl, QDateTime> allFiles) override;
-
- void triggerRefreshOfContent() override;
-
- void triggerStop() override;
-
- DataTypes::TrackDataType scanOneFile(const QUrl &scanFile, const QFileInfo &scanFileInfo, FileSystemWatchingModes watchForFileSystemChanges) override;
-
- std::unique_ptr<LocalBalooFileListingPrivate> d;
-
-};
-
-#endif // LOCALBALOOFILELISTING_H
diff --git a/src/file/localfilelisting.cpp b/src/file/localfilelisting.cpp
index 03fd8cb84..1725ed2a3 100644
--- a/src/file/localfilelisting.cpp
+++ b/src/file/localfilelisting.cpp
@@ -77,12 +77,7 @@ void LocalFileListing::triggerStop()
DataTypes::TrackDataType LocalFileListing::scanOneFile(const QUrl &scanFile, const QFileInfo &scanFileInfo, FileSystemWatchingModes watchForFileSystemChanges)
{
- auto trackData = fileScanner().scanOneBalooFile(scanFile, scanFileInfo);
-
- if (!trackData.isValid()) {
- qCDebug(orgKdeElisaIndexer()) << "LocalFileListing::scanOneFile" << scanFile << "falling back to plain file metadata analysis";
- trackData = AbstractFileListing::scanOneFile(scanFile, scanFileInfo, watchForFileSystemChanges);
- }
+ auto trackData = AbstractFileListing::scanOneFile(scanFile, scanFileInfo, watchForFileSystemChanges);
if (trackData.isValid()) {
addCover(trackData);
diff --git a/src/filescanner.cpp b/src/filescanner.cpp
index 16f760667..dd2a3c1c3 100644
--- a/src/filescanner.cpp
+++ b/src/filescanner.cpp
@@ -18,12 +18,6 @@
#include <KFileMetaData/UserMetaData>
#include <KFileMetaData/Properties>
-#if KFBaloo_FOUND
-
-#include <Baloo/File>
-
-#endif
-
#endif
#include <QFileInfo>
@@ -186,34 +180,6 @@ DataTypes::TrackDataType FileScanner::scanOneFile(const QUrl &scanFile)
}
}
-DataTypes::TrackDataType FileScanner::scanOneBalooFile(const QUrl &scanFile, const QFileInfo &scanFileInfo)
-{
- DataTypes::TrackDataType newTrack;
-#if KFBaloo_FOUND
- const auto &localFileName = scanFile.toLocalFile();
-
- newTrack[DataTypes::FileModificationTime] = scanFileInfo.metadataChangeTime();
- newTrack[DataTypes::ResourceRole] = scanFile;
- newTrack[DataTypes::RatingRole] = 0;
- newTrack[DataTypes::ElementTypeRole] = ElisaUtils::Track;
-
- Baloo::File match(localFileName);
-
- match.load();
-
- d->mAllProperties = match.properties();
- scanProperties(match.path(), newTrack);
-
- qCDebug(orgKdeElisaIndexer()) << "scanOneFile" << scanFile << "using Baloo" << newTrack;
-#else
- Q_UNUSED(scanFile)
- Q_UNUSED(scanFileInfo)
-
- qCDebug(orgKdeElisaIndexer()) << "scanOneFile" << scanFile << "no baloo metadata provider" << newTrack;
-#endif
- return newTrack;
-}
-
void FileScanner::scanProperties(const QString &localFileName, DataTypes::TrackDataType &trackData)
{
#if KFFileMetaData_FOUND
diff --git a/src/filescanner.h b/src/filescanner.h
index 5f5c8ff92..f35b28adc 100644
--- a/src/filescanner.h
+++ b/src/filescanner.h
@@ -31,8 +31,6 @@ public:
DataTypes::TrackDataType scanOneFile(const QUrl &scanFile, const QFileInfo &scanFileInfo);
- DataTypes::TrackDataType scanOneBalooFile(const QUrl &scanFile, const QFileInfo &scanFileInfo);
-
QUrl searchForCoverFile(const QString &localFileName);
private:
diff --git a/src/localFileConfiguration/elisaconfigurationdialog.cpp b/src/localFileConfiguration/elisaconfigurationdialog.cpp
index 0925154e0..dfd4039df 100644
--- a/src/localFileConfiguration/elisaconfigurationdialog.cpp
+++ b/src/localFileConfiguration/elisaconfigurationdialog.cpp
@@ -75,7 +75,6 @@ void ElisaConfigurationDialog::save()
Elisa::ElisaConfiguration::setShowNowPlayingBackground(mShowNowPlayingBackground);
Elisa::ElisaConfiguration::setShowProgressOnTaskBar(mShowProgressInTaskBar);
Elisa::ElisaConfiguration::setShowSystemTrayIcon(mShowSystemTrayIcon);
- Elisa::ElisaConfiguration::setForceUsageOfFastFileSearch(!mForceUsageOfSlowFileSystemIndexing);
Elisa::ElisaConfiguration::setAlwaysUseAbsolutePlaylistPaths(mAlwaysUseAbsolutePlaylistPaths);
Elisa::ElisaConfiguration::setPlayAtStartup(mPlayAtStartup);
Elisa::ElisaConfiguration::setScanAtStartup(mScanAtStartup);
@@ -162,18 +161,6 @@ void ElisaConfigurationDialog::setShowSystemTrayIcon(bool showSystemTrayIcon)
setDirty();
}
-void ElisaConfigurationDialog::setForceUsageOfSlowFileSystemIndexing(bool forceUsageOfSlowFileSystemIndexing)
-{
- if (mForceUsageOfSlowFileSystemIndexing == forceUsageOfSlowFileSystemIndexing) {
- return;
- }
-
- mForceUsageOfSlowFileSystemIndexing = forceUsageOfSlowFileSystemIndexing;
- Q_EMIT forceUsageOfSlowFileSystemIndexingChanged();
-
- setDirty();
-}
-
void ElisaConfigurationDialog::setAlwaysUseAbsolutePlaylistPaths(bool alwaysUseAbsolutePlaylistPaths)
{
if (mAlwaysUseAbsolutePlaylistPaths == alwaysUseAbsolutePlaylistPaths) {
@@ -298,9 +285,6 @@ void ElisaConfigurationDialog::configChanged()
mUseFavoriteStyleRatings = Elisa::ElisaConfiguration::useFavoriteStyleRatings();
Q_EMIT useFavoriteStyleRatingsChanged();
- mForceUsageOfSlowFileSystemIndexing = !Elisa::ElisaConfiguration::forceUsageOfFastFileSearch();
- Q_EMIT forceUsageOfSlowFileSystemIndexingChanged();
-
mAlwaysUseAbsolutePlaylistPaths = Elisa::ElisaConfiguration::alwaysUseAbsolutePlaylistPaths();
Q_EMIT alwaysUseAbsolutePlaylistPathsChanged();
diff --git a/src/localFileConfiguration/elisaconfigurationdialog.h b/src/localFileConfiguration/elisaconfigurationdialog.h
index 9ebb54c3e..fdb6db858 100644
--- a/src/localFileConfiguration/elisaconfigurationdialog.h
+++ b/src/localFileConfiguration/elisaconfigurationdialog.h
@@ -24,11 +24,6 @@ class ELISALIB_EXPORT ElisaConfigurationDialog : public QObject
WRITE setRootPath
NOTIFY rootPathChanged)
- Q_PROPERTY(bool forceUsageOfSlowFileSystemIndexing
- READ forceUsageOfSlowFileSystemIndexing
- WRITE setForceUsageOfSlowFileSystemIndexing
- NOTIFY forceUsageOfSlowFileSystemIndexingChanged)
-
Q_PROPERTY(bool alwaysUseAbsolutePlaylistPaths
READ alwaysUseAbsolutePlaylistPaths
WRITE setAlwaysUseAbsolutePlaylistPaths
@@ -117,11 +112,6 @@ public:
return mShowSystemTrayIcon;
}
- [[nodiscard]] bool forceUsageOfSlowFileSystemIndexing() const
- {
- return mForceUsageOfSlowFileSystemIndexing;
- }
-
[[nodiscard]] bool alwaysUseAbsolutePlaylistPaths() const
{
return mAlwaysUseAbsolutePlaylistPaths;
@@ -177,8 +167,6 @@ Q_SIGNALS:
void showSystemTrayIconChanged();
- void forceUsageOfSlowFileSystemIndexingChanged();
-
void alwaysUseAbsolutePlaylistPathsChanged();
void embeddedViewChanged();
@@ -209,8 +197,6 @@ public Q_SLOTS:
void setShowSystemTrayIcon(bool showSystemTrayIcon);
- void setForceUsageOfSlowFileSystemIndexing(bool forceUsageOfSlowFileSystemIndexing);
-
void setAlwaysUseAbsolutePlaylistPaths(bool alwaysUseAbsolutePlaylistPaths);
void setEmbeddedView(ElisaUtils::PlayListEntryType embeddedView);
@@ -247,8 +233,6 @@ private:
bool mShowSystemTrayIcon = false;
- bool mForceUsageOfSlowFileSystemIndexing = true;
-
bool mAlwaysUseAbsolutePlaylistPaths = false;
bool mPlayAtStartup = false;
diff --git a/src/musiclistenersmanager.cpp b/src/musiclistenersmanager.cpp
index 409c8ddd7..4cd302a6c 100644
--- a/src/musiclistenersmanager.cpp
+++ b/src/musiclistenersmanager.cpp
@@ -14,11 +14,6 @@
#include "upnp/upnplistener.h"
#endif
-#if KFBaloo_FOUND
-#include "baloo/baloolistener.h"
-#include "baloo/baloodetector.h"
-#endif
-
#if QtAndroidExtras_FOUND
#include "android/androidmusiclistener.h"
#endif
@@ -54,12 +49,6 @@ public:
UpnpListener mUpnpListener;
#endif
-#if KFBaloo_FOUND
- BalooDetector mBalooDetector;
-
- BalooListener mBalooListener;
-#endif
-
FileListener mFileListener;
#if QtAndroidExtras_FOUND
@@ -82,10 +71,6 @@ public:
bool mFileSystemIndexerActive = false;
- bool mBalooIndexerActive = false;
-
- bool mBalooIndexerAvailable = false;
-
bool mAndroidIndexerActive = false;
bool mAndroidIndexerAvailable = false;
@@ -98,11 +83,6 @@ MusicListenersManager::MusicListenersManager(QObject *parent)
connect(&d->mDatabaseInterface, &DatabaseInterface::tracksAdded,
this, &MusicListenersManager::increaseImportedTracksCount);
-#if KFBaloo_FOUND
- connect(&d->mBalooDetector, &BalooDetector::balooAvailabilityChanged,
- this, &MusicListenersManager::balooAvailabilityChanged);
-#endif
-
connect(&d->mDatabaseInterface, &DatabaseInterface::requestsInitDone,
this, &MusicListenersManager::databaseReady);
@@ -138,8 +118,6 @@ MusicListenersManager::MusicListenersManager(QObject *parent)
Q_ARG(QString, QStringLiteral("listeners")), Q_ARG(QString, databaseFileName));
qCInfo(orgKdeElisaIndexersManager) << "Local file system indexer is inactive";
- qCInfo(orgKdeElisaIndexersManager) << "Baloo indexer is unavailable";
- qCInfo(orgKdeElisaIndexersManager) << "Baloo indexer is inactive";
}
MusicListenersManager::~MusicListenersManager()
@@ -192,16 +170,6 @@ bool MusicListenersManager::fileSystemIndexerActive() const
return d->mFileSystemIndexerActive;
}
-bool MusicListenersManager::balooIndexerActive() const
-{
- return d->mBalooIndexerActive;
-}
-
-bool MusicListenersManager::balooIndexerAvailable() const
-{
- return d->mBalooIndexerAvailable;
-}
-
bool MusicListenersManager::androidIndexerActive() const
{
return d->mAndroidIndexerActive;
@@ -325,13 +293,6 @@ void MusicListenersManager::configChanged()
currentConfiguration->read();
bool configurationHasChanged = false;
-#if KFBaloo_FOUND
- if (d->mBalooIndexerAvailable && d->mBalooIndexerActive && d->mBalooListener.canHandleRootPaths() && !currentConfiguration->forceUsageOfFastFileSearch()) {
- configurationHasChanged = true;
- } else if (d->mBalooIndexerAvailable && !d->mBalooIndexerActive && d->mBalooListener.canHandleRootPaths() && currentConfiguration->forceUsageOfFastFileSearch()) {
- configurationHasChanged = true;
- }
-#endif
auto inputRootPath = currentConfiguration->rootPath();
configurationHasChanged = configurationHasChanged || (d->mPreviousRootPathValue != inputRootPath);
@@ -369,37 +330,11 @@ void MusicListenersManager::configChanged()
d->mFileListener.setAllRootPaths(allRootPaths);
-#if KFBaloo_FOUND
- d->mBalooListener.setAllRootPaths(allRootPaths);
-#endif
-
- if (!d->mBalooIndexerActive && !d->mFileSystemIndexerActive) {
- testBalooIndexerAvailability();
- }
-
-#if KFBaloo_FOUND
- if (d->mBalooIndexerAvailable && !d->mBalooIndexerActive && d->mBalooListener.canHandleRootPaths() && currentConfiguration->forceUsageOfFastFileSearch()) {
- qCDebug(orgKdeElisaIndexersManager()) << "trigger start of baloo file indexer";
- QMetaObject::invokeMethod(d->mFileListener.fileListing(), "stop", Qt::BlockingQueuedConnection);
- d->mFileSystemIndexerActive = false;
- startBalooIndexing();
- } else if ((!d->mFileSystemIndexerActive && d->mBalooIndexerActive && !d->mBalooListener.canHandleRootPaths()) ||
- !currentConfiguration->forceUsageOfFastFileSearch()) {
- if (d->mBalooIndexerActive) {
- qCDebug(orgKdeElisaIndexersManager()) << "trigger stop of baloo file indexer";
- QMetaObject::invokeMethod(d->mBalooListener.fileListing(), "stop", Qt::BlockingQueuedConnection);
- }
- d->mBalooIndexerActive = false;
- startLocalFileSystemIndexing();
- }
-#endif
+ // trigger start of indexers if needed
+ startLocalFileSystemIndexing();
+ startAndroidIndexing();
- if (d->mBalooIndexerActive) {
- qCInfo(orgKdeElisaIndexersManager()) << "trigger init of baloo file indexer";
-#if KFBaloo_FOUND
- QMetaObject::invokeMethod(d->mBalooListener.fileListing(), "init", Qt::QueuedConnection);
-#endif
- } else if (d->mFileSystemIndexerActive) {
+ if (d->mFileSystemIndexerActive) {
qCInfo(orgKdeElisaIndexersManager()) << "trigger init of local file indexer";
QMetaObject::invokeMethod(d->mFileListener.fileListing(), "init", Qt::QueuedConnection);
} else if (d->mAndroidIndexerActive) {
@@ -450,59 +385,6 @@ void MusicListenersManager::cleanedDatabase()
Q_EMIT clearedDatabase();
}
-void MusicListenersManager::balooAvailabilityChanged()
-{
-#if KFBaloo_FOUND
- if (!d->mBalooDetector.balooAvailability() || !d->mBalooListener.canHandleRootPaths()) {
- if (d->mBalooDetector.balooAvailability()) {
- qCInfo(orgKdeElisaIndexersManager) << "Baloo indexer is available";
- d->mBalooIndexerAvailable = true;
- }
-#else
- if (true) {
-#endif
-
-#if KFBaloo_FOUND
- if (!d->mBalooListener.canHandleRootPaths() && d->mBalooDetector.balooAvailability())
- {
- qCInfo(orgKdeElisaIndexersManager()) << "Baloo cannot handle all configured paths: falling back to plain filex indexer";
- }
-#endif
-
- if (!d->mFileSystemIndexerActive) {
- startLocalFileSystemIndexing();
- }
- if (!d->mAndroidIndexerActive) {
- startAndroidIndexing();
- }
-
- return;
- }
-
- qCInfo(orgKdeElisaIndexersManager) << "Baloo indexer is available";
- d->mBalooIndexerAvailable = true;
- Q_EMIT balooIndexerAvailableChanged();
- startBalooIndexing();
-}
-
-void MusicListenersManager::testBalooIndexerAvailability()
-{
-#if KFBaloo_FOUND
- d->mBalooDetector.checkBalooAvailability();
-#else
- qCInfo(orgKdeElisaIndexersManager) << "Baloo indexer is unavailable";
- d->mBalooIndexerAvailable = false;
- Q_EMIT balooIndexerAvailableChanged();
-
- qCInfo(orgKdeElisaIndexersManager) << "Baloo indexer is inactive";
- d->mBalooIndexerActive = false;
- Q_EMIT balooIndexerActiveChanged();
-
- startLocalFileSystemIndexing();
- startAndroidIndexing();
-#endif
-}
-
void MusicListenersManager::startLocalFileSystemIndexing()
{
if (d->mFileSystemIndexerActive) {
@@ -548,27 +430,6 @@ void MusicListenersManager::startAndroidIndexing()
#endif
}
-void MusicListenersManager::startBalooIndexing()
-{
-#if KFBaloo_FOUND
- d->mBalooListener.moveToThread(&d->mListenerThread);
- d->mBalooListener.setDatabaseInterface(&d->mDatabaseInterface);
- connect(this, &MusicListenersManager::applicationIsTerminating,
- &d->mBalooListener, &BalooListener::applicationAboutToQuit, Qt::DirectConnection);
- connect(&d->mBalooListener, &BalooListener::indexingStarted,
- this, &MusicListenersManager::monitorStartingListeners);
- connect(&d->mBalooListener, &BalooListener::indexingFinished,
- this, &MusicListenersManager::monitorEndingListeners);
- connect(&d->mBalooListener, &BalooListener::clearDatabase,
- &d->mDatabaseInterface, &DatabaseInterface::clearData);
-
- qCInfo(orgKdeElisaIndexersManager) << "Baloo indexer is active";
-
- d->mBalooIndexerActive = true;
- Q_EMIT balooIndexerActiveChanged();
-#endif
-}
-
void MusicListenersManager::createTracksListener()
{
if (!d->mTracksListener) {
diff --git a/src/musiclistenersmanager.h b/src/musiclistenersmanager.h
index bde058908..44f755dfc 100644
--- a/src/musiclistenersmanager.h
+++ b/src/musiclistenersmanager.h
@@ -54,14 +54,6 @@ class ELISALIB_EXPORT MusicListenersManager : public QObject
READ fileSystemIndexerActive
NOTIFY fileSystemIndexerActiveChanged)
- Q_PROPERTY(bool balooIndexerActive
- READ balooIndexerActive
- NOTIFY balooIndexerActiveChanged)
-
- Q_PROPERTY(bool balooIndexerAvailable
- READ balooIndexerAvailable
- NOTIFY balooIndexerAvailableChanged)
-
Q_PROPERTY(bool androidIndexerActive
READ androidIndexerActive
NOTIFY androidIndexerActiveChanged)
@@ -96,10 +88,6 @@ public:
[[nodiscard]] bool fileSystemIndexerActive() const;
- [[nodiscard]] bool balooIndexerActive() const;
-
- [[nodiscard]] bool balooIndexerAvailable() const;
-
[[nodiscard]] bool androidIndexerActive() const;
[[nodiscard]] bool androidIndexerAvailable() const;
@@ -128,10 +116,6 @@ Q_SIGNALS:
void fileSystemIndexerActiveChanged();
- void balooIndexerActiveChanged();
-
- void balooIndexerAvailableChanged();
-
void androidIndexerActiveChanged();
void androidIndexerAvailableChanged();
@@ -170,18 +154,12 @@ private Q_SLOTS:
void cleanedDatabase();
- void balooAvailabilityChanged();
-
private:
- void testBalooIndexerAvailability();
-
void startLocalFileSystemIndexing();
void startAndroidIndexing();
- void startBalooIndexing();
-
auto initializeRootPath();
std::unique_ptr<MusicListenersManagerPrivate> d;
diff --git a/src/plugins.qmltypes b/src/plugins.qmltypes
index 99f4e9d24..a0d762fa5 100644
--- a/src/plugins.qmltypes
+++ b/src/plugins.qmltypes
@@ -1323,8 +1323,6 @@ Module {
Property { name: "tracksListener"; type: "TracksListener"; isReadonly: true; isPointer: true }
Property { name: "indexerBusy"; type: "bool"; isReadonly: true }
Property { name: "fileSystemIndexerActive"; type: "bool"; isReadonly: true }
- Property { name: "balooIndexerActive"; type: "bool"; isReadonly: true }
- Property { name: "balooIndexerAvailable"; type: "bool"; isReadonly: true }
Property { name: "androidIndexerActive"; type: "bool"; isReadonly: true }
Property { name: "androidIndexerAvailable"; type: "bool"; isReadonly: true }
Signal { name: "applicationIsTerminating" }
diff --git a/src/qml/SettingsForm.qml b/src/qml/SettingsForm.qml
index aaebf549a..fd9f2e6b8 100644
--- a/src/qml/SettingsForm.qml
+++ b/src/qml/SettingsForm.qml
@@ -343,40 +343,6 @@ ColumnLayout {
Kirigami.FormData.isSection: true
}
- // Indexing settings
- // =================
- QQC2.ComboBox {
- id: indexingTypeCombo
- Kirigami.FormData.label: i18nc("@label:listbox", "Music indexing:")
-
- editable: false
-
- model: [i18nc("@item:inlistbox Configure dialog, indexing type", "Use fast native indexer"),
- i18nc("@item:inlistbox Configure dialog, indexing type", "Scan the filesystem directly")]
-
- currentIndex: ElisaConfigurationDialog.forceUsageOfSlowFileSystemIndexing ? 1 : 0
- onActivated: {
- ElisaConfigurationDialog.forceUsageOfSlowFileSystemIndexing = currentIndex === 0 ? false : true
- }
- }
-
- Kirigami.InlineMessage {
- Layout.fillWidth: true
-
- visible: indexingTypeCombo.currentIndex === 1
-
- type: Kirigami.MessageType.Warning
- text: i18nc("@info", "This is slower than the fast indexer. Please activate it only if Elisa cannot find your music and searching for one of the missing music files using your file manager also does not work. Please report this as a bug.")
-
- actions: [
- Kirigami.Action {
- text: i18nc("@action:button", "Report Bug")
- icon.name: "tools-report-bug"
- onTriggered: Qt.openUrlExternally("https://bugs.kde.org/enter_bug.cgi?product=frameworks-baloo")
- }
- ]
- }
-
Item {
Kirigami.FormData.isSection: true
}
@@ -499,14 +465,6 @@ ColumnLayout {
}
}
}
-
- QQC2.Label {
- Layout.fillWidth: true
- visible: indexingTypeCombo.currentIndex === 0 // Native indexer
- text: i18nc("@label", "The fast native file indexer does not follow symbolic links. If any of the locations in this list contain symbolic links to other locations, you will need to add those other locations to the list as well.")
- wrapMode: Text.Wrap
- font: Kirigami.Theme.smallFont
- }
}
}
}
More information about the kde-doc-english
mailing list