diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ad621c9..0d53347a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,198 +1,199 @@ cmake_minimum_required(VERSION 3.0) # KDE Applications Version, managed by release script set (KDE_APPLICATIONS_VERSION_MAJOR "19") set (KDE_APPLICATIONS_VERSION_MINOR "03") set (KDE_APPLICATIONS_VERSION_MICRO "70") set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") project(kio-extras VERSION ${KDE_APPLICATIONS_VERSION}) include(FeatureSummary) set(QT_MIN_VERSION "5.8.0") set(KF5_MIN_VERSION "5.48.0") find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS DBus Network Widgets Svg) find_package(Qt5Test ${QT_MIN_VERSION} CONFIG QUIET) set_package_properties(Qt5Test PROPERTIES PURPOSE "Required for tests" TYPE OPTIONAL ) add_feature_info("Qt5Test" Qt5Test_FOUND "Required for building tests") if (NOT Qt5Test_FOUND) set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.") endif() find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Archive Config ConfigWidgets CoreAddons DBusAddons DocTools DNSSD IconThemes I18n KIO Solid Bookmarks GuiAddons + SyntaxHighlighting ) # As this is the check used for linkage, only require it in the same location... if (UNIX) find_package(KF5Pty ${KF5_MIN_VERSION} REQUIRED) endif() include(CheckIncludeFile) include(CMakePackageConfigHelpers) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(ECMMarkNonGuiExecutable) include(ECMMarkAsTest) include(ECMOptionalAddSubdirectory) include(ECMQtDeclareLoggingCategory) add_definitions(-DQT_NO_URL_CAST_FROM_STRING) find_package(KF5Activities QUIET) set_package_properties(KF5Activities PROPERTIES PURPOSE "Provides the activities:/ kioslave and fileitem plugin." TYPE OPTIONAL ) find_package(Phonon4Qt5 4.6.60 NO_MODULE) set_package_properties(Phonon4Qt5 PROPERTIES DESCRIPTION "Qt-based audio library" PURPOSE "Required for the audio preview plugin" TYPE OPTIONAL) include_directories(${CMAKE_CURRENT_BINARY_DIR}) if(NOT WIN32) # we need a version of samba which has already smbc_set_context(), Alex set(SAMBA_REQUIRE_SMBC_SET_CONTEXT TRUE) set(SAMBA_REQUIRE_SMBC_OPTION_SET TRUE) find_package(Samba) set_package_properties(Samba PROPERTIES DESCRIPTION "the SMB client library, a version with smbc_set_context() and smbc_option_set()" URL "https://www.samba.org/" TYPE OPTIONAL PURPOSE "Needed to build the SMB kioslave" ) endif() find_package(libssh 0.7.0 MODULE) set_package_properties(libssh PROPERTIES DESCRIPTION "the SSH library with SFTP support" URL "https://www.libssh.org/" TYPE OPTIONAL PURPOSE "Needed to build the SFTP kioslave" ) find_package(Mtp) set_package_properties(Mtp PROPERTIES DESCRIPTION "the MTP library" URL "http://libmtp.sourceforge.net/" TYPE OPTIONAL PURPOSE "Needed to build the MTP kioslave" ) check_include_file(utime.h HAVE_UTIME_H) # ECM's KDECompilerSettings.cmake should take care of enabling supporting on # 32bit architectures. # Thorw a fatal error if off_t isn't >=64bit to ensure that large files are working # as expected. # BUG: 165449 if(UNIX) check_cxx_source_compiles(" #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main() { return 0; } " OFFT_IS_64BIT) if(NOT OFFT_IS_64BIT) message(FATAL_ERROR "Large file support is not enabled.") endif() find_package(Gperf) set_package_properties(Gperf PROPERTIES TYPE OPTIONAL PURPOSE "Needed to build the man kioslave" ) find_package(KF5KHtml QUIET) set_package_properties(KF5KHtml PROPERTIES TYPE OPTIONAL PURPOSE "Needed to build the man kioslave" ) else() # FIXME: on windows we ignore support until trash gets integrated endif() add_subdirectory( doc ) add_subdirectory( about ) if(KF5Activities_FOUND) add_subdirectory( activities ) endif() add_subdirectory( bookmarks ) add_subdirectory( filter ) if(Phonon4Qt5_FOUND) add_subdirectory( kfileaudiopreview ) endif() add_subdirectory( info ) add_subdirectory( archive ) if(NOT WIN32) add_subdirectory( network ) endif() add_subdirectory( recentdocuments ) if (NOT WIN32) # does not compile: fish.cpp(41): fatal error C1083: Cannot open include file: 'sys/resource.h': No such file or directory # Used for getting the resource limit for closing all child process FDs. Could be completely replaced by fcloseall() if available for Unix or _fcloseall() for Windows, either conditionally on Q_OS_type or using a configure test. add_subdirectory( fish ) endif() add_subdirectory( thumbnail ) add_subdirectory( docfilter ) if (libssh_FOUND AND HAVE_UTIME_H) # does not compile on Windows: kio_sftp.cpp(28): fatal error C1083: Cannot open include file: 'utime.h': No such file or directory add_subdirectory(sftp) endif () add_subdirectory(settings) add_subdirectory( filenamesearch ) if (MTP_FOUND) add_subdirectory(mtp) endif() if(NOT WIN32) if(Gperf_FOUND AND KF5KHtml_FOUND) add_subdirectory( man ) endif() check_include_files(rpc/rpc.h HAVE_RPC_RPC_H) add_feature_info("NFS kioslave" HAVE_RPC_RPC_H "The RPC library is needed to build the NFS kioslave") if(HAVE_RPC_RPC_H) add_subdirectory( nfs ) endif() endif() # KDNSSD before 5.54 suffers from a race condition in avahi's dbus API and # ideally should not be used in ways that can deadlock a slave. if(${KF5DNSSD_FOUND} AND ${KF5DNSSD_VERSION} VERSION_GREATER "5.53") set(HAVE_KDNSSD_WITH_SIGNAL_RACE_PROTECTION TRUE) endif() if(SAMBA_FOUND) add_subdirectory(smb) endif() configure_file (config-runtime.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-runtime.h ) install( FILES kio-extras.categories DESTINATION ${KDE_INSTALL_CONFDIR} ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/thumbnail/CMakeLists.txt b/thumbnail/CMakeLists.txt index cd33d879..966039d0 100644 --- a/thumbnail/CMakeLists.txt +++ b/thumbnail/CMakeLists.txt @@ -1,276 +1,277 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kio5_thumbnail\") find_package(OpenEXR) set_package_properties(OpenEXR PROPERTIES DESCRIPTION "API for accessing OpenEXR formatted images" URL "http://www.openexr.com" TYPE OPTIONAL PURPOSE "Provides support for OpenEXR formatted images in the thumbnail kioslave" ) find_package(libappimage 0.1.10 CONFIG) set_package_properties(libappimage PROPERTIES DESCRIPTION "Core library of the AppImage project" URL "https://github.com/AppImage/libappimage" TYPE OPTIONAL PURPOSE "Provides support for AppImage thumbnails" ) include_directories(${CMAKE_BINARY_DIR}) ########### next target ############### set(kio_thumbnail_PART_SRCS thumbnail.cpp imagefilter.cpp) add_library(kio_thumbnail MODULE ${kio_thumbnail_PART_SRCS}) target_link_libraries(kio_thumbnail KF5::CoreAddons KF5::KIOCore KF5::KIOWidgets KF5::Solid KF5::IconThemes KF5::I18n ) set_target_properties(kio_thumbnail PROPERTIES OUTPUT_NAME "thumbnail") install(TARGETS kio_thumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio) ########### next target ############### set(imagethumbnail_PART_SRCS imagecreator.cpp) add_library(imagethumbnail MODULE ${imagethumbnail_PART_SRCS}) target_link_libraries(imagethumbnail KF5::KIOWidgets ) install(TARGETS imagethumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) ########### next target ############### install( FILES directorythumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) ########### next target ############### set(jpegthumbnail_PART_SRCS jpegcreator.cpp) kconfig_add_kcfg_files(jpegthumbnail_PART_SRCS jpegcreatorsettings5.kcfgc) add_library(jpegthumbnail MODULE ${jpegthumbnail_PART_SRCS}) target_link_libraries(jpegthumbnail Qt5::Core Qt5::Gui KF5::KIOCore KF5::KIOWidgets KF5::I18n KF5::ConfigCore KF5::ConfigGui ) install(FILES jpegcreatorsettings5.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR}) install(TARGETS jpegthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) ########### next target ############### set(svgthumbnail_PART_SRCS svgcreator.cpp) add_library(svgthumbnail MODULE ${svgthumbnail_PART_SRCS}) target_link_libraries(svgthumbnail Qt5::Gui Qt5::Svg KF5::KIOCore KF5::KIOWidgets ) install(TARGETS svgthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) ########### next target ############### set(textthumbnail_PART_SRCS textcreator.cpp) add_library(textthumbnail MODULE ${textthumbnail_PART_SRCS}) target_link_libraries(textthumbnail Qt5::Gui KF5::KIOWidgets + KF5::SyntaxHighlighting ) install(TARGETS textthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) ########### next target ############### if(NOT WIN32) set(djvuthumbnail_PART_SRCS djvucreator.cpp) add_library(djvuthumbnail MODULE ${djvuthumbnail_PART_SRCS}) target_link_libraries(djvuthumbnail KF5::KIOWidgets) install(TARGETS djvuthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) install(FILES djvuthumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) endif() ########### next target ############### if(OpenEXR_FOUND) set(exrthumbnail_PART_SRCS exrcreator.cpp) add_library(exrthumbnail MODULE ${exrthumbnail_PART_SRCS}) target_link_libraries(exrthumbnail KF5::KIOCore KF5::KIOWidgets ${OpenEXR_LIBRARIES} ) target_include_directories(exrthumbnail SYSTEM PRIVATE ${OpenEXR_INCLUDE_DIRS}) # OpenEXR headers use exceptions; at least clang refuses to build the target # when exceptions are not enabled. kde_source_files_enable_exceptions(exrcreator.cpp) install(TARGETS exrthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) install( FILES exrthumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) endif() ########### next target ############### # if(X11_Xcursor_FOUND) # # set(cursorthumbnail_PART_SRCS cursorcreator.cpp) # # add_library(cursorthumbnail MODULE ${cursorthumbnail_PART_SRCS}) # # target_link_libraries(cursorthumbnail ${X11_Xcursor_LIB} ${KIO_LIBRARIES}) # # install(TARGETS cursorthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) # install( FILES cursorthumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) # # endif() # ########### next target ############### set ( windowsexethumbnail_SRCS windowsexecreator.cpp icoutils_common.cpp) set ( windowsimagethumbnail_SRCS windowsimagecreator.cpp icoutils_common.cpp) if(WIN32) set ( windowsexethumbnail_SRCS ${windowsexethumbnail_SRCS} icoutils_win.cpp ) set ( windowsimagethumbnail_SRCS ${windowsimagethumbnail_SRCS} icoutils_win.cpp ) else() set ( windowsexethumbnail_SRCS ${windowsexethumbnail_SRCS} icoutils_wrestool.cpp ) set ( windowsimagethumbnail_SRCS ${windowsimagethumbnail_SRCS} icoutils_wrestool.cpp ) endif() add_library(windowsexethumbnail MODULE ${windowsexethumbnail_SRCS} ) target_link_libraries ( windowsexethumbnail KF5::KIOWidgets ) install ( TARGETS windowsexethumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR} ) install ( FILES windowsexethumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) add_library(windowsimagethumbnail MODULE ${windowsimagethumbnail_SRCS} ) target_link_libraries ( windowsimagethumbnail KF5::KIOWidgets ) install ( TARGETS windowsimagethumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR} ) install ( FILES windowsimagethumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) ########### next target ############### set(comicbookthumbnail_SRCS comiccreator.cpp) add_library(comicbookthumbnail MODULE ${comicbookthumbnail_SRCS}) target_link_libraries(comicbookthumbnail Qt5::Gui KF5::Archive KF5::KIOWidgets ) if (UNIX) target_link_libraries(comicbookthumbnail KF5::Pty) endif () install(TARGETS comicbookthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) # ########### next target ############### set(kritathumbnail_SRCS kritacreator.cpp) add_library(kritathumbnail MODULE ${kritathumbnail_SRCS}) target_link_libraries(kritathumbnail KF5::KIOWidgets KF5::Archive Qt5::Gui ) install(TARGETS kritathumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) ########### next target ################# find_package(Taglib 1.11) if(TAGLIB_FOUND) set(audiothumbnail_SRCS audiocreator.cpp) add_library(audiothumbnail MODULE ${audiothumbnail_SRCS}) target_include_directories(audiothumbnail BEFORE PRIVATE ${TAGLIB_INCLUDES}) target_link_libraries(audiothumbnail ${TAGLIB_LIBRARIES} KF5::KIOWidgets) install(TARGETS audiothumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) set(audiothumbnail_desktop audiothumbnail.desktop) endif(TAGLIB_FOUND) # ########### next target ############### set(opendocumentthumbnail_SRCS opendocumentcreator.cpp) add_library(opendocumentthumbnail MODULE ${opendocumentthumbnail_SRCS}) target_link_libraries(opendocumentthumbnail Qt5::Gui KF5::KIOWidgets KF5::Archive ) install(TARGETS opendocumentthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) # ########### next target ############### if(libappimage_FOUND) set(appimagethumbnail_SRCS appimagecreator.cpp) add_library(appimagethumbnail MODULE ${appimagethumbnail_SRCS}) target_link_libraries(appimagethumbnail KF5::KIOWidgets Qt5::Gui libappimage ) install(TARGETS appimagethumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) install(FILES appimagethumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) endif() # ########### next target ############### set(ebookthumbnail_SRCS ebookcreator.cpp) add_library(ebookthumbnail MODULE ${ebookthumbnail_SRCS}) target_link_libraries(ebookthumbnail Qt5::Gui KF5::KIOWidgets KF5::Archive ) install(TARGETS ebookthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}) ########### install files ############### install(FILES thumbcreator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR}) install(FILES thumbnail.protocol svgthumbnail.desktop imagethumbnail.desktop jpegthumbnail.desktop textthumbnail.desktop # desktopthumbnail.desktop comicbookthumbnail.desktop kraorathumbnail.desktop opendocumentthumbnail.desktop ebookthumbnail.desktop ${audiothumbnail_desktop} DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) diff --git a/thumbnail/textcreator.cpp b/thumbnail/textcreator.cpp index 165bb976..3cbd0da7 100644 --- a/thumbnail/textcreator.cpp +++ b/thumbnail/textcreator.cpp @@ -1,173 +1,190 @@ /* This file is part of the KDE libraries Copyright (C) 2000,2002 Carsten Pfeiffer 2000 Malte Starostik This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "textcreator.h" #include #include #include #include #include #include #include +#include +#include +#include +#include #include // TODO Fix or remove kencodingprober code // #include extern "C" { Q_DECL_EXPORT ThumbCreator *new_creator() { return new TextCreator; } } TextCreator::TextCreator() : m_data(nullptr), m_dataSize(0) { } TextCreator::~TextCreator() { delete [] m_data; } static QTextCodec *codecFromContent(const char *data, int dataSize) { #if 0 // ### Use this when KEncodingProber does not return junk encoding for UTF-8 data) KEncodingProber prober; prober.feed(data, dataSize); return QTextCodec::codecForName(prober.encoding()); #else QByteArray ba = QByteArray::fromRawData(data, dataSize); // try to detect UTF text, fall back to locale default (which is usually UTF-8) return QTextCodec::codecForUtfText(ba, QTextCodec::codecForLocale()); #endif } bool TextCreator::create(const QString &path, int width, int height, QImage &img) { // Bug 220330: desktop files aren't traditional text files if (KDesktopFile::isDesktopFile(path)) { return false; } bool ok = false; // determine some sizes... // example: width: 60, height: 64 QSize pixmapSize( width, height ); if (height * 3 > width * 4) pixmapSize.setHeight( width * 4 / 3 ); else pixmapSize.setWidth( height * 3 / 4 ); if ( pixmapSize != m_pixmap.size() ) m_pixmap = QPixmap( pixmapSize ); // one pixel for the rectangle, the rest. whitespace int xborder = 1 + pixmapSize.width()/16; // minimum x-border int yborder = 1 + pixmapSize.height()/16; // minimum y-border // this font is supposed to look good at small sizes QFont font = QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont); font.setPixelSize( qMax(7, qMin( 10, ( pixmapSize.height() - 2 * yborder ) / 16 ) ) ); QFontMetrics fm( font ); // calculate a better border so that the text is centered - int canvasWidth = pixmapSize.width() - 2*xborder; - int canvasHeight = pixmapSize.height() - 2*yborder; - int numLines = (int) ( canvasHeight / fm.height() ); + const QSizeF canvasSize(pixmapSize.width() - 2 * xborder, pixmapSize.height() - 2 * yborder); + const int numLines = (int) (canvasSize.height() / fm.height()); // assumes an average line length of <= 120 chars const int bytesToRead = 120 * numLines; // create text-preview QFile file( path ); if ( file.open( QIODevice::ReadOnly )) { if ( !m_data || m_dataSize < bytesToRead + 1 ) { delete [] m_data; m_data = new char[bytesToRead+1]; m_dataSize = bytesToRead + 1; } int read = file.read( m_data, bytesToRead ); if ( read > 0 ) { ok = true; m_data[read] = '\0'; QString text = codecFromContent( m_data, read )->toUnicode( m_data, read ).trimmed(); // FIXME: maybe strip whitespace and read more? // If the text contains tabs or consecutive spaces, it is probably // formatted using white space. Use a fixed pitch font in this case. QStringList textLines = text.split( '\n' ); foreach ( const QString &line, textLines ) { QString trimmedLine = line.trimmed(); if ( trimmedLine.contains( '\t' ) || trimmedLine.contains( " " ) ) { font.setFamily( QFontDatabase::systemFont(QFontDatabase::FixedFont).family()); break; } } #if 0 QPalette palette; QColor bgColor = palette.color( QPalette::Base ); - QColor fgColor = palette.color( QPalette::Text ); if ( qGray( bgColor.rgb() ) > qGray( fgColor.rgb() ) ) { bgColor = bgColor.darker( 103 ); } else { bgColor = bgColor.lighter( 103 ); } #else QColor bgColor = QColor ( 245, 245, 245 ); // light-grey background - QColor fgColor = Qt::black; #endif m_pixmap.fill( bgColor ); QPainter painter( &m_pixmap ); - painter.setFont( font ); - painter.setPen( fgColor ); + + QTextDocument textDocument(text); + + // QTextDocument only supports one margin value for all borders, + // so we do a page-in-page behind its back, and do our own borders + textDocument.setDocumentMargin(0); + textDocument.setPageSize(canvasSize); + textDocument.setDefaultFont(font); QTextOption textOption( Qt::AlignTop | Qt::AlignLeft ); textOption.setTabStop( 8 * painter.fontMetrics().width( ' ' ) ); textOption.setWrapMode( QTextOption::WrapAtWordBoundaryOrAnywhere ); - painter.drawText( QRect( xborder, yborder, canvasWidth, canvasHeight ), text, textOption ); + textDocument.setDefaultTextOption(textOption); + + KSyntaxHighlighting::SyntaxHighlighter syntaxHighlighter(&textDocument); + syntaxHighlighter.setDefinition(m_highlightingRepository.definitionForFileName(path)); + const auto highlightingTheme = m_highlightingRepository.defaultTheme(KSyntaxHighlighting::Repository::LightTheme); + syntaxHighlighter.setTheme(highlightingTheme); + + // draw page-in-page, with clipping as needed + painter.translate(xborder, yborder); + textDocument.drawContents(&painter, QRectF(QPointF(0, 0), canvasSize)); + painter.end(); img = m_pixmap.toImage(); } file.close(); } return ok; } ThumbCreator::Flags TextCreator::flags() const { return (Flags)BlendIcon; } diff --git a/thumbnail/textcreator.h b/thumbnail/textcreator.h index 0de7aaf4..b5d10dee 100644 --- a/thumbnail/textcreator.h +++ b/thumbnail/textcreator.h @@ -1,40 +1,43 @@ /* This file is part of the KDE libraries Copyright (C) 2000 Malte Starostik This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _TEXTCREATOR_H_ #define _TEXTCREATOR_H_ #include #include +#include class TextCreator : public ThumbCreator { public: TextCreator(); ~TextCreator() override; bool create(const QString &path, int width, int height, QImage &img) override; Flags flags() const override; private: char *m_data; int m_dataSize; QPixmap m_pixmap; + + KSyntaxHighlighting::Repository m_highlightingRepository; }; #endif