From a735e6b5f188e1f62c721544b737889c30f96ba2 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 26 Mar 2020 23:29:09 +0000 Subject: [PATCH] remove unused QApplicationPrivate members Signed-off-by: Ivailo Monev --- src/gui/kernel/qapplication.cpp | 142 ---------------------------------------- src/gui/kernel/qapplication_p.h | 7 -- src/gui/kernel/qdnd.cpp | 23 ------- src/gui/kernel/qdnd_p.h | 10 --- src/gui/kernel/qdnd_x11.cpp | 12 +--- src/gui/kernel/qdrag.cpp | 19 ------ src/gui/kernel/qdrag.h | 2 - 7 files changed, 3 insertions(+), 212 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index c4074b526..6200ef765 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -125,12 +125,6 @@ QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::T gestureWidget = 0; #endif // QT_NO_GESTURES -#if defined(Q_WS_X11) - move_cursor = 0; - copy_cursor = 0; - link_cursor = 0; -#endif - if (!self) self = this; } @@ -819,12 +813,6 @@ QApplication::~QApplication() qt_clipboard = Q_NULLPTR; #endif -#if defined(Q_WS_X11) - delete d->move_cursor; d->move_cursor = 0; - delete d->copy_cursor; d->copy_cursor = 0; - delete d->link_cursor; d->link_cursor = 0; -#endif - delete QApplicationPrivate::app_pal; QApplicationPrivate::app_pal = 0; delete QApplicationPrivate::sys_pal; @@ -4727,136 +4715,6 @@ QGestureManager* QGestureManager::instance() } #endif // QT_NO_GESTURES -// These pixmaps approximate the images in the Windows User Interface Guidelines. - -// XPM -#if defined(Q_WS_X11) -static const char * const move_xpm[] = { -"11 20 3 1", -". c None", -"a c #FFFFFF", -"X c #000000", // X11 cursor is traditionally black -"aa.........", -"aXa........", -"aXXa.......", -"aXXXa......", -"aXXXXa.....", -"aXXXXXa....", -"aXXXXXXa...", -"aXXXXXXXa..", -"aXXXXXXXXa.", -"aXXXXXXXXXa", -"aXXXXXXaaaa", -"aXXXaXXa...", -"aXXaaXXa...", -"aXa..aXXa..", -"aa...aXXa..", -"a.....aXXa.", -"......aXXa.", -".......aXXa", -".......aXXa", -"........aa."}; - -/* XPM */ -static const char * const copy_xpm[] = { -"24 30 3 1", -". c None", -"a c #000000", -"X c #FFFFFF", -"XX......................", -"XaX.....................", -"XaaX....................", -"XaaaX...................", -"XaaaaX..................", -"XaaaaaX.................", -"XaaaaaaX................", -"XaaaaaaaX...............", -"XaaaaaaaaX..............", -"XaaaaaaaaaX.............", -"XaaaaaaXXXX.............", -"XaaaXaaX................", -"XaaXXaaX................", -"XaX..XaaX...............", -"XX...XaaX...............", -"X.....XaaX..............", -"......XaaX..............", -".......XaaX.............", -".......XaaX.............", -"........XX...aaaaaaaaaaa", -".............aXXXXXXXXXa", -".............aXXXXXXXXXa", -".............aXXXXaXXXXa", -".............aXXXXaXXXXa", -".............aXXaaaaaXXa", -".............aXXXXaXXXXa", -".............aXXXXaXXXXa", -".............aXXXXXXXXXa", -".............aXXXXXXXXXa", -".............aaaaaaaaaaa"}; - -/* XPM */ -static const char * const link_xpm[] = { -"24 30 3 1", -". c None", -"a c #000000", -"X c #FFFFFF", -"XX......................", -"XaX.....................", -"XaaX....................", -"XaaaX...................", -"XaaaaX..................", -"XaaaaaX.................", -"XaaaaaaX................", -"XaaaaaaaX...............", -"XaaaaaaaaX..............", -"XaaaaaaaaaX.............", -"XaaaaaaXXXX.............", -"XaaaXaaX................", -"XaaXXaaX................", -"XaX..XaaX...............", -"XX...XaaX...............", -"X.....XaaX..............", -"......XaaX..............", -".......XaaX.............", -".......XaaX.............", -"........XX...aaaaaaaaaaa", -".............aXXXXXXXXXa", -".............aXXXaaaaXXa", -".............aXXXXaaaXXa", -".............aXXXaaaaXXa", -".............aXXaaaXaXXa", -".............aXXaaXXXXXa", -".............aXXaXXXXXXa", -".............aXXXaXXXXXa", -".............aXXXXXXXXXa", -".............aaaaaaaaaaa"}; -#endif // defined(Q_WS_X11) - -QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) -{ -#if defined(Q_WS_X11) - if (!move_cursor) { - move_cursor = new QPixmap((const char **)move_xpm); - copy_cursor = new QPixmap((const char **)copy_xpm); - link_cursor = new QPixmap((const char **)link_xpm); - } - - switch (cshape) { - case Qt::DragMoveCursor: - return *move_cursor; - case Qt::DragCopyCursor: - return *copy_cursor; - case Qt::DragLinkCursor: - return *link_cursor; - default: - break; - } -#else - Q_UNUSED(cshape); -#endif - return QPixmap(); -} - QT_END_NAMESPACE diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 72bcff7a4..0962e29af 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -163,7 +163,6 @@ public: static QSize app_strut; static QWidgetList *popupWidgets; static QStyle *app_style; - static int app_cspec; static QPalette *app_pal; static QPalette *sys_pal; static QPalette *set_pal; @@ -231,12 +230,6 @@ public: QGestureManager *gestureManager; QWidget *gestureWidget; #endif -#if defined(Q_WS_X11) - QPixmap *move_cursor; - QPixmap *copy_cursor; - QPixmap *link_cursor; -#endif - QPixmap getPixmapCursor(Qt::CursorShape cshape); QMap > widgetForTouchPointId; QMap appCurrentTouchPoints; diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp index 2a33adf56..3fd4ab7e0 100644 --- a/src/gui/kernel/qdnd.cpp +++ b/src/gui/kernel/qdnd.cpp @@ -133,9 +133,6 @@ QDragManager::QDragManager() eventLoop = 0; dropData = new QDropData(); currentDropTarget = 0; -#ifdef Q_WS_X11 - xdndMimeTransferedPixmapIndex = 0; -#endif } @@ -156,26 +153,6 @@ QDragManager *QDragManager::self() return instance; } -QPixmap QDragManager::dragCursor(Qt::DropAction action) const -{ - QDragPrivate * d = dragPrivate(); - if (d && d->customCursors.contains(action)) - return d->customCursors[action]; - else if (action == Qt::MoveAction) - return QApplicationPrivate::instance()->getPixmapCursor(Qt::DragMoveCursor); - else if (action == Qt::CopyAction) - return QApplicationPrivate::instance()->getPixmapCursor(Qt::DragCopyCursor); - else if (action == Qt::LinkAction) - return QApplicationPrivate::instance()->getPixmapCursor(Qt::DragLinkCursor); - return QPixmap(); -} - -bool QDragManager::hasCustomDragCursors() const -{ - QDragPrivate * d = dragPrivate(); - return d && !d->customCursors.isEmpty(); -} - Qt::DropAction QDragManager::defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const { diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h index 490a23f4e..eb04e712d 100644 --- a/src/gui/kernel/qdnd_p.h +++ b/src/gui/kernel/qdnd_p.h @@ -98,7 +98,6 @@ public: QPoint hotspot; Qt::DropActions possible_actions; Qt::DropAction executed_action; - QMap customCursors; Qt::DropAction defaultDropAction; }; @@ -153,10 +152,6 @@ public: bool willDrop; QEventLoop *eventLoop; - QPixmap dragCursor(Qt::DropAction action) const; - - bool hasCustomDragCursors() const; - QDropData *dropData; void emitActionChanged(Qt::DropAction newAction) { if (object) emit object->actionChanged(newAction); } @@ -164,11 +159,6 @@ public: void setCurrentTarget(QWidget *target, bool dropped = false); QWidget *currentTarget(); -#ifdef Q_WS_X11 - QPixmap xdndMimeTransferedPixmap[2]; - int xdndMimeTransferedPixmapIndex; -#endif - private: QWidget *currentDropTarget; diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 309c94b5f..ecc8e573d 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -528,15 +528,9 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data img = img.convertToFormat(QImage::Format_MonoLSB); pm = QPixmap::fromImage(img); } - QDragManager *dm = QDragManager::self(); - if (dm) { - Pixmap handle = pm.handle(); - *data = QByteArray((const char *) &handle, sizeof(Pixmap)); - dm->xdndMimeTransferedPixmap[dm->xdndMimeTransferedPixmapIndex] = pm; - dm->xdndMimeTransferedPixmapIndex = - (dm->xdndMimeTransferedPixmapIndex + 1) % 2; - ret = true; - } + Pixmap handle = pm.handle(); + *data = QByteArray(reinterpret_cast(&handle), sizeof(Pixmap)); + ret = true; } else { DEBUG("QClipboard: xdndMimeDataForAtom(): converting to type '%s' is not supported", qPrintable(atomName)); } diff --git a/src/gui/kernel/qdrag.cpp b/src/gui/kernel/qdrag.cpp index 11920d73c..696032932 100644 --- a/src/gui/kernel/qdrag.cpp +++ b/src/gui/kernel/qdrag.cpp @@ -290,25 +290,6 @@ Qt::DropAction QDrag::start(Qt::DropActions request) } /*! - Sets the drag \a cursor for the \a action. This allows you - to override the default native cursors. To revert to using the - native cursor for \a action pass in a null QPixmap as \a cursor. - - The \a action can only be CopyAction, MoveAction or LinkAction. - All other values of DropAction are ignored. -*/ -void QDrag::setDragCursor(const QPixmap &cursor, Qt::DropAction action) -{ - Q_D(QDrag); - if (action != Qt::CopyAction && action != Qt::MoveAction && action != Qt::LinkAction) - return; - if (cursor.isNull()) - d->customCursors.remove(action); - else - d->customCursors[action] = cursor; -} - -/*! \fn void QDrag::actionChanged(Qt::DropAction action) This signal is emitted when the \a action associated with the diff --git a/src/gui/kernel/qdrag.h b/src/gui/kernel/qdrag.h index 05f7fe567..b15e27bf7 100644 --- a/src/gui/kernel/qdrag.h +++ b/src/gui/kernel/qdrag.h @@ -73,8 +73,6 @@ public: Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction, Qt::DropAction defaultAction = Qt::IgnoreAction); - void setDragCursor(const QPixmap &cursor, Qt::DropAction action); - Q_SIGNALS: void actionChanged(Qt::DropAction action); void targetChanged(QWidget *newTarget); -- 2.11.0