summaryrefslogtreecommitdiff
path: root/core/launcher/mediummountgui.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/mediummountgui.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/mediummountgui.cpp56
1 files changed, 29 insertions, 27 deletions
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp
index e0acf4e..8cc2411 100644
--- a/core/launcher/mediummountgui.cpp
+++ b/core/launcher/mediummountgui.cpp
@@ -11,22 +11,24 @@
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qpe/resource.h>
+#include <qpe/config.h>
+
#include <opie/oconfig.h>
#include <qapplication.h>
-MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const char* name, bool modal, WFlags fl )
+MediumMountGui::MediumMountGui( Config *cfg, const QString &path ,QWidget* parent, const char* name, bool , WFlags )
: QDialog( parent, name, true ) {
-
+ m_cfg = cfg;
QWidget *d = QApplication::desktop();
int w=d->width();
int h=d->height();
resize( w , h );
setCaption( tr( "Medium inserted" ) );
@@ -34,25 +36,25 @@ MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const cha
readConfig();
startGui();
}
void MediumMountGui::readConfig(){
- OConfig cfg (mediumPath +"/.opiestorage.cf");
- cfg.setGroup("main");
- checkagain = cfg.readBoolEntry("check", false);
+ //OConfig cfg (mediumPath +"/.opiestorage.cf");
+ m_cfg->setGroup("main");
+ checkagain = m_cfg->readBoolEntry("check", false);
- cfg.setGroup("mimetypes");
- checkmimeaudio = cfg.readBoolEntry("audio", true);
- checkmimeimage = cfg.readBoolEntry("image", true);
- checkmimetext = cfg.readBoolEntry("text", true);
- checkmimevideo = cfg.readBoolEntry("video", true);
- checkmimeall = cfg.readBoolEntry("all", true);
-
- cfg.setGroup("dirs");
- limittodirs = cfg.readEntry("dirs", "");
+ m_cfg->setGroup("mimetypes");
+ checkmimeaudio = m_cfg->readBoolEntry("audio", true);
+ checkmimeimage = m_cfg->readBoolEntry("image", true);
+ checkmimetext = m_cfg->readBoolEntry("text", true);
+ checkmimevideo = m_cfg->readBoolEntry("video", true);
+ checkmimeall = m_cfg->readBoolEntry("all", true);
+
+ m_cfg->setGroup("dirs");
+ limittodirs = m_cfg->readEntry("dirs", "");
}
bool MediumMountGui::check() {
return !checkagain;
}
@@ -60,27 +62,27 @@ QStringList MediumMountGui::dirs() {
QStringList list = QStringList::split(",", limittodirs );
return list;
}
void MediumMountGui::writeConfig(bool autocheck) {
- OConfig cfg (mediumPath +"/.opiestorage.cf");
- cfg.setGroup("main");
- cfg.writeEntry("check", AskBox->isChecked() );
- cfg.writeEntry("autocheck", autocheck );
+ //OConfig cfg (mediumPath +"/.opiestorage.cf");
+ m_cfg->setGroup("main");
+ m_cfg->writeEntry("check", AskBox->isChecked() );
+ m_cfg->writeEntry("autocheck", autocheck );
- cfg.setGroup("mimetypes");
+ m_cfg->setGroup("mimetypes");
- cfg.writeEntry("audio", CheckBoxAudio->isChecked() );
- cfg.writeEntry("image",CheckBoxImage->isChecked() );
- cfg.writeEntry("text",CheckBoxImage->isChecked() );
- cfg.writeEntry("video",CheckBoxVideo->isChecked() );
- cfg.writeEntry("all",CheckBoxAll->isChecked() );
+ m_cfg->writeEntry("audio", CheckBoxAudio->isChecked() );
+ m_cfg->writeEntry("image",CheckBoxImage->isChecked() );
+ m_cfg->writeEntry("text",CheckBoxImage->isChecked() );
+ m_cfg->writeEntry("video",CheckBoxVideo->isChecked() );
+ m_cfg->writeEntry("all",CheckBoxAll->isChecked() );
- cfg.setGroup("dirs");
- cfg.writeEntry("dirs", "");
+ m_cfg->setGroup("dirs");
+ m_cfg->writeEntry("dirs", "");
// if all is checked then add only "QString::null" to the list.
if (checkmimeall) {
mimeTypeList.clear();
mimeTypeList += QString::null;
@@ -95,13 +97,13 @@ void MediumMountGui::writeConfig(bool autocheck) {
mimeTypeList += ("video/*");
}
if (checkmimeimage) {
mimeTypeList += ("image/*");
}
}
- cfg.write(); // not really needed here but just to be sure
+ m_cfg->write(); // not really needed here but just to be sure
}
void MediumMountGui::startGui() {
QPixmap image = Resource::loadPixmap( "HelpBrowser");