Changeset View
Changeset View
Standalone View
Standalone View
kcms/baloo/kcm.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 58 | { | |||
---|---|---|---|---|---|
68 | setupUi(this); | 68 | setupUi(this); | ||
69 | 69 | | |||
70 | connect(m_excludeFolders_FSW, SIGNAL(changed()), | 70 | connect(m_excludeFolders_FSW, SIGNAL(changed()), | ||
71 | this, SLOT(changed())); | 71 | this, SLOT(changed())); | ||
72 | connect(m_excludeFolders_FSW, &FolderSelectionWidget::changed, | 72 | connect(m_excludeFolders_FSW, &FolderSelectionWidget::changed, | ||
73 | this, &ServerConfigModule::onDirectoryListChanged); | 73 | this, &ServerConfigModule::onDirectoryListChanged); | ||
74 | connect(m_enableCheckbox, SIGNAL(stateChanged(int)), | 74 | connect(m_enableCheckbox, SIGNAL(stateChanged(int)), | ||
75 | this, SLOT(changed())); | 75 | this, SLOT(changed())); | ||
76 | connect(m_enableCheckbox, SIGNAL(stateChanged(int)), | ||||
77 | this, SLOT(indexingEnabledChanged())); | ||||
76 | } | 78 | } | ||
77 | 79 | | |||
78 | 80 | | |||
79 | ServerConfigModule::~ServerConfigModule() | 81 | ServerConfigModule::~ServerConfigModule() | ||
80 | { | 82 | { | ||
81 | } | 83 | } | ||
82 | 84 | | |||
83 | 85 | | |||
84 | void ServerConfigModule::load() | 86 | void ServerConfigModule::load() | ||
85 | { | 87 | { | ||
86 | Baloo::IndexerConfig config; | 88 | Baloo::IndexerConfig config; | ||
87 | 89 | | |||
88 | m_previouslyEnabled = config.fileIndexingEnabled(); | 90 | m_previouslyEnabled = config.fileIndexingEnabled(); | ||
89 | m_enableCheckbox->setChecked(m_previouslyEnabled); | 91 | m_enableCheckbox->setChecked(m_previouslyEnabled); | ||
90 | 92 | | |||
93 | m_enableContentIndexing->setChecked(!config.onlyBasicIndexing()); | ||||
94 | m_enableContentIndexing->setEnabled(m_enableCheckbox->isChecked()); | ||||
95 | | ||||
91 | QStringList includeFolders = config.includeFolders(); | 96 | QStringList includeFolders = config.includeFolders(); | ||
92 | QStringList excludeFolders = config.excludeFolders(); | 97 | QStringList excludeFolders = config.excludeFolders(); | ||
93 | m_excludeFolders_FSW->setDirectoryList(includeFolders, excludeFolders); | 98 | m_excludeFolders_FSW->setDirectoryList(includeFolders, excludeFolders); | ||
94 | 99 | | |||
95 | // All values loaded -> no changes | 100 | // All values loaded -> no changes | ||
96 | Q_EMIT changed(false); | 101 | Q_EMIT changed(false); | ||
97 | } | 102 | } | ||
98 | 103 | | |||
99 | 104 | | |||
100 | void ServerConfigModule::save() | 105 | void ServerConfigModule::save() | ||
101 | { | 106 | { | ||
102 | QStringList includeFolders = m_excludeFolders_FSW->includeFolders(); | 107 | QStringList includeFolders = m_excludeFolders_FSW->includeFolders(); | ||
103 | QStringList excludeFolders = m_excludeFolders_FSW->excludeFolders(); | 108 | QStringList excludeFolders = m_excludeFolders_FSW->excludeFolders(); | ||
104 | 109 | | |||
105 | bool mountPointsEx = allMountPointsExcluded(); | 110 | bool mountPointsEx = allMountPointsExcluded(); | ||
106 | 111 | | |||
107 | bool enabled = m_enableCheckbox->isChecked(); | 112 | bool enabled = m_enableCheckbox->isChecked(); | ||
108 | if (mountPointsEx) | 113 | if (mountPointsEx) | ||
109 | enabled = false; | 114 | enabled = false; | ||
110 | 115 | | |||
111 | Baloo::IndexerConfig config; | 116 | Baloo::IndexerConfig config; | ||
112 | config.setFileIndexingEnabled(enabled); | 117 | config.setFileIndexingEnabled(enabled); | ||
113 | config.setIncludeFolders(includeFolders); | 118 | config.setIncludeFolders(includeFolders); | ||
114 | config.setExcludeFolders(excludeFolders); | 119 | config.setExcludeFolders(excludeFolders); | ||
120 | config.setOnlyBasicIndexing(!m_enableContentIndexing->isChecked()); | ||||
115 | 121 | | |||
116 | if (m_previouslyEnabled != enabled) { | 122 | if (m_previouslyEnabled != enabled) { | ||
117 | config.setFirstRun(true); | 123 | config.setFirstRun(true); | ||
118 | } | 124 | } | ||
119 | 125 | | |||
120 | // Start Baloo | 126 | // Start Baloo | ||
121 | if (enabled) { | 127 | if (enabled) { | ||
122 | const QString exe = QStandardPaths::findExecutable(QStringLiteral("baloo_file")); | 128 | const QString exe = QStandardPaths::findExecutable(QStringLiteral("baloo_file")); | ||
Show All 20 Lines | |||||
143 | } | 149 | } | ||
144 | 150 | | |||
145 | 151 | | |||
146 | void ServerConfigModule::defaults() | 152 | void ServerConfigModule::defaults() | ||
147 | { | 153 | { | ||
148 | m_excludeFolders_FSW->setDirectoryList(defaultFolders(), QStringList()); | 154 | m_excludeFolders_FSW->setDirectoryList(defaultFolders(), QStringList()); | ||
149 | } | 155 | } | ||
150 | 156 | | |||
157 | void ServerConfigModule::indexingEnabledChanged() | ||||
158 | { | ||||
159 | m_enableContentIndexing->setEnabled(m_enableCheckbox->isChecked()); | ||||
160 | } | ||||
161 | | ||||
151 | void ServerConfigModule::onDirectoryListChanged() | 162 | void ServerConfigModule::onDirectoryListChanged() | ||
152 | { | 163 | { | ||
153 | m_enableCheckbox->setChecked(!allMountPointsExcluded()); | 164 | m_enableCheckbox->setChecked(!allMountPointsExcluded()); | ||
154 | } | 165 | } | ||
155 | 166 | | |||
156 | bool ServerConfigModule::allMountPointsExcluded() | 167 | bool ServerConfigModule::allMountPointsExcluded() | ||
157 | { | 168 | { | ||
158 | QStringList mountPoints; | 169 | QStringList mountPoints; | ||
Show All 14 Lines |