diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,6 @@ find_package(KF5 5.5 REQUIRED COMPONENTS I18n Declarative Config DBusAddons KIO) find_package(Exiv2 0.21 REQUIRED) -find_package(KF5Baloo) - include(FeatureSummary) include(ECMAddTests) include(KDEInstallDirs) diff --git a/qml/BalooDisabled.qml b/qml/BalooDisabled.qml deleted file mode 100644 --- a/qml/BalooDisabled.qml +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2014-2015 Vishesh Handa - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -import QtQuick 2.1 -import QtQuick.Layouts 1.0 -import QtQuick.Controls 1.1 as QtControls - -Item { - signal finished() - - ColumnLayout { - anchors.centerIn: parent - - Heading { - text: "Koko" - font.bold: true - font.pointSize: 100 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - } - Heading { - text: "By KDE" - Layout.alignment: Qt.AlignRight | Qt.AlignVCenter - level: 3 - } - - - QtControls.Label { - text: "Plasma File Search (Baloo) is currently disabled." - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - } - QtControls.Label { - text: "Please enable Baloo and restart Koko." - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - } - } -} diff --git a/qml/main.qml b/qml/main.qml --- a/qml/main.qml +++ b/qml/main.qml @@ -335,27 +335,9 @@ } } - Component { - id: balooDisabled - BalooDisabled { - Layout.fillWidth: true - Layout.fillHeight: true - } - } - Component.onCompleted: { if (kokoConfig) { - if (kokoConfig.balooEnabled == false) { - push({ - item: balooDisabled, - immediate: true, - replace: true - }) - leftSidebar.visible = false - toolBar.visible = false - return; - } - else if (kokoConfig.initialRun) { + if (kokoConfig.initialRun) { push({ item: firstRun, immediate: true, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,31 +3,17 @@ # set(LIB_SRCS imagestorage.cpp + filesystemimagefetcher.cpp + ${LIB_SRCS} ) -if (KF5Baloo_FOUND) - set(LIB_SRCS - balooimagefetcher.cpp - ${LIB_SRCS} - ) -else() - set(LIB_SRCS - filesystemimagefetcher.cpp - ${LIB_SRCS} - ) -endif() - add_library(kokocommon SHARED ${LIB_SRCS}) target_link_libraries(kokocommon Qt5::Core Qt5::Positioning Qt5::Sql ) -if (KF5Baloo_FOUND) - target_link_libraries(kokocommon KF5::Baloo) -endif() - generate_export_header(kokocommon BASE_NAME KOKO EXPORT_FILE_NAME koko_export.h) install(TARGETS kokocommon EXPORT KokoLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) @@ -47,10 +33,6 @@ kdtree.c ) -if (KF5Baloo_FOUND) - target_compile_definitions(koko PRIVATE -DBALOO_FOUND="${KF5Baloo_FOUND}") -endif() - target_link_libraries(koko Qt5::Quick Qt5::Widgets diff --git a/src/balooimagefetcher.h b/src/balooimagefetcher.h deleted file mode 100644 --- a/src/balooimagefetcher.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Copyright (C) 2014 Vishesh Handa - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef BALOOIMAGEFETCHER_H -#define BALOOIMAGEFETCHER_H - -#include -#include - -#include "koko_export.h" - -class KOKO_EXPORT BalooImageFetcher : public QObject -{ - Q_OBJECT -public: - explicit BalooImageFetcher(const QString& folder, QObject* parent = 0); - void fetch(); - -signals: - void imageResult(const QString& filePath); - void finished(); - -private slots: - void queryResult(Baloo::QueryRunnable*, const QString& filePath); - -private: - QString m_folder; -}; - -#endif // BALOOIMAGEFETCHER_H diff --git a/src/balooimagefetcher.cpp b/src/balooimagefetcher.cpp deleted file mode 100644 --- a/src/balooimagefetcher.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Copyright (C) 2014 Vishesh Handa - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "balooimagefetcher.h" - -#include - -#include - -BalooImageFetcher::BalooImageFetcher(const QString& folder, QObject* parent) - : QObject(parent) - , m_folder(folder) -{ -} - -void BalooImageFetcher::fetch() -{ - Baloo::Query query; - query.setType("Image"); - query.setIncludeFolder(m_folder); - - Baloo::QueryRunnable *runnable = new Baloo::QueryRunnable(query); - connect(runnable, SIGNAL(queryResult(Baloo::QueryRunnable*, QString)), - this, SLOT(queryResult(Baloo::QueryRunnable*, QString)), Qt::QueuedConnection); - connect(runnable, SIGNAL(finished(Baloo::QueryRunnable*)), - this, SIGNAL(finished())); - - QThreadPool::globalInstance()->start(runnable); -} - -void BalooImageFetcher::queryResult(Baloo::QueryRunnable*, const QString& filePath) -{ - emit imageResult(filePath); -} diff --git a/src/filesystemtracker.cpp b/src/filesystemtracker.cpp --- a/src/filesystemtracker.cpp +++ b/src/filesystemtracker.cpp @@ -19,11 +19,7 @@ #include "filesystemtracker.h" -#ifdef BALOO_FOUND - #include "balooimagefetcher.h" -#else - #include "filesystemimagefetcher.h" -#endif +#include "filesystemimagefetcher.h" #include #include @@ -96,23 +92,13 @@ void FileSystemTracker::init() { -#ifdef BALOO_FOUND - BalooImageFetcher* fetcher = new BalooImageFetcher(m_folder); - connect(fetcher, &BalooImageFetcher::imageResult, - this, &FileSystemTracker::slotImageResult, Qt::QueuedConnection); - connect(fetcher, &BalooImageFetcher::finished, - this, &FileSystemTracker::slotFetchFinished, Qt::QueuedConnection); - - fetcher->fetch(); -#else FileSystemImageFetcher* fetcher = new FileSystemImageFetcher(m_folder); connect(fetcher, &FileSystemImageFetcher::imageResult, this, &FileSystemTracker::slotImageResult, Qt::QueuedConnection); connect(fetcher, &FileSystemImageFetcher::finished, this, &FileSystemTracker::slotFetchFinished, Qt::QueuedConnection); fetcher->fetch(); -#endif QSqlDatabase::database("fstracker").transaction(); } diff --git a/src/kokoconfig.h b/src/kokoconfig.h --- a/src/kokoconfig.h +++ b/src/kokoconfig.h @@ -28,15 +28,13 @@ { Q_OBJECT Q_PROPERTY(bool initialRun READ initialRun WRITE setInitialRun) - Q_PROPERTY(bool balooEnabled READ balooEnabled) public: KokoConfig(QObject* parent = 0); virtual ~KokoConfig(); bool initialRun() const; void setInitialRun(bool value); - bool balooEnabled() const; void reset(); private: KConfig m_config; diff --git a/src/kokoconfig.cpp b/src/kokoconfig.cpp --- a/src/kokoconfig.cpp +++ b/src/kokoconfig.cpp @@ -22,10 +22,6 @@ #include #include -#ifdef BALOO_FOUND - #include -#endif - KokoConfig::KokoConfig(QObject* parent) : QObject(parent) , m_config("kokorc") @@ -56,13 +52,3 @@ m_config.reparseConfiguration(); } - -bool KokoConfig::balooEnabled() const -{ -#ifdef BALOO_FOUND - Baloo::IndexerConfig config; - return config.fileIndexingEnabled(); -#endif - return true; -} -