Commit baaa000d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against qt5.15 without deprecated method

parent d61e2b83
Pipeline #22905 passed with stage
in 6 minutes and 40 seconds
......@@ -59,7 +59,7 @@ add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Des
add_definitions(-DTRANSLATION_DOMAIN=\"libkpimtextedit\")
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054700)
endif()
......
......@@ -28,6 +28,7 @@
#include <KMessageBox>
#include <KLocalizedString>
#include <QFileInfo>
#include <QRandomGenerator>
using namespace KPIMTextEdit;
......@@ -204,11 +205,10 @@ QSharedPointer<EmbeddedImage> RichTextComposerImages::createEmbeddedImage(const
buffer.open(QIODevice::WriteOnly);
img.save(&buffer, "PNG");
qsrand(QDateTime::currentDateTimeUtc().toSecsSinceEpoch() + qHash(imageName));
QSharedPointer<EmbeddedImage> embeddedImage(new EmbeddedImage());
embeddedImage->image = KCodecs::Codec::codecForName("base64")->encode(buffer.buffer());
embeddedImage->imageName = imageName;
embeddedImage->contentID = QStringLiteral("%1@KDE").arg(qrand());
embeddedImage->contentID = QStringLiteral("%1@KDE").arg(QRandomGenerator::global()->generate64());
return embeddedImage;
}
......
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