Commit 9196ba48 authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile with QT_NO_CAST_FROM_BYTEARRAY

parent c695dcab
......@@ -47,7 +47,6 @@ find_package(KF5Libkdepim ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
add_definitions( -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT )
remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
add_definitions( -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 )
########### CMake Config Files ###########
......
......@@ -175,13 +175,13 @@ void FilterEvolution::importMBox(const QString &mboxName, const QString &rootDir
QByteArray separate;
if (!first_msg) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
l = mbox.readLine(input.data(), MAX_LINE); // read the first line, prevent "From "
tmp.write(input, l);
tmp.write(input.constData(), l);
while (! mbox.atEnd() && (l = mbox.readLine(input.data(), MAX_LINE)) && ((separate = input.data()).left(5) != "From ")) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
tmp.flush();
first_msg = false;
......
......@@ -230,13 +230,13 @@ void FilterEvolution_v2::importMBox(const QString &mboxName, const QString &root
QByteArray separate;
if (!first_msg) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
l = mbox.readLine(input.data(), MAX_LINE); // read the first line, prevent "From "
tmp.write(input, l);
tmp.write(input.constData(), l);
while (! mbox.atEnd() && (l = mbox.readLine(input.data(), MAX_LINE)) && ((separate = input.data()).left(5) != "From ")) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
tmp.flush();
first_msg = false;
......
......@@ -110,13 +110,13 @@ void FilterMailApp::importMails(const QString &maildir)
QByteArray separate;
if (!first_msg) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
l = mbox.readLine(input.data(), MAX_LINE); // read the first line, prevent "From "
tmp.write(input, l);
tmp.write(input.constData(), l);
while (! mbox.atEnd() && (l = mbox.readLine(input.data(), MAX_LINE)) && ((separate = input.data()).left(5) != "From ")) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
tmp.flush();
first_msg = false;
......
......@@ -94,18 +94,18 @@ void FilterMailmanGzip::importMails(const QStringList &filenames)
/* check if the first line start with "From " (and not "From: ") and discard the line
* in this case because some IMAP servers (e.g. Cyrus) don't accept this header line */
if (!first_msg && ((separate = input.data()).left(5) != "From ")) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
l = device->readLine(input.data(), MAX_LINE); // read the first line, prevent "From "
if ((separate = input.data()).left(5) != "From ") {
separate.replace(" at ", "@");
tmp.write(separate, separate.length());
tmp.write(separate.constData(), separate.length());
}
while (! device->atEnd() && (l = device->readLine(input.data(), MAX_LINE)) && ((separate = input.data()).left(5) != "From ")) {
tmp.write(input, l);
tmp.write(input.constData(), l);
// workaround to fix hang if a corrupted mbox contains some
// binary data, for more see bug #106796
......
......@@ -92,17 +92,17 @@ void FilterMBox::importMails(const QStringList &filenames)
/* check if the first line start with "From " (and not "From: ") and discard the line
* in this case because some IMAP servers (e.g. Cyrus) don't accept this header line */
if (!first_msg && ((separate = input.data()).left(5) != "From ")) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
l = mbox.readLine(input.data(), MAX_LINE); // read the first line, prevent "From "
if ((separate = input.data()).left(5) != "From ") {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
while (! mbox.atEnd() && (l = mbox.readLine(input.data(), MAX_LINE)) && ((separate = input.data()).left(5) != "From ")) {
tmp.write(input, l);
tmp.write(input.constData(), l);
// workaround to fix hang if a corrupted mbox contains some
// binary data, for more see bug #106796
......
......@@ -107,15 +107,15 @@ void FilterOpera::importBox(const QDir &importDir, const QStringList &files, con
QByteArray separate;
if (!first_msg) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
l = operaArchiv.readLine(input.data(), MAX_LINE); // read the first line, prevent "From "
tmp.write(input, l);
tmp.write(input.constData(), l);
while (! operaArchiv.atEnd() && (l = operaArchiv.readLine(input.data(), MAX_LINE)) && ((separate = input.data()).left(5) != "From ")) {
/** remove in KMail unneeded Flags from Opera (for example: X-Opera-Status)*/
if (separate.left(8) != "X-Opera-") {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
}
tmp.flush();
......
......@@ -188,7 +188,7 @@ void FilterPMail::importMailFolder(const QString &file)
if (input.at(0) == 0x1a) {
break;
} else {
tempfile.write(input, l);
tempfile.write(input.constData(), l);
}
}
tempfile.flush();
......
......@@ -243,7 +243,7 @@ void FilterTheBat::importFiles(const QString &FileName)
QTemporaryFile tmp;
tmp.open();
tmp.write(input, endPos - lastPos);
tmp.write(input.constData(), endPos - lastPos);
tmp.flush();
importMessage(_path, tmp.fileName(), filterInfo()->removeDupMessage());
......
......@@ -298,13 +298,13 @@ void FilterThunderbird::importMBox(const QString &mboxName, const QString &rootD
QByteArray separate;
if (!first_msg) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
l = mbox.readLine(input.data(), MAX_LINE); // read the first line, prevent "From "
tmp.write(input, l);
tmp.write(input.constData(), l);
while (! mbox.atEnd() && (l = mbox.readLine(input.data(), MAX_LINE)) && ((separate = input.data()).left(5) != "From ")) {
tmp.write(input, l);
tmp.write(input.constData(), l);
}
tmp.flush();
first_msg = false;
......
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