summaryrefslogtreecommitdiff
authorimm <imm>2002-09-01 14:34:26 (UTC)
committer imm <imm>2002-09-01 14:34:26 (UTC)
commit09c844dbf402d76f58b01397e850bd5c17c0535b (patch) (side-by-side diff)
treec3f518bb7fd9a241f4b139146d0d2c89b2140b71
parent90d1c76275ab950d96cda2a2f65dab1bbcc50a40 (diff)
downloadopie-09c844dbf402d76f58b01397e850bd5c17c0535b.zip
opie-09c844dbf402d76f58b01397e850bd5c17c0535b.tar.gz
opie-09c844dbf402d76f58b01397e850bd5c17c0535b.tar.bz2
config fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/comm/keypebble/krfboptions.cpp48
-rw-r--r--noncore/comm/keypebble/krfboptions.h4
-rw-r--r--noncore/comm/keypebble/kvnc.cpp1
-rw-r--r--noncore/comm/keypebble/kvncoptionsdlg.cpp1
-rw-r--r--noncore/comm/keypebble/main.cpp1
5 files changed, 29 insertions, 26 deletions
diff --git a/noncore/comm/keypebble/krfboptions.cpp b/noncore/comm/keypebble/krfboptions.cpp
index 9daf3f0..8c4320b 100644
--- a/noncore/comm/keypebble/krfboptions.cpp
+++ b/noncore/comm/keypebble/krfboptions.cpp
@@ -1,50 +1,54 @@
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
#include "krfboptions.h"
KRFBOptions::KRFBOptions()
{
- Config config( "keypebble" );
- readSettings( &config );
+ readSettings();
}
KRFBOptions::~KRFBOptions()
{
- Config config( "keypebble" );
- writeSettings( &config );
+ writeSettings();
}
-void KRFBOptions::readSettings( Config *config )
+void KRFBOptions::readSettings()
{
- hexTile = config->readBoolEntry( "HexTile" );
- corre = config->readBoolEntry( "CORRE" );
- rre = config->readBoolEntry( "RRE" );
- copyrect = config->readBoolEntry( "CopyRect", true );
- colors256 = config->readBoolEntry( "Colors256" );
- shared = config->readBoolEntry( "Shared" );
- readOnly = config->readBoolEntry( "ReadOnly" );
- updateRate = config->readNumEntry( "UpdateRate", 50 );
+ Config config( "keypebble" );
+ config.setGroup("Settings");
+ hexTile = config.readBoolEntry( "HexTile", 0 );
+ corre = config.readBoolEntry( "CORRE", 0 );
+ rre = config.readBoolEntry( "RRE", 0 );
+ copyrect = config.readBoolEntry( "CopyRect", 1 );
+ colors256 = config.readBoolEntry( "Colors256", 0 );
+ shared = config.readBoolEntry( "Shared", 0 );
+ readOnly = config.readBoolEntry( "ReadOnly", 0 );
+ updateRate = config.readNumEntry( "UpdateRate", 50 );
+ deIconify = config.readBoolEntry( "DeIconify", 0 );
}
-void KRFBOptions::writeSettings( Config *config )
+void KRFBOptions::writeSettings()
{
- config->writeEntry( "HexTile", hexTile );
- config->writeEntry( "CORRE", corre );
- config->writeEntry( "RRE", rre );
- config->writeEntry( "CopyRect", copyrect );
- config->writeEntry( "Colors256", colors256 );
- config->writeEntry( "Shared", shared );
- config->writeEntry( "ReadOnly", readOnly );
- config->writeEntry( "UpdateRate", updateRate );
+ Config config( "keypebble" );
+ config.setGroup("Settings");
+ config.writeEntry( "HexTile", hexTile );
+ config.writeEntry( "CORRE", corre );
+ config.writeEntry( "RRE", rre );
+ config.writeEntry( "CopyRect", copyrect );
+ config.writeEntry( "Colors256", colors256 );
+ config.writeEntry( "Shared", shared );
+ config.writeEntry( "ReadOnly", readOnly );
+ config.writeEntry( "UpdateRate", updateRate );
+ config.writeEntry( "DeIconify", deIconify );
}
int KRFBOptions::encodings()
{
// Initially one because we always support raw encoding
int count = 1;
count += hexTile ? 1 : 0;
count += corre ? 1 : 0;
count += rre ? 1 : 0;
count += copyrect ? 1 : 0;
diff --git a/noncore/comm/keypebble/krfboptions.h b/noncore/comm/keypebble/krfboptions.h
index 41cea35..fd2b65c 100644
--- a/noncore/comm/keypebble/krfboptions.h
+++ b/noncore/comm/keypebble/krfboptions.h
@@ -3,26 +3,26 @@
#ifndef KRFBOPTIONS_H
#define KRFBOPTIONS_H
class Config;
class KRFBOptions
{
public:
KRFBOptions();
~KRFBOptions();
int encodings();
- void readSettings( Config *config );
- void writeSettings( Config *config );
+ void readSettings();
+ void writeSettings();
bool hexTile;
bool corre;
bool rre;
bool copyrect;
bool colors256;
bool shared;
bool readOnly;
bool deIconify;
int updateRate;
diff --git a/noncore/comm/keypebble/kvnc.cpp b/noncore/comm/keypebble/kvnc.cpp
index bb18999..43cffc5 100644
--- a/noncore/comm/keypebble/kvnc.cpp
+++ b/noncore/comm/keypebble/kvnc.cpp
@@ -62,25 +62,24 @@ KVNC::KVNC( const char *name ) : QMainWindow( 0, name )
setupActions();
cornerButton = new QPushButton( this );
cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
connect( cornerButton, SIGNAL(pressed()), this, SLOT(showMenu()) );
canvas->setCornerWidget( cornerButton );
QTimer::singleShot( 0, canvas, SLOT(openConnection()) );
}
KVNC::~KVNC()
{
-
}
void KVNC::openURL( const QUrl &url )
{
canvas->openURL( url );
}
void KVNC::setupActions()
{
cornerMenu = new QPopupMenu( this );
fullScreenAction = new QAction( tr("Full Screen"), QString::null, 0, 0 );
diff --git a/noncore/comm/keypebble/kvncoptionsdlg.cpp b/noncore/comm/keypebble/kvncoptionsdlg.cpp
index b9f57d1..9d61c7b 100644
--- a/noncore/comm/keypebble/kvncoptionsdlg.cpp
+++ b/noncore/comm/keypebble/kvncoptionsdlg.cpp
@@ -38,16 +38,17 @@ KVNCOptionsDlg::~KVNCOptionsDlg()
}
void KVNCOptionsDlg::accept()
{
options->hexTile = hex->isChecked();
options->corre = corre->isChecked();
options->rre = rre->isChecked();
options->copyrect = copyRect->isChecked();
options->deIconify = deIconify->isChecked();
options->colors256 = bit->isChecked();
options->shared = shared->isChecked();
options->updateRate = timeBox->value();
+ options->writeSettings();
QDialog::accept();
}
diff --git a/noncore/comm/keypebble/main.cpp b/noncore/comm/keypebble/main.cpp
index a32a368..ee3cd79 100644
--- a/noncore/comm/keypebble/main.cpp
+++ b/noncore/comm/keypebble/main.cpp
@@ -6,13 +6,12 @@
int main( int argc, char **argv )
{
QPEApplication app( argc, argv );
KVNC *view = new KVNC( "Keypebble" );
app.showMainWidget( view );
if ( argc > 1 )
view->openURL( QUrl(argv[1]) );
return app.exec();
}
-