Ignore:
Timestamp:
Jan 25, 2010, 5:03:17 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: DnD: Replaced r470 with a better solution (simpler and doesn't report a dummy mime type "" in the dropped mime data -- for compatibility with other platforms).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qdnd_pm.cpp

    r470 r471  
    611611            DrgFreeDraginfo(info);
    612612
     613
     614
    613615            return MRFROM2SHORT(dropReply, toPmDragDropOp(dragData->lastAction));
    614616        }
     
    913915    }
    914916
    915     if (!mimeData->formats().count()) {
    916         // The drag source doesn't provide any format, so we've got no workers.
    917         // Although it may look strange, but it is a supported case: for
    918         // example, designer uses it a lot for in-process DnD. Instead of MIME
    919         // data, it works directly with the QMimeData object from the drag
    920         // source. We will go through the converters passing a special value of
    921         // QString::null as MIME type -- one of them (e.g. QPMAnyMime) should
    922         // take it over and return itself.
    923         Q_ASSERT(!workers.count());
    924         DEBUG(() << "QPMCoopDragWorker: Source provides NO data, looking for a "
    925                     "converter that can handle this");
    926         foreach (QPMMime *mime, QPMMime::all()) {
    927             DragWorker *wrk = mime->dragWorkerFor(QString::null, mimeData);
    928             if (wrk) {
    929                 workers.append(wrk);
    930                 break;
    931             }
    932         }
    933     }
    934 
    935917#if defined(QDND_DEBUG)
    936918    foreach (DragWorker *wrk, workers) {
     
    941923#endif
    942924
     925
     926
     927
     928
     929
     930
     931
     932
     933
     934
     935
     936
    943937    Q_ASSERT(workers.count() > 0);
    944938    return workers.count() > 0;
     
    947941HWND QPMCoopDragWorker::hwnd() const
    948942{
    949     DragWorker *firstWorker = workers.first();
    950     Q_ASSERT(firstWorker);
    951     if (!firstWorker)
    952         return 0;
    953 
    954     if (firstWorker->isExclusive() && firstWorker->itemCount() == 0) {
    955         // this is a super exclusive worker that will do everything on its own
    956         return firstWorker->hwnd();
     943   
     944   
     945   
     946        ;
     947        if (firstWorker->isExclusive() && firstWorker->itemCount() == 0) {
     948   
     949       
     950       
    957951    }
    958952
     
    989983    if (info)
    990984        return 0;
     985
     986
     987
     988
     989
     990
     991
     992
     993
     994
     995
     996
     997
     998
     999
     1000
     1001
     1002
     1003
     1004
     1005
     1006
     1007
     1008
     1009
     1010
     1011
     1012
     1013
     1014
     1015
    9911016
    9921017    DragWorker *firstWorker = workers.first();
Note: See TracChangeset for help on using the changeset viewer.