summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/mediummount/mediumwidget.cc23
-rw-r--r--noncore/settings/mediummount/mediumwidget.h2
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
@@ -126,7 +126,11 @@ void MediumMountWidget::initGUI()
126 this, SLOT(slotRemove() ) ); 126 this, SLOT(slotRemove() ) );
127 127
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 );
131 135
132 m_box->addWidget( m_always ); 136 m_box->addWidget( m_always );
@@ -169,6 +173,7 @@ void MediumMountWidget::readConfig( )
169 QStringList entries = m_config->readListEntry("subdirs",':'); 173 QStringList entries = m_config->readListEntry("subdirs",':');
170 m_subList->clear(); 174 m_subList->clear();
171 m_subList->insertStringList(entries); 175 m_subList->insertStringList(entries);
176 m_scan_all_check->setChecked(m_config->readBoolEntry("wholemedia",true));
172} 177}
173 178
174void MediumMountWidget::writeConfig() 179void MediumMountWidget::writeConfig()
@@ -192,13 +197,17 @@ void MediumMountWidget::writeConfig()
192 ctext = m_subList->text(i); 197 ctext = m_subList->text(i);
193 if (ctext.isEmpty()) 198 if (ctext.isEmpty())
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
202MediumMountWidget::~MediumMountWidget() 211MediumMountWidget::~MediumMountWidget()
203{ 212{
204 delete m_config; 213 delete m_config;
@@ -231,3 +240,11 @@ void MediumMountWidget::slotStateChanged()
231 m_image->setEnabled( state ); 240 m_image->setEnabled( state );
232 241
233} 242}
243
244void 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
@@ -35,6 +35,7 @@ namespace MediumMountSetting {
35 void slotAdd(); 35 void slotAdd();
36 void slotRemove(); 36 void slotRemove();
37 void slotStateChanged(); 37 void slotStateChanged();
38 void slotScanAllChanged(int);
38 39
39 private: 40 private:
40 void readConfig(); 41 void readConfig();
@@ -67,6 +68,7 @@ namespace MediumMountSetting {
67 QCheckBox *m_text; 68 QCheckBox *m_text;
68 QCheckBox *m_video; 69 QCheckBox *m_video;
69 70
71 QCheckBox *m_scan_all_check;
70 QCheckBox *m_always; 72 QCheckBox *m_always;
71 //QCheckBox *m_yesNo; 73 //QCheckBox *m_yesNo;
72 74