Commit 66eab01b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated qt5.15 methods

parent 6f5de1a4
......@@ -50,6 +50,7 @@
#include <QMenu>
#include <KConfigGroup>
#include <KSharedConfig>
#include <QLocale>
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
......@@ -403,7 +404,8 @@ QString CertificateDetailsWidget::Private::tofuTooltipString(const GpgME::UserID
hdr);
};
const auto dateTime = [](long ts) {
return ts == 0 ? i18n("never") : QDateTime::fromSecsSinceEpoch(ts).toString(Qt::SystemLocaleShortDate);
QLocale l;
return ts == 0 ? i18n("never") : l.toString(QDateTime::fromSecsSinceEpoch(ts), QLocale::ShortFormat);
};
appendHeader(i18n("Signing"));
appendRow(i18n("First message"), dateTime(tofu.signFirst()));
......
......@@ -208,10 +208,18 @@ void DragQueen::mouseMoveEvent(QMouseEvent *e)
(e->buttons() & Qt::LeftButton) &&
(m_dragStartPosition - e->pos()).manhattanLength() > QApplication::startDragDistance()) {
QDrag *drag = new QDrag(this);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
if (const QPixmap *const pix = pixmap()) {
drag->setPixmap(*pix);
drag->setHotSpot(calculate_hot_spot(e->pos(), pix->size(), this));
}
#else
const QPixmap pix = pixmap();
if (!pix.isNull()) {
drag->setPixmap(pix);
drag->setHotSpot(calculate_hot_spot(e->pos(), pix.size(), this));
}
#endif
drag->setMimeData(new MimeDataProxy(m_data));
drag->exec();
} else {
......
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