diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e8ef25d2..04c1309c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,179 +1,179 @@ project(plasma-desktop) set(PROJECT_VERSION "5.9.90") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) set(QT_MIN_VERSION "5.5.0") find_package(ECM 0.0.11 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(ECMInstallIcons) include(ECMMarkAsTest) include(ECMMarkNonGuiExecutable) include(ECMOptionalAddSubdirectory) include(ECMQtDeclareLoggingCategory) include(FeatureSummary) include(CheckIncludeFiles) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Quick QuickWidgets DBus Widgets X11Extras Svg Concurrent ) set(KF5_MIN_VERSION "5.24.0") find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Auth Plasma PlasmaQuick DocTools I18n KCMUtils NewStuff KDELibs4Support Notifications NotifyConfig Attica Wallet Runner GlobalAccel Declarative People DBusAddons Activities ActivitiesStats Config ) find_package(LibKWorkspace CONFIG REQUIRED) find_package(LibTaskManager CONFIG REQUIRED) find_package(KWinDBusInterface CONFIG REQUIRED) find_package(ScreenSaverDBusInterface CONFIG REQUIRED) find_package(KRunnerAppDBusInterface CONFIG REQUIRED) find_package(KSMServerDBusInterface CONFIG REQUIRED) find_package(KF5ItemModels CONFIG REQUIRED) find_package(KF5Emoticons CONFIG REQUIRED) find_package(AppStreamQt 0.10.4) set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Appstream integration" TYPE RECOMMENDED PURPOSE "Needed to allow appstream integration from application menus" ) -find_package(KF5Baloo) +find_package(KF5Baloo 5.15) set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "File Searching" TYPE RECOMMENDED PURPOSE "Needed to build the File Search KCM" ) find_package(Fontconfig) set_package_properties(Fontconfig PROPERTIES DESCRIPTION "Font access configuration library" URL "http://www.freedesktop.org/wiki/Software/fontconfig" TYPE OPTIONAL PURPOSE "Needed to build font configuration and installation tools" ) find_package(X11) set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries" URL "http://www.x.org" TYPE REQUIRED PURPOSE "Required for building the X11 based workspace" ) find_package(UDev) set_package_properties(UDev PROPERTIES DESCRIPTION "UDev library" URL "http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" TYPE OPTIONAL PURPOSE "Required for device discovery in keyboard daemon" ) find_package(XCB REQUIRED COMPONENTS XCB SHM IMAGE OPTIONAL_COMPONENTS XKB XINPUT ) set_package_properties(XCB PROPERTIES TYPE REQUIRED) add_feature_info("XCB-XKB" XCB_XKB_FOUND "Required for building kcm/keyboard") add_feature_info("libxft" X11_Xft_FOUND "X FreeType interface library required for font installation") find_package(Evdev) set_package_properties(Evdev PROPERTIES TYPE OPTIONAL) add_feature_info("Evdev" EVDEV_FOUND "Evdev driver headers needed for input KCM") find_package(Synaptics) set_package_properties(Synaptics PROPERTIES TYPE OPTIONAL) add_feature_info("Synaptics" SYNAPTICS_FOUND "Synaptics libraries needed for touchpad KCM") include(ConfigureChecks.cmake) if(${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL "GL") find_package(OpenGL) set_package_properties(OpenGL PROPERTIES DESCRIPTION "The OpenGL libraries" URL "http://www.opengl.org" TYPE REQUIRED ) else() find_package(OpenGLES) set_package_properties(OpenGLES PROPERTIES DESCRIPTION "The OpenGLES libraries" URL "http://www.khronos.org/opengles" TYPE REQUIRED ) endif() find_package(Breeze ${PROJECT_VERSION} CONFIG) set_package_properties(Breeze PROPERTIES TYPE OPTIONAL PURPOSE "For setting the default window decoration plugin") if(${Breeze_FOUND}) if(${BREEZE_WITH_KDECORATION}) set(HAVE_BREEZE_DECO true) else() set(HAVE_BREEZE_DECO FALSE) endif() else() set(HAVE_BREEZE_DECO FALSE) endif() if(${AppStreamQt_FOUND}) set(HAVE_APPSTREAMQT true) endif() include_directories("${CMAKE_CURRENT_BINARY_DIR}") configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h) configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h ) configure_file(config-appstream.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-appstream.h ) configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h) configure_file(config-runtime.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-runtime.h) plasma_install_package(desktoppackage org.kde.plasma.desktop shells shell) add_definitions(-DQT_NO_URL_CAST_FROM_STRING) add_subdirectory(layout-templates) add_subdirectory(doc) add_subdirectory(runners) add_subdirectory(containments) add_subdirectory(toolboxes) add_subdirectory(applets) add_subdirectory(dataengines) add_subdirectory(kcms) add_subdirectory(knetattach) add_subdirectory(attica-kde) add_subdirectory(imports/activitymanager/) add_subdirectory(solid-device-automounter) if(X11_Xkb_FOUND AND XCB_XKB_FOUND) add_subdirectory(kaccess) endif() install(FILES org.kde.plasmashell.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/kcms/baloo/configwidget.ui b/kcms/baloo/configwidget.ui index 63103f029..bd13169cc 100644 --- a/kcms/baloo/configwidget.ui +++ b/kcms/baloo/configwidget.ui @@ -1,82 +1,89 @@ Vishesh Handa ConfigWidget 0 0 669 671 0 0 File Search helps you quickly locate all your files based on their content true Enable File Search + + + + Also index file content + + + Do not search in these locations false Qt::Vertical 1 66 FolderSelectionWidget QWidget
folderselectionwidget.h
1
diff --git a/kcms/baloo/kcm.cpp b/kcms/baloo/kcm.cpp index 965749616..a192ad5a1 100644 --- a/kcms/baloo/kcm.cpp +++ b/kcms/baloo/kcm.cpp @@ -1,172 +1,183 @@ /* This file is part of the KDE Project Copyright (c) 2007-2010 Sebastian Trueg Copyright (c) 2012-2014 Vishesh Handa This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kcm.h" #include "fileexcludefilters.h" #include "folderselectionwidget.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include K_PLUGIN_FACTORY(BalooConfigModuleFactory, registerPlugin();) K_EXPORT_PLUGIN(BalooConfigModuleFactory("kcm_baloofile")) namespace { QStringList defaultFolders() { return QStringList() << QDir::homePath(); } } using namespace Baloo; ServerConfigModule::ServerConfigModule(QWidget* parent, const QVariantList& args) : KCModule(parent, args) { KAboutData* about = new KAboutData( QStringLiteral("kcm_baloofile"), i18n("Configure File Search"), QStringLiteral("0.1"), QString(), KAboutLicense::GPL, i18n("Copyright 2007-2010 Sebastian Trüg")); about->addAuthor(i18n("Sebastian Trüg"), QString(), QStringLiteral("trueg@kde.org")); about->addAuthor(i18n("Vishesh Handa"), QString(), QStringLiteral("vhanda@kde.org")); setAboutData(about); setButtons(Help | Apply | Default); setupUi(this); connect(m_excludeFolders_FSW, SIGNAL(changed()), this, SLOT(changed())); connect(m_excludeFolders_FSW, &FolderSelectionWidget::changed, this, &ServerConfigModule::onDirectoryListChanged); connect(m_enableCheckbox, SIGNAL(stateChanged(int)), this, SLOT(changed())); + connect(m_enableCheckbox, SIGNAL(stateChanged(int)), + this, SLOT(indexingEnabledChanged())); } ServerConfigModule::~ServerConfigModule() { } void ServerConfigModule::load() { Baloo::IndexerConfig config; m_previouslyEnabled = config.fileIndexingEnabled(); m_enableCheckbox->setChecked(m_previouslyEnabled); + m_enableContentIndexing->setChecked(!config.onlyBasicIndexing()); + m_enableContentIndexing->setEnabled(m_enableCheckbox->isChecked()); + QStringList includeFolders = config.includeFolders(); QStringList excludeFolders = config.excludeFolders(); m_excludeFolders_FSW->setDirectoryList(includeFolders, excludeFolders); // All values loaded -> no changes Q_EMIT changed(false); } void ServerConfigModule::save() { QStringList includeFolders = m_excludeFolders_FSW->includeFolders(); QStringList excludeFolders = m_excludeFolders_FSW->excludeFolders(); bool mountPointsEx = allMountPointsExcluded(); bool enabled = m_enableCheckbox->isChecked(); if (mountPointsEx) enabled = false; Baloo::IndexerConfig config; config.setFileIndexingEnabled(enabled); config.setIncludeFolders(includeFolders); config.setExcludeFolders(excludeFolders); + config.setOnlyBasicIndexing(!m_enableContentIndexing->isChecked()); if (m_previouslyEnabled != enabled) { config.setFirstRun(true); } // Start Baloo if (enabled) { const QString exe = QStandardPaths::findExecutable(QStringLiteral("baloo_file")); QProcess::startDetached(exe); } else { QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.baloo"), QStringLiteral("/"), QStringLiteral("org.kde.baloo.main"), QStringLiteral("quit")); QDBusConnection::sessionBus().asyncCall(message); } // Start cleaner const QString exe = QStandardPaths::findExecutable(QStringLiteral("baloo_file_cleaner")); QProcess::startDetached(exe); // Update the baloo_file's config cache config.refresh(); // all values saved -> no changes Q_EMIT changed(false); } void ServerConfigModule::defaults() { m_excludeFolders_FSW->setDirectoryList(defaultFolders(), QStringList()); } +void ServerConfigModule::indexingEnabledChanged() +{ + m_enableContentIndexing->setEnabled(m_enableCheckbox->isChecked()); +} + void ServerConfigModule::onDirectoryListChanged() { m_enableCheckbox->setChecked(!allMountPointsExcluded()); } bool ServerConfigModule::allMountPointsExcluded() { QStringList mountPoints; Q_FOREACH (const QStorageInfo &si, QStorageInfo::mountedVolumes()) { mountPoints << si.rootPath(); } const QStringList excluded = m_excludeFolders_FSW->excludeFolders(); if (excluded.toSet() == mountPoints.toSet()) { return true; } return false; } #include "kcm.moc" diff --git a/kcms/baloo/kcm.h b/kcms/baloo/kcm.h index 829610a66..f093d02ca 100644 --- a/kcms/baloo/kcm.h +++ b/kcms/baloo/kcm.h @@ -1,54 +1,55 @@ /* This file is part of the KDE Project Copyright (c) 2007 Sebastian Trueg Copyright (c) 2012-2014 Vishesh Handa This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _BALOO_FILE_KCM_H_ #define _BALOO_FILE_KCM_H_ #include #include "ui_configwidget.h" namespace Baloo { class ServerConfigModule : public KCModule, private Ui::ConfigWidget { Q_OBJECT public: ServerConfigModule(QWidget* parent, const QVariantList& args); ~ServerConfigModule(); public Q_SLOTS: void load(); void save(); void defaults(); + void indexingEnabledChanged(); void onDirectoryListChanged(); private: bool m_previouslyEnabled; /** * @brief Check if all mount points are in the excluded from indexing list. * * @return True if all mount points are excluded. False otherwise. */ bool allMountPointsExcluded(); }; } #endif