Changeset View
Changeset View
Standalone View
Standalone View
kcms/baloo/kcm.h
1 | /* This file is part of the KDE Project | 1 | /* This file is part of the KDE Project | ||
---|---|---|---|---|---|
2 | Copyright (c) 2007 Sebastian Trueg <trueg@kde.org> | 2 | Copyright (c) 2007 Sebastian Trueg <trueg@kde.org> | ||
3 | Copyright (c) 2012-2014 Vishesh Handa <me@vhanda.in> | 3 | Copyright (c) 2012-2014 Vishesh Handa <me@vhanda.in> | ||
4 | Copyright (c) 2020 Benjamin Port <benjamin.port@enioka.com> | ||||
4 | 5 | | |||
5 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Library General Public | 7 | modify it under the terms of the GNU Library General Public | ||
7 | License version 2 as published by the Free Software Foundation. | 8 | License version 2 as published by the Free Software Foundation. | ||
8 | 9 | | |||
9 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | Library General Public License for more details. | 13 | Library General Public License for more details. | ||
13 | 14 | | |||
14 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to | ||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | Boston, MA 02110-1301, USA. | 18 | Boston, MA 02110-1301, USA. | ||
18 | */ | 19 | */ | ||
19 | 20 | | |||
20 | #ifndef _BALOO_FILE_KCM_H_ | 21 | #ifndef _BALOO_FILE_KCM_H_ | ||
21 | #define _BALOO_FILE_KCM_H_ | 22 | #define _BALOO_FILE_KCM_H_ | ||
22 | 23 | | |||
23 | #include <KQuickAddons/ConfigModule> | 24 | #include <KQuickAddons/ManagedConfigModule> | ||
24 | 25 | | |||
25 | #include "filteredfoldermodel.h" | 26 | #include "filteredfoldermodel.h" | ||
26 | 27 | | |||
28 | class BalooSettings; | ||||
29 | | ||||
27 | namespace Baloo | 30 | namespace Baloo | ||
28 | { | 31 | { | ||
29 | 32 | | |||
30 | class ServerConfigModule : public KQuickAddons::ConfigModule | 33 | class ServerConfigModule : public KQuickAddons::ManagedConfigModule | ||
31 | { | 34 | { | ||
32 | Q_OBJECT | 35 | Q_OBJECT | ||
33 | Q_PROPERTY(FilteredFolderModel *filteredModel READ filteredModel CONSTANT) | 36 | Q_PROPERTY(FilteredFolderModel *filteredModel READ filteredModel CONSTANT) | ||
34 | Q_PROPERTY(bool indexing READ indexing WRITE setIndexing NOTIFY indexingChanged) | 37 | Q_PROPERTY(BalooSettings *balooSettings READ balooSettings CONSTANT) | ||
35 | Q_PROPERTY(bool fileContents READ fileContents WRITE setFileContents NOTIFY fileContentsChanged) | | |||
36 | 38 | | |||
37 | public: | 39 | public: | ||
38 | ServerConfigModule(QObject* parent, const QVariantList& args); | 40 | ServerConfigModule(QObject* parent, const QVariantList& args); | ||
39 | virtual ~ServerConfigModule() override; | 41 | virtual ~ServerConfigModule() override; | ||
40 | 42 | | |||
41 | bool indexing() const; | 43 | BalooSettings *balooSettings() const; | ||
42 | void setIndexing(bool indexing); | | |||
43 | Q_SIGNAL void indexingChanged(bool indexing); | | |||
44 | | ||||
45 | bool fileContents() const; | | |||
46 | void setFileContents(bool fileContents); | | |||
47 | Q_SIGNAL void fileContentsChanged(bool fileContents); | | |||
48 | | ||||
49 | FilteredFolderModel *filteredModel() const; | 44 | FilteredFolderModel *filteredModel() const; | ||
50 | 45 | | |||
51 | public Q_SLOTS: | 46 | public Q_SLOTS: | ||
52 | void load() override; | 47 | void load() override; | ||
53 | void save() override; | 48 | void save() override; | ||
54 | void defaults() override; | | |||
55 | 49 | | |||
56 | private: | 50 | private: | ||
57 | /** | 51 | /** | ||
58 | * @brief Check if all mount points are in the excluded from indexing list. | 52 | * @brief Check if all mount points are in the excluded from indexing list. | ||
59 | * | 53 | * | ||
60 | * @return True if all mount points are excluded. False otherwise. | 54 | * @return True if all mount points are excluded. False otherwise. | ||
61 | */ | 55 | */ | ||
62 | bool allMountPointsExcluded(); | 56 | bool allMountPointsExcluded(); | ||
57 | | ||||
58 | BalooSettings *m_settings; | ||||
63 | FilteredFolderModel *m_filteredFolderModel; | 59 | FilteredFolderModel *m_filteredFolderModel; | ||
64 | bool m_previouslyEnabled; | 60 | bool m_previouslyEnabled; | ||
65 | bool m_indexing; | | |||
66 | bool m_fileContents; | | |||
67 | }; | 61 | }; | ||
68 | } | 62 | } | ||
69 | 63 | | |||
70 | #endif | 64 | #endif |