diff options
author | Stijn Buys <ingar@osirion.org> | 2012-02-21 22:30:21 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-02-21 22:30:21 +0000 |
commit | 0392694560d530c14aced7ac21f85b18b676a685 (patch) | |
tree | 2410f58516767913b6fdd5f2efcdca9fb1155fc2 /src/zoneproperties.cc | |
parent | ba14d604adfee8b7596e0bfca81ad2720bbc0cf5 (diff) |
Initial support to preserve ini file comments
Diffstat (limited to 'src/zoneproperties.cc')
-rw-r--r-- | src/zoneproperties.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/zoneproperties.cc b/src/zoneproperties.cc index 35d994a..43e4804 100644 --- a/src/zoneproperties.cc +++ b/src/zoneproperties.cc @@ -20,6 +20,19 @@ ZoneProperties::~ZoneProperties() void ZoneProperties::save(QTextStream & textstream) { + // comments + if (comment().size()) { + // QTextStream operates on QString, not on QString const + QString commentbuffer = comment(); + QTextStream commentstream(&commentbuffer); + QString line; + while (!commentstream.atEnd()) { + line = commentstream.readLine(1024); + textstream << line << '\n'; + } + textstream << '\n'; + } + textstream << "[zone]" << '\n'; if (name().size()) |