OSDN Git Service

remove unused QApplicationPrivate members
authorIvailo Monev <xakepa10@laimg.moc>
Thu, 26 Mar 2020 23:29:09 +0000 (23:29 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Thu, 26 Mar 2020 23:29:09 +0000 (23:29 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/gui/kernel/qapplication.cpp
src/gui/kernel/qapplication_p.h
src/gui/kernel/qdnd.cpp
src/gui/kernel/qdnd_p.h
src/gui/kernel/qdnd_x11.cpp
src/gui/kernel/qdrag.cpp
src/gui/kernel/qdrag.h

index c4074b5..6200ef7 100644 (file)
@@ -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
 
 
index 72bcff7..0962e29 100644 (file)
@@ -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<int, QWeakPointer<QWidget> > widgetForTouchPointId;
     QMap<int, QTouchEvent::TouchPoint> appCurrentTouchPoints;
index 2a33adf..3fd4ab7 100644 (file)
@@ -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
 {
index 490a23f..eb04e71 100644 (file)
@@ -98,7 +98,6 @@ public:
     QPoint hotspot;
     Qt::DropActions possible_actions;
     Qt::DropAction executed_action;
-    QMap<Qt::DropAction, QPixmap> 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;
 
index 309c94b..ecc8e57 100644 (file)
@@ -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<const char *>(&handle), sizeof(Pixmap));
+            ret = true;
         } else {
             DEBUG("QClipboard: xdndMimeDataForAtom(): converting to type '%s' is not supported", qPrintable(atomName));
         }
index 11920d7..6960329 100644 (file)
@@ -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
index 05f7fe5..b15e27b 100644 (file)
@@ -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);