SUMMARY Previews for plain text files always shown as empty. STEPS TO REPRODUCE 1. Enable previews for text files. 2. Navigate to a directory with such file. 3. Hover mouse over the file OBSERVED RESULT Preview image show no content. EXPECTED RESULT Preview image show actual file content. SOFTWARE/OS VERSIONS Qt Version: 5.12.1 KDE from git master ADDITIONAL INFORMATION I've tried to build debug version of kio-extras and symlink debug texttumbnail.so to the system. Seems like dolphin does not even call ThumbCreator *new_creator(); All the other thumbnailers work, for example the one for HTML files.
I can confirm. SOFTWARE/OS VERSIONS Operating System: KDE neon Unstable Edition KDE Plasma Version: 5.15.80 KDE Frameworks Version: 5.57.0 Qt Version: 5.12.0
Created attachment 119387 [details] Works for me Works for me in the latest Neon Dev Unstable.
maybe related to this? https://bugs.kde.org/show_bug.cgi?id=406745 https://i.imgur.com/Cph7xuc.png -> file preview works, but text-color=background-color
Yes, thanks! I got previews back with these changes: diff --git a/thumbnail/CMakeLists.txt b/thumbnail/CMakeLists.txt index 966039d0..00978725 100644 --- a/thumbnail/CMakeLists.txt +++ b/thumbnail/CMakeLists.txt @@ -95,6 +95,7 @@ target_link_libraries(textthumbnail Qt5::Gui KF5::KIOWidgets KF5::SyntaxHighlighting + KF5::ConfigWidgets ) install(TARGETS textthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) diff --git a/thumbnail/textcreator.cpp b/thumbnail/textcreator.cpp index 8bdab821..806ffe25 100644 --- a/thumbnail/textcreator.cpp +++ b/thumbnail/textcreator.cpp @@ -33,6 +33,7 @@ #include <KSyntaxHighlighting/Theme> #include <KSyntaxHighlighting/Definition> #include <KDesktopFile> +#include <KColorScheme> // TODO Fix or remove kencodingprober code // #include <kencodingprober.h> @@ -136,8 +137,7 @@ bool TextCreator::create(const QString &path, int width, int height, QImage &img } } - QColor bgColor = QColor ( 245, 245, 245 ); // light-grey background - m_pixmap.fill( bgColor ); + m_pixmap.fill( KColorScheme(QPalette::Active).background().color() ); QPainter painter( &m_pixmap );
*** Bug 406745 has been marked as a duplicate of this bug. ***
Seems caused by bug #406821 in KF5's KSyntaxHighlighting.
*** This bug has been marked as a duplicate of bug 406821 ***