diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2014-10-09 12:42:13 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2014-10-10 10:13:45 +0200 |
commit | e31a7e46eaeb7c3590f3099a08ed085edb21c906 (patch) | |
tree | ef4ec9469b59102c1bad05312619ed7531859310 /src | |
parent | c712ec4543bb9a3db469ffd909e01d97c48ff697 (diff) |
Android: Support QClipboard::clear()
QClipboard::clear() is implemented by calling
QPlatformClipboard::setMimeData() with a null pointer. Since we
would do nothing in this case on Android, then the clear()
function would have no effect.
[ChangeLog][Android] Added support for QClipboard::clear()
Task-number: QTBUG-41854
Change-Id: Id569b102f2e561e46967b52f89d9b54031d92456
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformclipboard.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.cpp b/src/plugins/platforms/android/qandroidplatformclipboard.cpp index 86fd152bff..70bdbad11f 100644 --- a/src/plugins/platforms/android/qandroidplatformclipboard.cpp +++ b/src/plugins/platforms/android/qandroidplatformclipboard.cpp @@ -53,10 +53,8 @@ QMimeData *QAndroidPlatformClipboard::mimeData(QClipboard::Mode mode) void QAndroidPlatformClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) { - if (!data || !data->hasText() || QClipboard::Clipboard != mode) - return; - - QtAndroidClipboard::setClipboardText(data->text()); + Q_ASSERT(supportsMode(mode)); + QtAndroidClipboard::setClipboardText(data != 0 && data->hasText() ? data->text() : QString()); } bool QAndroidPlatformClipboard::supportsMode(QClipboard::Mode mode) const |