summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (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
@@ -236,24 +236,27 @@ void ConfigDlg::setMap(int index) {
} else {
remove_button->setEnabled(true);
emit setMapToFile(keymaps->text(index));
}
}
// ConfigDlg::addMap() {{{1
void ConfigDlg::addMap() {
QString map = OFileDialog::getOpenFileName(1, QDir::home().absPath());
+
+ if (map.isNull()) return;
+
Config config ("multikey");
config.setGroup("keymaps");
QStringList maps = config.readListEntry("maps", QChar('|'));
maps.append(map);
keymaps->insertItem(map);
keymaps->setSelected(keymaps->count() - 1, true);
config.writeEntry("maps", maps, QChar('|'));
config.writeEntry("current", map);
}