Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/logwidget.cpp
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 130 | { | |||
---|---|---|---|---|---|
131 | /* | 131 | /* | ||
132 | A QTemporaryFile will always be opened in QIODevice::ReadWrite mode, | 132 | A QTemporaryFile will always be opened in QIODevice::ReadWrite mode, | ||
133 | this allows easy access to the data in the file. This function will | 133 | this allows easy access to the data in the file. This function will | ||
134 | return true upon success and will set the fileName() to the unique | 134 | return true upon success and will set the fileName() to the unique | ||
135 | filename used. | 135 | filename used. | ||
136 | */ | 136 | */ | ||
137 | logFile->open(); | 137 | logFile->open(); | ||
138 | logFile->seek(logFile->size()); | 138 | logFile->seek(logFile->size()); | ||
139 | for (const auto &string : unsyncedStrings) { | 139 | for (const auto &string : qAsConst(unsyncedStrings)) { | ||
140 | logFile->write(string.toLatin1()); | 140 | logFile->write(string.toLatin1()); | ||
141 | logFile->putChar('\n'); | 141 | logFile->putChar('\n'); | ||
142 | } | 142 | } | ||
143 | logFile->close(); | 143 | logFile->close(); | ||
144 | unsyncedStrings.clear(); | 144 | unsyncedStrings.clear(); | ||
145 | } | 145 | } | ||
146 | 146 | | |||
147 | void LogWidget::savePressed() | 147 | void LogWidget::savePressed() | ||
Show All 14 Lines |