From 847dc8273e3397f4cbb6e913a7d619cfb85a0bb6 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 22 May 2022 04:04:43 +0300 Subject: [PATCH] generic: bump minimum Katie version requirement to 4.12.0 Signed-off-by: Ivailo Monev --- .../applets/blackboard/blackboardwidget.cpp | 4 -- .../dataengines/potd/cachedprovider.cpp | 4 -- krdc/vnc/vncclientthread.cpp | 30 ----------- krdc/vnc/vncclientthread.h | 4 -- okular/core/page.cpp | 11 +--- okular/generators/xps/generator_xps.cpp | 54 ------------------- okular/generators/xps/generator_xps.h | 4 -- okular/tests/mainshelltest.cpp | 2 +- partitionmanager/src/fs/filesystem.cpp | 8 --- 9 files changed, 2 insertions(+), 119 deletions(-) diff --git a/kdeplasma-addons/applets/blackboard/blackboardwidget.cpp b/kdeplasma-addons/applets/blackboard/blackboardwidget.cpp index b7505ebc..8d1ec1a8 100644 --- a/kdeplasma-addons/applets/blackboard/blackboardwidget.cpp +++ b/kdeplasma-addons/applets/blackboard/blackboardwidget.cpp @@ -33,11 +33,7 @@ #include #include -#if QT_VERSION >= 0x041200 static const QByteArray pixmapFormat = QImageWriter::defaultImageFormat(); -#else -static const QByteArray pixmapFormat = "png"; -#endif BlackBoardWidget::BlackBoardWidget(Plasma::Applet *parent) : QGraphicsWidget(parent) diff --git a/kdeplasma-addons/dataengines/potd/cachedprovider.cpp b/kdeplasma-addons/dataengines/potd/cachedprovider.cpp index c06718be..1884cd47 100644 --- a/kdeplasma-addons/dataengines/potd/cachedprovider.cpp +++ b/kdeplasma-addons/dataengines/potd/cachedprovider.cpp @@ -29,11 +29,7 @@ #include #include -#if QT_VERSION >= 0x041200 static const QByteArray imageFormat = QImageWriter::defaultImageFormat(); -#else -static const QByteArray imageFormat = "png"; -#endif LoadImageThread::LoadImageThread(const QString &filePath) : m_filePath(filePath) diff --git a/krdc/vnc/vncclientthread.cpp b/krdc/vnc/vncclientthread.cpp index 43f60236..a395af7d 100644 --- a/krdc/vnc/vncclientthread.cpp +++ b/krdc/vnc/vncclientthread.cpp @@ -94,30 +94,6 @@ void VncClientThread::outputHandlerStatic(const char *format, ...) void VncClientThread::setClientColorDepth(rfbClient* cl, VncClientThread::ColorDepth cd) { switch(cd) { -#if QT_VERSION < 0x041200 - case bpp8: - if (m_colorTable.isEmpty()) { - m_colorTable.resize(256); - int r,g,b; - for (int i = 0; i < 256; ++i) { - //pick out the red (3 bits), green (3 bits) and blue (2 bits) bits and make them maximum significant in 8bits - //this gives a colortable for 8bit true colors - r= (i & 0x07) << 5; - g= (i & 0x38) << 2; - b= i & 0xc0; - m_colorTable[i] = qRgb(r, g, b); - } - } - cl->format.depth = 8; - cl->format.bitsPerPixel = 8; - cl->format.redShift = 0; - cl->format.greenShift = 3; - cl->format.blueShift = 6; - cl->format.redMax = 7; - cl->format.greenMax = 7; - cl->format.blueMax = 3; - break; -#endif // QT_VERSION < 0x041200 case bpp16: cl->format.depth = 16; cl->format.bitsPerPixel = 16; @@ -189,12 +165,6 @@ void VncClientThread::updatefb(int x, int y, int w, int h) const int width = cl->width, height = cl->height; QImage img; switch(colorDepth()) { -#if QT_VERSION < 0x041200 - case bpp8: - img = QImage(cl->frameBuffer, width, height, QImage::Format_Indexed8); - img.setColorTable(m_colorTable); - break; -#endif case bpp16: img = QImage(cl->frameBuffer, width, height, QImage::Format_RGB16); break; diff --git a/krdc/vnc/vncclientthread.h b/krdc/vnc/vncclientthread.h index 21c3f22a..2b26c7ff 100644 --- a/krdc/vnc/vncclientthread.h +++ b/krdc/vnc/vncclientthread.h @@ -187,10 +187,6 @@ private: RemoteView::Quality m_quality; ColorDepth m_colorDepth; QQueue m_eventQueue; -#if QT_VERSION < 0x041200 - //color table for 8bit indexed colors - QVector m_colorTable; -#endif QString outputErrorMessageString; volatile bool m_stopped; diff --git a/okular/core/page.cpp b/okular/core/page.cpp index f29182c7..0e1d16bf 100644 --- a/okular/core/page.cpp +++ b/okular/core/page.cpp @@ -64,15 +64,6 @@ static void deleteObjectRects( QList< ObjectRect * >& rects, const QSet= 0x041200 - return QString::fromLatin1(qRandomUuid()); -#else - return QString::number(qrand()); -#endif -} - PagePrivate::PagePrivate( Page *page, uint n, double w, double h, Rotation o ) : m_page( page ), m_number( n ), m_orientation( o ), m_width( w ), m_height( h ), m_doc( 0 ), m_boundingBox( 0, 0, 1, 1 ), @@ -642,7 +633,7 @@ void Page::addAnnotation( Annotation * annotation ) // Generate uniqueName: okular-UUID if(annotation->uniqueName().isEmpty()) { - QString uniqueName = "okular-" + createAnnotationID(); + QString uniqueName = QString::fromLatin1("okular-") + QString::fromLatin1(qRandomUuid()); annotation->setUniqueName( uniqueName ); } annotation->d_ptr->m_page = d; diff --git a/okular/generators/xps/generator_xps.cpp b/okular/generators/xps/generator_xps.cpp index 1e3cdf0f..33b1c625 100644 --- a/okular/generators/xps/generator_xps.cpp +++ b/okular/generators/xps/generator_xps.cpp @@ -1497,24 +1497,7 @@ QFont XpsFile::getFontByName( const QString &fileName, float size ) kWarning(XpsDebug) << "Requesting uknown font:" << fileName; return QFont(); } - -#if QT_VERSION < 0x041200 - const QStringList fontFamilies = m_fontDatabase.applicationFontFamilies( index ); - if ( fontFamilies.isEmpty() ) { - kWarning(XpsDebug) << "The unexpected has happened. No font family for a known font:" << fileName << index; - return QFont(); - } - const QString fontFamily = fontFamilies[0]; - const QStringList fontStyles = m_fontDatabase.styles( fontFamily ); - if ( fontStyles.isEmpty() ) { - kWarning(XpsDebug) << "The unexpected has happened. No font style for a known font family:" << fileName << index << fontFamily ; - return QFont(); - } - const QString fontStyle = fontStyles[0]; - return m_fontDatabase.font(fontFamily, fontStyle, qRound(size)); -#else return QFont(m_fonts.at(index)); -#endif } int XpsFile::loadFontByName( const QString &fileName ) @@ -1528,38 +1511,6 @@ int XpsFile::loadFontByName( const QString &fileName ) QByteArray fontData = readFileOrDirectoryParts( fontFile ); // once per file, according to the docs -#if QT_VERSION < 0x041200 - int result = m_fontDatabase.addApplicationFontFromData( fontData ); - if (-1 == result) { - // Try to deobfuscate font - // TODO Use deobfuscation depending on font content type, don't do it always when standard loading fails - - const QString baseName = resourceName( fileName ); - - unsigned short guid[16]; - if (!parseGUID(baseName, guid)) - { - kDebug(XpsDebug) << "File to load font - file name isn't a GUID"; - } - else - { - if (fontData.length() < 32) - { - kDebug(XpsDebug) << "Font file is too small"; - } else { - // Obfuscation - xor bytes in font binary with bytes from guid (font's filename) - const static int mapping[] = {15, 14, 13, 12, 11, 10, 9, 8, 6, 7, 4, 5, 0, 1, 2, 3}; - for (int i = 0; i < 16; i++) { - fontData[i] = fontData[i] ^ guid[mapping[i]]; - fontData[i+16] = fontData[i+16] ^ guid[mapping[i]]; - } - result = m_fontDatabase.addApplicationFontFromData( fontData ); - } - } - } - - // kDebug(XpsDebug) << "Loaded font: " << m_fontDatabase.applicationFontFamilies( result ); -#else int result = -1; KTemporaryFile tempfile; tempfile.setSuffix(QFileInfo(fileName).suffix()); @@ -1576,7 +1527,6 @@ int XpsFile::loadFontByName( const QString &fileName ) result = (m_fonts.size() - 1); // kDebug(XpsDebug) << "Saved font: " << tempfile.fileName(); -#endif // QT_VERSION return result; // a font ID } @@ -1925,13 +1875,9 @@ XpsFile::XpsFile() : m_docInfo( 0 ) XpsFile::~XpsFile() { m_fontCache.clear(); -#if QT_VERSION < 0x041200 - m_fontDatabase.removeAllApplicationFonts(); -#else foreach (const QString &fontfile, m_fonts) { QFile::remove(fontfile); } -#endif } diff --git a/okular/generators/xps/generator_xps.h b/okular/generators/xps/generator_xps.h index b06c4936..0e582eab 100644 --- a/okular/generators/xps/generator_xps.h +++ b/okular/generators/xps/generator_xps.h @@ -294,11 +294,7 @@ private: KZip * m_xpsArchive; QMap m_fontCache; -#if QT_VERSION < 0x041200 - QFontDatabase m_fontDatabase; -#else QStringList m_fonts; -#endif }; diff --git a/okular/tests/mainshelltest.cpp b/okular/tests/mainshelltest.cpp index 448ec456..4fdf2e1c 100644 --- a/okular/tests/mainshelltest.cpp +++ b/okular/tests/mainshelltest.cpp @@ -455,6 +455,6 @@ void MainShellTest::testUnique2FilesError() QVERIFY(!s); } - QTEST_KDEMAIN( MainShellTest, GUI ) + #include "mainshelltest.moc" diff --git a/partitionmanager/src/fs/filesystem.cpp b/partitionmanager/src/fs/filesystem.cpp index 57eb8047..e68d446f 100644 --- a/partitionmanager/src/fs/filesystem.cpp +++ b/partitionmanager/src/fs/filesystem.cpp @@ -28,10 +28,6 @@ #include -#if QT_VERSION < 0x041200 -# include -#endif - /** Creates a new FileSystem object @param firstsector the first sector used by this FileSystem on the Device @param lastsector the last sector used by this FileSystem on the Device @@ -397,11 +393,7 @@ bool FileSystem::findExternal(const QString& cmdName, const QStringList& args, i */ QString FileSystem::createUUID() { -#if QT_VERSION >= 0x041200 return QString::fromLatin1(qRandomUuid()); -#else - return QUuid::createUuid().toString().remove(QRegExp("\\{|\\}")); -#endif } FileSystem::Type FileSystem::defaultFileSystem()