Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/inistream.cc')
-rw-r--r--src/inistream.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/inistream.cc b/src/inistream.cc
index c89056f..7a73ea9 100644
--- a/src/inistream.cc
+++ b/src/inistream.cc
@@ -51,6 +51,9 @@ bool IniStream::getline(QTextStream &textstream)
if (line[0] == '#' || line[0] == ';') {
// line with comment
+ comment_next += line;
+ comment_next += '\n';
+
} else {
// section header
if (line.size() > 2 && line.startsWith('[') && line.endsWith(']')) {
@@ -61,6 +64,9 @@ bool IniStream::getline(QTextStream &textstream)
section_current = section_current.trimmed();
section_current.toLower();
+ comment_current = comment_next;
+ comment_next.clear();
+
last_read_was_section = true;
return true;
} else {
@@ -78,6 +84,9 @@ bool IniStream::getline(QTextStream &textstream)
value_current.remove(0, key_current.size() + 1);
value_current = value_current.trimmed();
+ comment_current = comment_next;
+ comment_next.clear();
+
last_read_was_key = true;
return true;
}