[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/plasma
From:       Trever Fischer <tdfischer () fedoraproject ! org>
Date:       2009-12-10 2:16:50
Message-ID: 1260411410.507913.19753.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1060831 by tdfischer:

Fixes a bug for when no event is passed.

In ContainmentPrivate::dropData, some bits assumed there was a dropEvent passed.
This doesn't always happen, for instance with ContainmentActions::paste(). The
points needed are instead taken from the scenePos and screenPos.

BUG: 196416

 M  +12 -3     containment.cpp  


--- trunk/KDE/kdelibs/plasma/containment.cpp #1060830:1060831
@@ -1294,7 +1294,10 @@
         foreach (const KUrl &url, urls) {
             if (AccessManager::supportedProtocols().contains(url.protocol())) {
                 AccessAppletJob *job = AccessManager::self()->accessRemoteApplet(url);
-                dropPoints[job] = dropEvent->pos();
+                if (dropEvent)
+                    dropPoints[job] = dropEvent->pos();
+                else
+                    dropPoints[job] = scenePos;
                 QObject::connect(AccessManager::self(), SIGNAL(finished(Plasma::AccessAppletJob*)),
                                  q, SLOT(remoteAppletReady(Plasma::AccessAppletJob*)));
             } else {
@@ -1308,14 +1311,20 @@
                 // It may be a directory or a file, let's stat
                 KIO::JobFlags flags = KIO::HideProgressInfo;
                 KIO::TransferJob *job = KIO::get(url, KIO::NoReload, flags);
-                dropPoints[job] = dropEvent->pos();
+                if (dropEvent)
+                    dropPoints[job] = dropEvent->pos();
+                else
+                    dropPoints[job] = scenePos;
                 QObject::connect(job, SIGNAL(result(KJob*)), q, SLOT(dropJobResult(KJob*)));
                 QObject::connect(job, SIGNAL(mimetype(KIO::Job *, const QString&)),
                                  q, SLOT(mimeTypeRetrieved(KIO::Job *, const QString&)));
 
                 KMenu *choices = new KMenu("Content dropped");
                 choices->addAction(KIcon("process-working"), i18n("Fetching file type..."));
-                choices->popup(dropEvent->screenPos());
+                if (dropEvent)
+                    choices->popup(dropEvent->screenPos());
+                else
+                    choices->popup(screenPos);
                 dropMenus[job] = choices;
             }
         }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic