-rw-r--r-- | noncore/settings/mediummount/mediumwidget.cc | 23 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.h | 2 |
2 files changed, 22 insertions, 3 deletions
diff --git a/noncore/settings/mediummount/mediumwidget.cc b/noncore/settings/mediummount/mediumwidget.cc index caa9559..f39a6ed 100644 --- a/noncore/settings/mediummount/mediumwidget.cc +++ b/noncore/settings/mediummount/mediumwidget.cc | |||
@@ -128,3 +128,7 @@ void MediumMountWidget::initGUI() | |||
128 | m_box->addWidget(m_hboxAdd ); | 128 | m_box->addWidget(m_hboxAdd ); |
129 | 129 | m_scan_all_check = new QCheckBox( tr("Scan whole media"), this ); | |
130 | connect(m_scan_all_check,SIGNAL(stateChanged(int)),this,SLOT(slotScanAllChanged(int))); | ||
131 | |||
132 | m_box->addWidget(m_scan_all_check); | ||
133 | |||
130 | m_always = new QCheckBox( tr("Always check this medium"), this ); | 134 | m_always = new QCheckBox( tr("Always check this medium"), this ); |
@@ -171,2 +175,3 @@ void MediumMountWidget::readConfig( ) | |||
171 | m_subList->insertStringList(entries); | 175 | m_subList->insertStringList(entries); |
176 | m_scan_all_check->setChecked(m_config->readBoolEntry("wholemedia",true)); | ||
172 | } | 177 | } |
@@ -194,9 +199,13 @@ void MediumMountWidget::writeConfig() | |||
194 | continue; | 199 | continue; |
195 | if (ctext.startsWith("/")&&ctext.length()>1) { | 200 | if (ctext.startsWith("/")) { |
196 | ctext = ctext.right(ctext.length()-1); | 201 | ctext = ctext.right(ctext.length()-1); |
197 | } | 202 | } |
198 | entries.append(ctext); | 203 | if (!ctext.isEmpty()) { |
204 | entries.append(ctext); | ||
205 | } | ||
199 | } | 206 | } |
200 | m_config->writeEntry("subdirs",entries,':'); | 207 | m_config->writeEntry("subdirs",entries,':'); |
208 | m_config->writeEntry("wholemedia",m_scan_all_check->isChecked()); | ||
201 | } | 209 | } |
210 | |||
202 | MediumMountWidget::~MediumMountWidget() | 211 | MediumMountWidget::~MediumMountWidget() |
@@ -233 +242,9 @@ void MediumMountWidget::slotStateChanged() | |||
233 | } | 242 | } |
243 | |||
244 | void MediumMountWidget::slotScanAllChanged(int) | ||
245 | { | ||
246 | bool state = !(m_scan_all_check->isChecked()); | ||
247 | m_add->setEnabled(state); | ||
248 | m_del->setEnabled(state); | ||
249 | m_subList->setEnabled(state); | ||
250 | } | ||
diff --git a/noncore/settings/mediummount/mediumwidget.h b/noncore/settings/mediummount/mediumwidget.h index 28ae369..ae5c5dc 100644 --- a/noncore/settings/mediummount/mediumwidget.h +++ b/noncore/settings/mediummount/mediumwidget.h | |||
@@ -37,2 +37,3 @@ namespace MediumMountSetting { | |||
37 | void slotStateChanged(); | 37 | void slotStateChanged(); |
38 | void slotScanAllChanged(int); | ||
38 | 39 | ||
@@ -69,2 +70,3 @@ namespace MediumMountSetting { | |||
69 | 70 | ||
71 | QCheckBox *m_scan_all_check; | ||
70 | QCheckBox *m_always; | 72 | QCheckBox *m_always; |