summaryrefslogtreecommitdiff
path: root/inputmethods
authorhash <hash>2002-08-21 20:00:48 (UTC)
committer hash <hash>2002-08-21 20:00:48 (UTC)
commit10739e8b7d203e56ef30011770f6d12d8b0bb270 (patch) (unidiff)
tree341451202d077ed4bdf16beb696a94e494c7693c /inputmethods
parent33fb38da29cfb4b29eff08928742b8d6918eb852 (diff)
downloadopie-10739e8b7d203e56ef30011770f6d12d8b0bb270.zip
opie-10739e8b7d203e56ef30011770f6d12d8b0bb270.tar.gz
opie-10739e8b7d203e56ef30011770f6d12d8b0bb270.tar.bz2
fixed bug where it adds blank lines to the keymap list
Diffstat (limited to 'inputmethods') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/configdlg.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp
index a9137b9..9ea59a4 100644
--- a/inputmethods/multikey/configdlg.cpp
+++ b/inputmethods/multikey/configdlg.cpp
@@ -224,48 +224,51 @@ void ConfigDlg::repeatTog() {
224 224
225void ConfigDlg::setMap(int index) { 225void ConfigDlg::setMap(int index) {
226 226
227 if (index == 0) { 227 if (index == 0) {
228 228
229 remove_button->setDisabled(true); 229 remove_button->setDisabled(true);
230 emit setMapToDefault(); 230 emit setMapToDefault();
231 } 231 }
232 else if ((uint)index <= default_maps.count()) { 232 else if ((uint)index <= default_maps.count()) {
233 233
234 remove_button->setDisabled(true); 234 remove_button->setDisabled(true);
235 emit setMapToFile(keymaps->text(index)); 235 emit setMapToFile(keymaps->text(index));
236 236
237 } else { 237 } else {
238 238
239 remove_button->setEnabled(true); 239 remove_button->setEnabled(true);
240 emit setMapToFile(keymaps->text(index)); 240 emit setMapToFile(keymaps->text(index));
241 } 241 }
242} 242}
243 243
244// ConfigDlg::addMap() {{{1 244// ConfigDlg::addMap() {{{1
245void ConfigDlg::addMap() { 245void ConfigDlg::addMap() {
246 246
247 QString map = OFileDialog::getOpenFileName(1, QDir::home().absPath()); 247 QString map = OFileDialog::getOpenFileName(1, QDir::home().absPath());
248
249 if (map.isNull()) return;
250
248 Config config ("multikey"); 251 Config config ("multikey");
249 config.setGroup("keymaps"); 252 config.setGroup("keymaps");
250 QStringList maps = config.readListEntry("maps", QChar('|')); 253 QStringList maps = config.readListEntry("maps", QChar('|'));
251 maps.append(map); 254 maps.append(map);
252 keymaps->insertItem(map); 255 keymaps->insertItem(map);
253 keymaps->setSelected(keymaps->count() - 1, true); 256 keymaps->setSelected(keymaps->count() - 1, true);
254 257
255 258
256 config.writeEntry("maps", maps, QChar('|')); 259 config.writeEntry("maps", maps, QChar('|'));
257 config.writeEntry("current", map); 260 config.writeEntry("current", map);
258 261
259} 262}
260 263
261// ConfigDlg::removeMap() {{{1 264// ConfigDlg::removeMap() {{{1
262void ConfigDlg::removeMap() { 265void ConfigDlg::removeMap() {
263 266
264 cout << "removing : " << custom_maps[keymaps->currentItem() - default_maps.count() - 1] << "\n"; 267 cout << "removing : " << custom_maps[keymaps->currentItem() - default_maps.count() - 1] << "\n";
265 cout << "currentItem : " << keymaps->currentItem() << "\n"; 268 cout << "currentItem : " << keymaps->currentItem() << "\n";
266 269
267 // move selection up one 270 // move selection up one
268 keymaps->setSelected(keymaps->currentItem() - 1, true); 271 keymaps->setSelected(keymaps->currentItem() - 1, true);
269 // delete the next selected item cus you just moved it up 272 // delete the next selected item cus you just moved it up
270 keymaps->removeItem(keymaps->currentItem() + 1); 273 keymaps->removeItem(keymaps->currentItem() + 1);
271 274