Commit 1d70f151 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt for building with qt6

parent 809a8a80
Pipeline #49299 failed with stage
in 10 minutes and 2 seconds
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
#include <KConfigGroup> #include <KConfigGroup>
#include <KLocalizedString> #include <KLocalizedString>
#include <QUrl> #include <QUrl>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QTextCodec>
#endif
#include "balsaplugin_debug.h" #include "balsaplugin_debug.h"
#include <QFile> #include <QFile>
...@@ -73,7 +76,11 @@ void BalsaAddressBook::readAddressBook(const KConfigGroup &grp) ...@@ -73,7 +76,11 @@ void BalsaAddressBook::readAddressBook(const KConfigGroup &grp)
QFile file(path); QFile file(path);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream stream(&file); QTextStream stream(&file);
stream.setCodec("ISO 8859-1"); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
stream.setCodec(QTextCodec::codecForName("ISO-8859-1"));
#else
stream.setEncoding(QStringConverter::Encoding::Latin1);
#endif
const QString wholeFile = stream.readAll(); const QString wholeFile = stream.readAll();
const QDateTime dtDefault = QFileInfo(file).lastModified(); const QDateTime dtDefault = QFileInfo(file).lastModified();
......
Markdown is supported
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