- _configFile->seek(0);
- _configFile->resize(0);
- _configFile->write(_parsedConfig);
- _configFile->write(_quasselConfig);
+bool OidentdConfigGenerator::parseConfig(bool readQuasselStanzas)
+{
+ if (!_configFile->exists())
+ return true;
+
+ if (!_configFile->isOpen() && !_configFile->open(QIODevice::ReadOnly))
+ return false;
+ _mutex.lock();
+
+ _parsedConfig.clear();
+ _configFile->seek(0);
+ while (!_configFile->atEnd()) {
+ QByteArray line = _configFile->readLine();
+
+ if (!lineByUs(line))
+ _parsedConfig.append(line);
+ else if (readQuasselStanzas)
+ _quasselConfig.append(line);
+ }
+
+ _configFile->close();
+ _mutex.unlock();
+ return true;
+}
+