-rw-r--r-- | noncore/apps/keyz-cfg/cfgfile.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/apps/keyz-cfg/cfgfile.cpp b/noncore/apps/keyz-cfg/cfgfile.cpp index 81d1ee1..be7150e 100644 --- a/noncore/apps/keyz-cfg/cfgfile.cpp +++ b/noncore/apps/keyz-cfg/cfgfile.cpp @@ -136,2 +136,6 @@ bool CfgParser::save(QString file, CfgFile& cfg) { FILE* f = fopen((const char*) file.local8Bit(), "w"); + if (!f) { + oerr << "Could not write config file!" << oendl; + return false; + } @@ -147,3 +151,5 @@ bool CfgParser::save(QString file, CfgFile& cfg) { QString l = entry->getLabel(); - if (!l.isEmpty()) { + if (l.isEmpty()) { + l = entry->getFile(); + } fprintf(f, "\t<label name=\"%s\" state=\"km%d:*\"/>\n", @@ -151,3 +157,2 @@ bool CfgParser::save(QString file, CfgFile& cfg) { } - } |