Commit 4d880ed5 authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile with QT_NO_CAST_FROM_BYTEARRAY

parent 665de0a2
remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
set(kblog_SRCS
blog.cpp
......
......@@ -238,7 +238,7 @@ void GData::modifyPost(KBlog::BlogPost *post)
atomMarkup += QStringLiteral("</entry>");
QByteArray postData;
QDataStream stream(&postData, QIODevice::WriteOnly);
stream.writeRawData(atomMarkup.toUtf8(), atomMarkup.toUtf8().length());
stream.writeRawData(atomMarkup.toUtf8().constData(), atomMarkup.toUtf8().length());
KIO::StoredTransferJob *job = KIO::storedHttpPost(postData,
QUrl(QStringLiteral("http://www.blogger.com/feeds/") + blogId() + QStringLiteral("/posts/default/") + post->postId()),
......@@ -300,7 +300,7 @@ void GData::createPost(KBlog::BlogPost *post)
QByteArray postData;
QDataStream stream(&postData, QIODevice::WriteOnly);
stream.writeRawData(atomMarkup.toUtf8(), atomMarkup.toUtf8().length());
stream.writeRawData(atomMarkup.toUtf8().constData(), atomMarkup.toUtf8().length());
KIO::StoredTransferJob *job = KIO::storedHttpPost(postData,
QUrl(QStringLiteral("http://www.blogger.com/feeds/") + blogId() + QStringLiteral("/posts/default")),
......@@ -390,7 +390,7 @@ void GData::createComment(KBlog::BlogPost *post, KBlog::BlogComment *comment)
QByteArray postData;
qCDebug(KBLOG_LOG) << postData;
QDataStream stream(&postData, QIODevice::WriteOnly);
stream.writeRawData(atomMarkup.toUtf8(), atomMarkup.toUtf8().length());
stream.writeRawData(atomMarkup.toUtf8().constData(), atomMarkup.toUtf8().length());
KIO::StoredTransferJob *job = KIO::storedHttpPost(postData,
QUrl(QStringLiteral("http://www.blogger.com/feeds/") + blogId() + QStringLiteral("/") + post->postId() + QStringLiteral("/comments/default")),
......@@ -511,7 +511,7 @@ void GDataPrivate::slotFetchProfileId(KJob *job)
}
Q_Q(GData);
KIO::StoredTransferJob *stj = qobject_cast<KIO::StoredTransferJob *>(job);
const QString data = QString::fromUtf8(stj->data(), stj->data().size());
const QString data = QString::fromUtf8(stj->data().constData(), stj->data().size());
if (!job->error()) {
QRegExp pid(QStringLiteral("http://www.blogger.com/profile/(\\d+)"));
if (pid.indexIn(data) != -1) {
......@@ -782,7 +782,7 @@ void GDataPrivate::slotCreatePost(KJob *job)
return;
}
KIO::StoredTransferJob *stj = qobject_cast<KIO::StoredTransferJob *>(job);
const QString data = QString::fromUtf8(stj->data(), stj->data().size());
const QString data = QString::fromUtf8(stj->data().constData(), stj->data().size());
Q_Q(GData);
......@@ -838,7 +838,7 @@ void GDataPrivate::slotModifyPost(KJob *job)
return;
}
KIO::StoredTransferJob *stj = qobject_cast<KIO::StoredTransferJob *>(job);
const QString data = QString::fromUtf8(stj->data(), stj->data().size());
const QString data = QString::fromUtf8(stj->data().constData(), stj->data().size());
KBlog::BlogPost *post = mModifyPostMap[ job ];
mModifyPostMap.remove(job);
......@@ -890,7 +890,7 @@ void GDataPrivate::slotRemovePost(KJob *job)
return;
}
KIO::StoredTransferJob *stj = qobject_cast<KIO::StoredTransferJob *>(job);
const QString data = QString::fromUtf8(stj->data(), stj->data().size());
const QString data = QString::fromUtf8(stj->data().constData(), stj->data().size());
KBlog::BlogPost *post = mRemovePostMap[ job ];
mRemovePostMap.remove(job);
......@@ -914,7 +914,7 @@ void GDataPrivate::slotCreateComment(KJob *job)
return;
}
KIO::StoredTransferJob *stj = qobject_cast<KIO::StoredTransferJob *>(job);
const QString data = QString::fromUtf8(stj->data(), stj->data().size());
const QString data = QString::fromUtf8(stj->data().constData(), stj->data().size());
qCDebug(KBLOG_LOG) << "Dump data: " << data;
Q_Q(GData);
......@@ -972,7 +972,7 @@ void GDataPrivate::slotRemoveComment(KJob *job)
return;
}
KIO::StoredTransferJob *stj = qobject_cast<KIO::StoredTransferJob *>(job);
const QString data = QString::fromUtf8(stj->data(), stj->data().size());
const QString data = QString::fromUtf8(stj->data().constData(), stj->data().size());
Q_Q(GData);
......
......@@ -138,7 +138,7 @@ void WordpressBuggy::createPost(KBlog::BlogPost *post)
QByteArray postData;
QDataStream stream(&postData, QIODevice::WriteOnly);
stream.writeRawData(xmlMarkup.toUtf8(), xmlMarkup.toUtf8().length());
stream.writeRawData(xmlMarkup.toUtf8().constData(), xmlMarkup.toUtf8().length());
KIO::StoredTransferJob *job = KIO::storedHttpPost(postData, url(), KIO::HideProgressInfo);
if (!job) {
......@@ -245,7 +245,7 @@ void WordpressBuggy::modifyPost(KBlog::BlogPost *post)
QByteArray postData;
QDataStream stream(&postData, QIODevice::WriteOnly);
stream.writeRawData(xmlMarkup.toUtf8(), xmlMarkup.toUtf8().length());
stream.writeRawData(xmlMarkup.toUtf8().constData(), xmlMarkup.toUtf8().length());
KIO::StoredTransferJob *job = KIO::storedHttpPost(postData, url(), KIO::HideProgressInfo);
if (!job) {
......@@ -299,7 +299,7 @@ void WordpressBuggyPrivate::slotCreatePost(KJob *job)
qCDebug(KBLOG_LOG);
KIO::StoredTransferJob *stj = qobject_cast<KIO::StoredTransferJob *>(job);
const QString data = QString::fromUtf8(stj->data(), stj->data().size());
const QString data = QString::fromUtf8(stj->data().constData(), stj->data().size());
Q_Q(WordpressBuggy);
......@@ -349,7 +349,7 @@ void WordpressBuggyPrivate::slotModifyPost(KJob *job)
qCDebug(KBLOG_LOG);
KIO::StoredTransferJob *stj = qobject_cast<KIO::StoredTransferJob *>(job);
const QString data = QString::fromUtf8(stj->data(), stj->data().size());
const QString data = QString::fromUtf8(stj->data().constData(), stj->data().size());
KBlog::BlogPost *post = mModifyPostMap[ job ];
mModifyPostMap.remove(job);
......
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