Changeset 473 for trunk/src/gui/kernel/qdnd_pm.cpp
- Timestamp:
- Jan 25, 2010, 8:52:56 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qdnd_pm.cpp
r472 r473 799 799 bool isExclusive() const { return true; } 800 800 ULONG itemCount() const { return 0; } 801 HWND hwnd() const ;801 HWND hwnd() const 802 802 DRAGINFO *createDragInfo(const QString &targetName, USHORT supportedOps); 803 803 … … 807 807 private: 808 808 QList<DragWorker*> workers; 809 // todo check workers!810 //QPtrList<DragWorker> workers;811 809 DRAGINFO *info; 812 810 }; … … 944 942 } 945 943 946 HWND QPMCoopDragWorker::hwnd() const947 {948 if (!workers.count()) {949 // The drag source doesn't provide any format; will handle it ourselves950 } else {951 DragWorker *firstWorker = workers.first();952 if (firstWorker->isExclusive() && firstWorker->itemCount() == 0) {953 // this is a super exclusive worker that will do everything on its own954 return firstWorker->hwnd();955 }956 }957 958 return QPMObjectWindow::hwnd();959 }960 961 944 void QPMCoopDragWorker::init() 962 945 { … … 1005 988 } 1006 989 1007 item->hwndItem = hwnd();990 item->hwndItem = ; 1008 991 item->ulItemID = 0; 1009 992 item->hstrType = 0; … … 1140 1123 ULONG itemCnt = DrgQueryDragitemCount(info); 1141 1124 ULONG index = 0; 1142 for (; index < 1125 for (; index < itemCnt; ++index) 1143 1126 if (DrgQueryDragitemPtr(info, index) == xfer->pditem) 1144 1127 break; … … 1172 1155 } 1173 1156 1174 if (msg == DM_RENDER || msg == DM_ENDCONVERSATION) { 1175 DEBUG(() << "Drop target sent DM_RENDER or DM_ENDCONVERSATION to the " 1176 "drag source window instead of the drag item window!"); 1177 if (msg == DM_RENDER) { 1178 // free the given DRAGTRANSFER structure to avoud memory leak 1179 DRAGTRANSFER *xfer = (DRAGTRANSFER *)mp1; 1180 if (xfer) 1181 qt_DrgFreeDragtransfer(xfer); 1157 if (msg == DM_RENDER) { 1158 DEBUG(() << "Drop target sent DM_RENDER to the drag source window " 1159 "instead of the drag item window, will try to forward!"); 1160 DRAGTRANSFER *xfer = (DRAGTRANSFER *)mp1; 1161 Q_ASSERT(xfer && xfer->pditem); 1162 if (xfer && xfer->pditem && 1163 xfer->pditem->hwndItem && xfer->pditem->hwndItem != hwnd()) 1164 return WinSendMsg(xfer->pditem->hwndItem, msg, mp1, mp2); 1165 } 1166 else 1167 if (msg == DM_ENDCONVERSATION) { 1168 DEBUG(() << "Drop target sent DM_CONVERSATION to the drag source window " 1169 "instead of the drag item window, will try to forward!"); 1170 if (info) { 1171 ULONG itemId = LONGFROMMP(mp1); 1172 // find the item by ID 1173 ULONG itemCnt = DrgQueryDragitemCount(info); 1174 for (ULONG index = 0; index < itemCnt; ++index) { 1175 PDRAGITEM item = DrgQueryDragitemPtr(info, index); 1176 if (item->ulItemID == itemId && 1177 item->hwndItem && item->hwndItem != hwnd()) 1178 return WinSendMsg(item->hwndItem, msg, mp1, mp2); 1179 } 1182 1180 } 1183 1181 }
Note:
See TracChangeset
for help on using the changeset viewer.