Commit 3b67b27b authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

[Qt6] Fix syntax

parent 61a83171
......@@ -28,6 +28,9 @@
#include <QRegExp>
#include <QTextCodec>
#include <utility>
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
#include <QStringConverter>
#endif
SubtitleModel::SubtitleModel(Mlt::Tractor *tractor, std::shared_ptr<TimelineItemModel> timeline, QObject *parent)
: QAbstractListModel(parent)
......@@ -175,9 +178,9 @@ void SubtitleModel::importSubtitle(const QString &filePath, int offset, bool ext
stream.setCodec("UTF-8");
}
#else
std::optional<Encoding> inputEncoding = QStringConverter::encodingForName(encoding);
if (!inputEncoding.isEmpty()) {
stream.setEncoding(inputEncoding)
std::optional<QStringConverter::Encoding> inputEncoding = QStringConverter::encodingForName(encoding);
if (inputEncoding) {
stream.setEncoding(inputEncoding);
}
// else: UTF8 is the default
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment