Replace deprecated parts of the code (#2419)

Performing a dev build against the latest version of Qt failed
because of some deprecated members. They have been replaced
according to the Qt documentation.

Further, Q_OS_MACOS is now the only macro available to identify a
machine running macOS, the others are now deprecated.
See https://doc.qt.io/qt-5/qtglobal.html#Q_OS_OSX and
https://doc.qt.io/qt-5/qtglobal.html#Q_OS_MAC.
This commit is contained in:
Gianluca Recchia 2018-10-26 15:19:04 +02:00 committed by Janek Bevendorff
parent efdb43dc53
commit f31d65bdaf
26 changed files with 57 additions and 47 deletions

View file

@ -26,7 +26,7 @@
#include "core/Config.h"
Clipboard* Clipboard::m_instance(nullptr);
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
QPointer<MacPasteboard> Clipboard::m_pasteboard(nullptr);
#endif
@ -34,7 +34,7 @@ Clipboard::Clipboard(QObject* parent)
: QObject(parent)
, m_timer(new QTimer(this))
{
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
if (!m_pasteboard) {
m_pasteboard = new MacPasteboard();
}
@ -49,7 +49,7 @@ void Clipboard::setText(const QString& text)
QClipboard* clipboard = QApplication::clipboard();
QMimeData* mime = new QMimeData;
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
mime->setText(text);
mime->setData("application/x-nspasteboard-concealed-type", text.toUtf8());
clipboard->setMimeData(mime, QClipboard::Clipboard);