- } else if (!applyPlace(itemUrl)) {
- // try to get a preview pixmap from the item...
- m_pendingPreview = true;
-
- // Mark the currently shown preview as outdated. This is done
- // with a small delay to prevent a flickering when the next preview
- // can be shown within a short timeframe.
- m_outdatedPreviewTimer->start();
-
- KIO::PreviewJob* job = KIO::filePreview(KUrl::List() << itemUrl,
- m_preview->width(),
- m_preview->height(),
- 0,
- 0,
- true,
- false);
- job->setIgnoreMaximumSize(true);
-
- connect(job, SIGNAL(gotPreview(const KFileItem&, const QPixmap&)),
- this, SLOT(showPreview(const KFileItem&, const QPixmap&)));
- connect(job, SIGNAL(failed(const KFileItem&)),
- this, SLOT(showIcon(const KFileItem&)));
-
- m_nameLabel->setText(itemUrl.fileName());
+ } else {
+ const KFileItem item = fileItem();
+ const KUrl itemUrl = item.url();
+ if (!applyPlace(itemUrl)) {
+ // try to get a preview pixmap from the item...
+ m_pendingPreview = true;
+
+ // Mark the currently shown preview as outdated. This is done
+ // with a small delay to prevent a flickering when the next preview
+ // can be shown within a short timeframe.
+ m_outdatedPreviewTimer->start();
+
+ KIO::PreviewJob* job = KIO::filePreview(KUrl::List() << itemUrl,
+ m_preview->width(),
+ m_preview->height(),
+ 0,
+ 0,
+ true,
+ false);
+ job->setIgnoreMaximumSize(true);
+
+ connect(job, SIGNAL(gotPreview(const KFileItem&, const QPixmap&)),
+ this, SLOT(showPreview(const KFileItem&, const QPixmap&)));
+ connect(job, SIGNAL(failed(const KFileItem&)),
+ this, SLOT(showIcon(const KFileItem&)));
+
+ m_nameLabel->setText(itemUrl.fileName());
+ }