bool QClipboard::ownsMode(Mode mode) const
{
- if (mode == Clipboard)
- return clipboardData()->timestamp != CurrentTime;
- else if(mode == Selection)
- return selectionData()->timestamp != CurrentTime;
- else
- return false;
+ switch (mode) {
+ case QClipboard::Clipboard:
+ return clipboardData()->timestamp != CurrentTime;
+ case QClipboard::Selection:
+ return selectionData()->timestamp != CurrentTime;
+ }
+
+ Q_UNREACHABLE();
}
static Bool checkForClipboardEvents(Display *, XEvent *e, XPointer)
case QClipboard::Clipboard:
atom = ATOM(CLIPBOARD);
break;
-
- default:
- qWarning("QClipboardWatcher: Internal error: Unsupported clipboard mode");
- break;
}
setupOwner();
{
QClipboardData *d = 0;
switch (mode) {
- case Selection:
+ case QClipboard::Selection:
d = selectionData();
break;
- case Clipboard:
+ case QClipboard::Clipboard:
d = clipboardData();
break;
- default:
- qWarning("QClipboard::mimeData: unsupported mode '%d'", mode);
- return 0;
}
if (! d->source() && ! timer_event_clear) {
Atom atom, sentinel_atom;
QClipboardData *d;
switch (mode) {
- case Selection:
+ case QClipboard::Selection:
atom = XA_PRIMARY;
sentinel_atom = ATOM(_QT_SELECTION_SENTINEL);
d = selectionData();
break;
- case Clipboard:
+ case QClipboard::Clipboard:
atom = ATOM(CLIPBOARD);
sentinel_atom = ATOM(_QT_CLIPBOARD_SENTINEL);
d = clipboardData();
break;
-
- default:
- qWarning("QClipboard::setMimeData: unsupported mode '%d'", mode);
- return;
}
Display *dpy = qt_x11Data->display;