Diffstat (limited to 'noncore/applets/pcmcia/configdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/applets/pcmcia/configdialog.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/applets/pcmcia/configdialog.cpp b/noncore/applets/pcmcia/configdialog.cpp index f94edde..3b1b40c 100644 --- a/noncore/applets/pcmcia/configdialog.cpp +++ b/noncore/applets/pcmcia/configdialog.cpp | |||
@@ -38,33 +38,33 @@ using namespace Opie::Core; | |||
38 | /* QT */ | 38 | /* QT */ |
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qdir.h> | 40 | #include <qdir.h> |
41 | #include <qfile.h> | 41 | #include <qfile.h> |
42 | #include <qgroupbox.h> | 42 | #include <qgroupbox.h> |
43 | #include <qlabel.h> | 43 | #include <qlabel.h> |
44 | #include <qtextstream.h> | 44 | #include <qtextstream.h> |
45 | 45 | ||
46 | ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent ) | 46 | ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent ) |
47 | :ConfigDialogBase( parent, "pcmcia config dialog", true ) | 47 | :ConfigDialogBase( parent, "pcmcia config dialog", true ) |
48 | { | 48 | { |
49 | gbDetails->setTitle( QString( "Details for card in socket #%1" ).arg( card->number() ) ); | 49 | gbDetails->setTitle( QString( "Details for card in socket #%1" ).arg( card->number() ) ); |
50 | txtCardName->setText( card->productIdentity().join( " " ) ); | 50 | txtCardName->setText( card->productIdentity() ); |
51 | txtManfid->setText( card->manufacturerIdentity() ); | 51 | txtManfid->setText( card->manufacturerIdentity() ); |
52 | txtFunction->setText( card->function() ); | 52 | txtFunction->setText( card->function() ); |
53 | 53 | ||
54 | QString insertAction = preferredAction( card, "insert" ); | 54 | QString insertAction = preferredAction( card, "insert" ); |
55 | QString resumeAction = preferredAction( card, "resume" ); | 55 | QString resumeAction = preferredAction( card, "resume" ); |
56 | 56 | ||
57 | odebug << "pcmcia: preferred insertion action for card '" << card->name() << "' seems to be '" << insertAction << "'" << oendl; | 57 | odebug << "pcmcia: preferred insertion action for card '" << card->productIdentity() << "' seems to be '" << insertAction << "'" << oendl; |
58 | odebug << "pcmcia: preferred resume action for card '" << card->name() << "' seems to be '" << resumeAction << "'" << oendl; | 58 | odebug << "pcmcia: preferred resume action for card '" << card->productIdentity() << "' seems to be '" << resumeAction << "'" << oendl; |
59 | 59 | ||
60 | if ( !insertAction.isEmpty() ) | 60 | if ( !insertAction.isEmpty() ) |
61 | { | 61 | { |
62 | for ( int i; i < cbInsertAction->count(); ++i ) | 62 | for ( int i; i < cbInsertAction->count(); ++i ) |
63 | if ( cbInsertAction->text( i ) == insertAction ) cbInsertAction->setCurrentItem( i ); | 63 | if ( cbInsertAction->text( i ) == insertAction ) cbInsertAction->setCurrentItem( i ); |
64 | } | 64 | } |
65 | 65 | ||
66 | if ( !resumeAction.isEmpty() ) | 66 | if ( !resumeAction.isEmpty() ) |
67 | { | 67 | { |
68 | for ( int i; i < cbResumeAction->count(); ++i ) | 68 | for ( int i; i < cbResumeAction->count(); ++i ) |
69 | if ( cbResumeAction->text( i ) == resumeAction ) cbResumeAction->setCurrentItem( i ); | 69 | if ( cbResumeAction->text( i ) == resumeAction ) cbResumeAction->setCurrentItem( i ); |
70 | } | 70 | } |
@@ -123,47 +123,47 @@ ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent ) | |||
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | ConfigDialog::~ConfigDialog() | 126 | ConfigDialog::~ConfigDialog() |
127 | { | 127 | { |
128 | } | 128 | } |
129 | 129 | ||
130 | void ConfigDialog::writeConfigEntry( const OPcmciaSocket* card, const QString& key, const QString& value ) | 130 | void ConfigDialog::writeConfigEntry( const OPcmciaSocket* card, const QString& key, const QString& value ) |
131 | { | 131 | { |
132 | OConfig cfg( "PCMCIA" ); | 132 | OConfig cfg( "PCMCIA" ); |
133 | cfg.setGroup( "Global" ); | 133 | cfg.setGroup( "Global" ); |
134 | int nCards = cfg.readNumEntry( "nCards", 0 ); | 134 | int nCards = cfg.readNumEntry( "nCards", 0 ); |
135 | QString cardName = card->productIdentity().join( " " ).stripWhiteSpace(); | 135 | QString cardName = card->productIdentity(); |
136 | QString action; | 136 | QString action; |
137 | 137 | ||
138 | for ( int i = 0; i < nCards; ++i ) | 138 | for ( int i = 0; i < nCards; ++i ) |
139 | { | 139 | { |
140 | QString cardSection = QString( "Card_%1" ).arg( i ); | 140 | QString cardSection = QString( "Card_%1" ).arg( i ); |
141 | cfg.setGroup( cardSection ); | 141 | cfg.setGroup( cardSection ); |
142 | QString name = cfg.readEntry( "name" ); | 142 | QString name = cfg.readEntry( "name" ); |
143 | odebug << "comparing card '" << cardName << "' with known card '" << name << "'" << oendl; | 143 | odebug << "comparing card '" << cardName << "' with known card '" << name << "'" << oendl; |
144 | if ( cardName == name ) | 144 | if ( cardName == name ) |
145 | { | 145 | { |
146 | cfg.writeEntry( key, value ); | 146 | cfg.writeEntry( key, value ); |
147 | break; | 147 | break; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | } | 150 | } |
151 | 151 | ||
152 | QString ConfigDialog::readConfigEntry( const OPcmciaSocket* card, const QString& key, const QString& defaultValue ) | 152 | QString ConfigDialog::readConfigEntry( const OPcmciaSocket* card, const QString& key, const QString& defaultValue ) |
153 | { | 153 | { |
154 | OConfig cfg( "PCMCIA" ); | 154 | OConfig cfg( "PCMCIA" ); |
155 | cfg.setGroup( "Global" ); | 155 | cfg.setGroup( "Global" ); |
156 | int nCards = cfg.readNumEntry( "nCards", 0 ); | 156 | int nCards = cfg.readNumEntry( "nCards", 0 ); |
157 | QString cardName = card->productIdentity().join( " " ).stripWhiteSpace(); | 157 | QString cardName = card->productIdentity(); |
158 | QString value; | 158 | QString value; |
159 | 159 | ||
160 | for ( int i = 0; i < nCards; ++i ) | 160 | for ( int i = 0; i < nCards; ++i ) |
161 | { | 161 | { |
162 | QString cardSection = QString( "Card_%1" ).arg( i ); | 162 | QString cardSection = QString( "Card_%1" ).arg( i ); |
163 | cfg.setGroup( cardSection ); | 163 | cfg.setGroup( cardSection ); |
164 | QString name = cfg.readEntry( "name" ); | 164 | QString name = cfg.readEntry( "name" ); |
165 | odebug << "comparing card '" << cardName << "' with known card '" << name << "'" << oendl; | 165 | odebug << "comparing card '" << cardName << "' with known card '" << name << "'" << oendl; |
166 | if ( cardName == name ) | 166 | if ( cardName == name ) |
167 | { | 167 | { |
168 | value = cfg.readEntry( key, defaultValue ); | 168 | value = cfg.readEntry( key, defaultValue ); |
169 | break; | 169 | break; |