summaryrefslogtreecommitdiff
authoralwin <alwin>2004-02-22 19:55:11 (UTC)
committer alwin <alwin>2004-02-22 19:55:11 (UTC)
commit5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb (patch) (side-by-side diff)
treebf44986448a8987633e3f92a7a627e69c67f1037
parent8705083d6a267450c71b0276833db5c7238f260e (diff)
downloadopie-5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb.zip
opie-5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb.tar.gz
opie-5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb.tar.bz2
flag for setting search the whole media not such subdirs
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
@@ -121,17 +121,21 @@ void MediumMountWidget::initGUI()
m_del->setText(tr("Remove"));
connect(m_add, SIGNAL(clicked() ),
this, SLOT(slotAdd() ) );
connect(m_del, SIGNAL(clicked() ),
this, SLOT(slotRemove() ) );
m_box->addWidget(m_hboxAdd );
-
+ m_scan_all_check = new QCheckBox( tr("Scan whole media"), this );
+ connect(m_scan_all_check,SIGNAL(stateChanged(int)),this,SLOT(slotScanAllChanged(int)));
+
+ m_box->addWidget(m_scan_all_check);
+
m_always = new QCheckBox( tr("Always check this medium"), this );
m_box->addWidget( m_always );
QSpacerItem *item = new QSpacerItem(5, 50,
QSizePolicy::Fixed,
QSizePolicy::Expanding );
m_box->addItem(item );
@@ -164,16 +168,17 @@ void MediumMountWidget::readConfig( )
m_image->setChecked( m_config->readBoolEntry("image", true ) );
m_text->setChecked ( m_config->readBoolEntry("text" , true ) );
m_video->setChecked( m_config->readBoolEntry("video", true ) );
};
m_config->setGroup("subdirs");
QStringList entries = m_config->readListEntry("subdirs",':');
m_subList->clear();
m_subList->insertStringList(entries);
+ m_scan_all_check->setChecked(m_config->readBoolEntry("wholemedia",true));
}
void MediumMountWidget::writeConfig()
{
m_config->setGroup("main");
m_config->writeEntry("check", m_always->isChecked() );
m_config->setGroup("mimetypes" );
@@ -187,23 +192,27 @@ void MediumMountWidget::writeConfig()
}
m_config->setGroup("subdirs");
QStringList entries;
QString ctext;
for (int i = 0; i < m_subList->count();++i) {
ctext = m_subList->text(i);
if (ctext.isEmpty())
continue;
- if (ctext.startsWith("/")&&ctext.length()>1) {
+ if (ctext.startsWith("/")) {
ctext = ctext.right(ctext.length()-1);
}
- entries.append(ctext);
+ if (!ctext.isEmpty()) {
+ entries.append(ctext);
+ }
}
m_config->writeEntry("subdirs",entries,':');
+ m_config->writeEntry("wholemedia",m_scan_all_check->isChecked());
}
+
MediumMountWidget::~MediumMountWidget()
{
delete m_config;
}
void MediumMountWidget::slotAdd()
{
if (m_subList->currentText()==m_subList->text(m_subList->currentItem()))
@@ -226,8 +235,16 @@ void MediumMountWidget::slotStateChanged()
bool state = !(m_all->isChecked());
m_audio->setEnabled( state );
m_text->setEnabled ( state );
m_video->setEnabled( state );
m_image->setEnabled( state );
}
+
+void MediumMountWidget::slotScanAllChanged(int)
+{
+ bool state = !(m_scan_all_check->isChecked());
+ m_add->setEnabled(state);
+ m_del->setEnabled(state);
+ m_subList->setEnabled(state);
+}
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
@@ -30,16 +30,17 @@ namespace MediumMountSetting {
void writeConfig();
private slots:
void slotAdd();
void slotRemove();
void slotStateChanged();
+ void slotScanAllChanged(int);
private:
void readConfig();
void initGUI();
bool m_dirty : 1;
class MediumMountWidgetPrivate;
@@ -62,16 +63,17 @@ namespace MediumMountSetting {
QGroupBox *m_group;
QCheckBox *m_all;
QCheckBox *m_audio;
QCheckBox *m_image;
QCheckBox *m_text;
QCheckBox *m_video;
+ QCheckBox *m_scan_all_check;
QCheckBox *m_always;
//QCheckBox *m_yesNo;
QHBox *m_hboxAdd;
QLabel *m_lblPath;
////////////////