| 196 | } |
| 197 | |
| 198 | bool SubtitleConverter::writeFile(const QString &filename, QString encoding, |
| 199 | const QStringList &lines) const { |
| 200 | QFile outputFile(filename); |
| 201 | if (outputFile.open(QIODevice::WriteOnly | QIODevice::Text)) { |
| 202 | QTextStream out(&outputFile); |
| 203 | out.setCodec(qPrintable(encoding)); |
| 204 | foreach (QString line, lines) { out << line << "\n"; } |
| 205 | outputFile.close(); |
| 206 | return true; |
| 207 | } else { |
| 208 | return false; |
| 209 | } |
| 210 | } |