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, 6 insertions, 4 deletions
diff --git a/noncore/applets/pcmcia/configdialog.cpp b/noncore/applets/pcmcia/configdialog.cpp index f5812ba..f94edde 100644 --- a/noncore/applets/pcmcia/configdialog.cpp +++ b/noncore/applets/pcmcia/configdialog.cpp | |||
@@ -111,67 +111,69 @@ ConfigDialog::ConfigDialog( const OPcmciaSocket* card, QWidget* parent ) | |||
111 | } | 111 | } |
112 | else | 112 | else |
113 | { | 113 | { |
114 | owarn << "couldn't open '" << conffile.name() << "' for reading" << oendl; | 114 | owarn << "couldn't open '" << conffile.name() << "' for reading" << oendl; |
115 | continue; | 115 | continue; |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | for ( StringMap::Iterator it = bindEntries.begin(); it != bindEntries.end(); ++it ) | 119 | for ( StringMap::Iterator it = bindEntries.begin(); it != bindEntries.end(); ++it ) |
120 | { | 120 | { |
121 | odebug << "found binding '" << it.key() << "' defined in '" << it.data().latin1() << "'" << oendl; | 121 | odebug << "found binding '" << it.key() << "' defined in '" << it.data().latin1() << "'" << oendl; |
122 | cbBindTo->insertItem( it.key() ); | 122 | cbBindTo->insertItem( it.key() ); |
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 action; | 136 | QString action; |
136 | 137 | ||
137 | for ( int i = 0; i < nCards; ++i ) | 138 | for ( int i = 0; i < nCards; ++i ) |
138 | { | 139 | { |
139 | QString cardSection = QString( "Card_%1" ).arg( i ); | 140 | QString cardSection = QString( "Card_%1" ).arg( i ); |
140 | cfg.setGroup( cardSection ); | 141 | cfg.setGroup( cardSection ); |
141 | QString name = cfg.readEntry( "name" ); | 142 | QString name = cfg.readEntry( "name" ); |
142 | odebug << "comparing card '" << card->name() << "' with known card '" << name << "'" << oendl; | 143 | odebug << "comparing card '" << cardName << "' with known card '" << name << "'" << oendl; |
143 | if ( card->name() == name ) | 144 | if ( cardName == name ) |
144 | { | 145 | { |
145 | cfg.writeEntry( key, value ); | 146 | cfg.writeEntry( key, value ); |
146 | break; | 147 | break; |
147 | } | 148 | } |
148 | } | 149 | } |
149 | } | 150 | } |
150 | 151 | ||
151 | 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 ) |
152 | { | 153 | { |
153 | OConfig cfg( "PCMCIA" ); | 154 | OConfig cfg( "PCMCIA" ); |
154 | cfg.setGroup( "Global" ); | 155 | cfg.setGroup( "Global" ); |
155 | int nCards = cfg.readNumEntry( "nCards", 0 ); | 156 | int nCards = cfg.readNumEntry( "nCards", 0 ); |
157 | QString cardName = card->productIdentity().join( " " ).stripWhiteSpace(); | ||
156 | QString value; | 158 | QString value; |
157 | 159 | ||
158 | for ( int i = 0; i < nCards; ++i ) | 160 | for ( int i = 0; i < nCards; ++i ) |
159 | { | 161 | { |
160 | QString cardSection = QString( "Card_%1" ).arg( i ); | 162 | QString cardSection = QString( "Card_%1" ).arg( i ); |
161 | cfg.setGroup( cardSection ); | 163 | cfg.setGroup( cardSection ); |
162 | QString name = cfg.readEntry( "name" ); | 164 | QString name = cfg.readEntry( "name" ); |
163 | odebug << "comparing card '" << card->name() << "' with known card '" << name << "'" << oendl; | 165 | odebug << "comparing card '" << cardName << "' with known card '" << name << "'" << oendl; |
164 | if ( card->name() == name ) | 166 | if ( cardName == name ) |
165 | { | 167 | { |
166 | value = cfg.readEntry( key, defaultValue ); | 168 | value = cfg.readEntry( key, defaultValue ); |
167 | break; | 169 | break; |
168 | } | 170 | } |
169 | } | 171 | } |
170 | return value; | 172 | return value; |
171 | } | 173 | } |
172 | 174 | ||
173 | 175 | ||
174 | QString ConfigDialog::preferredAction( const OPcmciaSocket* card, const QString& type ) | 176 | QString ConfigDialog::preferredAction( const OPcmciaSocket* card, const QString& type ) |
175 | { | 177 | { |
176 | return ConfigDialog::readConfigEntry( card, QString( "%1Action" ).arg( type ), "suspend" ); | 178 | return ConfigDialog::readConfigEntry( card, QString( "%1Action" ).arg( type ), "suspend" ); |
177 | } | 179 | } |