-
- if (destUrl == m_destItemCache.url()) {
- // We already received events for this URL, and already have the
- // stat result cached because:
- // 1. it's a local file, and we already called KFileItem(destUrl)
- // 2. it's a remote file, and StatJob finished
- processEvent(event);
- return;
- }
-
- if (m_statJob) {
- if (destUrl == m_statJobUrl) {
- // We already received events for this URL. Still waiting for
- // the stat result. StatJob will process the event when it finishes.
- m_lastUndecidedEvent = event;
- return;
- }
-
- // We are waiting for the stat result of a different URL. Cancel.
- m_statJob->kill();
- m_statJob = nullptr;
- m_statJobUrl.clear();
- }
-
- if (destUrl.isLocalFile()) {
- // New local URL. KFileItem will stat on demand.
- m_destItemCache = KFileItem(destUrl);
- m_destItemCacheInvalidationTimer.start();
- processEvent(event);
- return;
+ KFileItem item(destUrl);
+ if (!item.isLocalFile() || supportsDropping(item)) {
+ event->setDropAction(event->proposedAction());
+ event->accept();
+ } else {
+ event->setDropAction(Qt::IgnoreAction);
+ event->ignore();