[utilities/konsole] src/filterHotSpots: Revert "Fix warnings from PreviewJob"

Friedrich W. H. Kossebau <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 5cb5d264447f5ca5fb265fa2098890e585505376 by Friedrich W. H. Kossebau.
Committed on 30/07/2026 at 20:42.
Pushed by kossebau into branch 'master'.

Revert "Fix warnings from PreviewJob"

This reverts commit d6803ec769160acea2a14f77e08523d62f7f3487.

The use of KFileItem: exists() here misses initialization with the information
from a stat call. As result in turn now there have been warnings like
kf.kio.core: KFileItem: exists called when not initialised QUrl("file:///home/user/some.txt")

M  +3    -6    src/filterHotSpots/FileFilterHotspot.cpp

https://invent.kde.org/utilities/konsole/-/commit/5cb5d264447f5ca5fb265fa2098890e585505376

diff --git a/src/filterHotSpots/FileFilterHotspot.cpp b/src/filterHotSpots/FileFilterHotspot.cpp
index 73d1460e9..1ec7d600c 100644
--- a/src/filterHotSpots/FileFilterHotspot.cpp
+++ b/src/filterHotSpots/FileFilterHotspot.cpp
@@ -262,6 +262,8 @@ void FileFilterHotSpot::thumbnailRequested()
         return;
     }
 
+    // TODO: check (async) if file actually exists, to prevent a warning from KIO::PreviewJob
+
     _thumbnailPos = QPoint(_eventPos.x() + 100, _eventPos.y() - settings->thumbnailSize() / 2);
 
     const int size = KonsoleSettings::thumbnailSize();
@@ -271,11 +273,6 @@ void FileFilterHotSpot::thumbnailRequested()
 
     _thumbnailFinished = false;
 
-    const auto fileItem = this->fileItem();
-    if (!fileItem.exists()) {
-        return;
-    }
-
     // Show a "Loading" if Preview takes a long time.
     QTimer::singleShot(10, this, [this] {
         if (_previewJob == nullptr) {
@@ -286,7 +283,7 @@ void FileFilterHotSpot::thumbnailRequested()
         }
     });
 
-    _previewJob = new KIO::PreviewJob(KFileItemList({fileItem}), QSize(size, size));
+    _previewJob = new KIO::PreviewJob(KFileItemList({fileItem()}), QSize(size, size));
     connect(_previewJob, &KIO::PreviewJob::gotPreview, this, &FileFilterHotSpot::showThumbnail);
     connect(_previewJob, &KIO::PreviewJob::failed, this, [] {
         qCDebug(KonsoleDebug) << "Error generating the preview" << _previewJob->errorString();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.