diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-05-10 08:09:44 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-05-30 15:23:25 (GMT) |
commit | 55a440589c186e389390b2fd18170768901fa618 (patch) | |
tree | 9e7f0ec5d802a4ca2a9f174240eb7e90328f5f48 /src | |
parent | 1a17ab72726ba5d15396ee152c78a1aa921533a6 (diff) | |
download | Qt-55a440589c186e389390b2fd18170768901fa618.zip Qt-55a440589c186e389390b2fd18170768901fa618.tar.gz Qt-55a440589c186e389390b2fd18170768901fa618.tar.bz2 |
Remove const from QPlatformClipboard::mimeData().
Most implementations will anyway do non-const operations in there, the
change avoids the need for const_cast or mutable.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qplatformclipboard_qpa.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qplatformclipboard_qpa.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandclipboard.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandclipboard.h | 4 | ||||
-rw-r--r-- | src/plugins/platforms/xlib/qxlibclipboard.cpp | 8 | ||||
-rw-r--r-- | src/plugins/platforms/xlib/qxlibclipboard.h | 2 |
6 files changed, 9 insertions, 11 deletions
diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp index 33d2afc..302df68 100644 --- a/src/gui/kernel/qplatformclipboard_qpa.cpp +++ b/src/gui/kernel/qplatformclipboard_qpa.cpp @@ -83,7 +83,7 @@ QPlatformClipboard::~QPlatformClipboard() } -const QMimeData *QPlatformClipboard::mimeData(QClipboard::Mode mode) const +QMimeData *QPlatformClipboard::mimeData(QClipboard::Mode mode) { //we know its clipboard Q_UNUSED(mode); diff --git a/src/gui/kernel/qplatformclipboard_qpa.h b/src/gui/kernel/qplatformclipboard_qpa.h index 5444a1f..e1be8aa 100644 --- a/src/gui/kernel/qplatformclipboard_qpa.h +++ b/src/gui/kernel/qplatformclipboard_qpa.h @@ -59,7 +59,7 @@ class Q_GUI_EXPORT QPlatformClipboard public: virtual ~QPlatformClipboard(); - virtual const QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard ) const; + virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard); virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard); virtual bool supportsMode(QClipboard::Mode mode) const; void emitChanged(QClipboard::Mode mode); diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.cpp b/src/plugins/platforms/wayland/qwaylandclipboard.cpp index 9a363b5..c1ac386 100644 --- a/src/plugins/platforms/wayland/qwaylandclipboard.cpp +++ b/src/plugins/platforms/wayland/qwaylandclipboard.cpp @@ -217,7 +217,7 @@ QVariant QWaylandClipboard::retrieveData(const QString &mimeType, QVariant::Type return content; } -const QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode) const +QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode) { Q_ASSERT(mode == QClipboard::Clipboard); if (!mMimeDataIn) diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.h b/src/plugins/platforms/wayland/qwaylandclipboard.h index b0d6394..6a02254 100644 --- a/src/plugins/platforms/wayland/qwaylandclipboard.h +++ b/src/plugins/platforms/wayland/qwaylandclipboard.h @@ -57,7 +57,7 @@ public: QWaylandClipboard(QWaylandDisplay *display); ~QWaylandClipboard(); - const QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) const; + QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard); void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard); bool supportsMode(QClipboard::Mode mode) const; @@ -81,7 +81,7 @@ private: QWaylandDisplay *mDisplay; QWaylandSelection *mSelection; - mutable QWaylandMimeData *mMimeDataIn; + QWaylandMimeData *mMimeDataIn; QList<QWaylandSelection *> mSelections; QStringList mOfferedMimeTypes; struct wl_selection_offer *mOffer; diff --git a/src/plugins/platforms/xlib/qxlibclipboard.cpp b/src/plugins/platforms/xlib/qxlibclipboard.cpp index dfaf552..fef6e3a 100644 --- a/src/plugins/platforms/xlib/qxlibclipboard.cpp +++ b/src/plugins/platforms/xlib/qxlibclipboard.cpp @@ -161,12 +161,11 @@ QXlibClipboard::QXlibClipboard(QXlibScreen *screen) { } -const QMimeData * QXlibClipboard::mimeData(QClipboard::Mode mode) const +QMimeData * QXlibClipboard::mimeData(QClipboard::Mode mode) { if (mode == QClipboard::Clipboard) { if (!m_xClipboard) { - QXlibClipboard *that = const_cast<QXlibClipboard *>(this); - that->m_xClipboard = new QXlibClipboardMime(mode,that); + m_xClipboard = new QXlibClipboardMime(mode, this); } Window clipboardOwner = XGetSelectionOwner(screen()->display()->nativeDisplay(),QXlibStatic::atom(QXlibStatic::CLIPBOARD)); if (clipboardOwner == owner()) { @@ -176,8 +175,7 @@ const QMimeData * QXlibClipboard::mimeData(QClipboard::Mode mode) const } } else if (mode == QClipboard::Selection) { if (!m_xSelection) { - QXlibClipboard *that = const_cast<QXlibClipboard *>(this); - that->m_xSelection = new QXlibClipboardMime(mode,that); + m_xSelection = new QXlibClipboardMime(mode, this); } Window clipboardOwner = XGetSelectionOwner(screen()->display()->nativeDisplay(),XA_PRIMARY); if (clipboardOwner == owner()) { diff --git a/src/plugins/platforms/xlib/qxlibclipboard.h b/src/plugins/platforms/xlib/qxlibclipboard.h index 15901b0..d61340d 100644 --- a/src/plugins/platforms/xlib/qxlibclipboard.h +++ b/src/plugins/platforms/xlib/qxlibclipboard.h @@ -51,7 +51,7 @@ class QXlibClipboard : public QPlatformClipboard public: QXlibClipboard(QXlibScreen *screen); - const QMimeData *mimeData(QClipboard::Mode mode) const; + QMimeData *mimeData(QClipboard::Mode mode); void setMimeData(QMimeData *data, QClipboard::Mode mode); bool supportsMode(QClipboard::Mode mode) const; |