mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
generic: bump minimum Katie version requirement to 4.12.0
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7448e0b21d
commit
926345627a
11 changed files with 27 additions and 257 deletions
|
@ -164,7 +164,7 @@ if(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED)
|
|||
set(_REQ_STRING_KDE4 REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(Katie ${_REQ_STRING_KDE4} 4.11.0)
|
||||
find_package(Katie ${_REQ_STRING_KDE4} 4.12.0)
|
||||
|
||||
# Check that we really found everything.
|
||||
# If KDE4 was searched with REQUIRED, we error out with FATAL_ERROR if something
|
||||
|
|
|
@ -727,56 +727,6 @@ void KIconEffect::overlay(QImage &src, QImage &overlay)
|
|||
return;
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x041200
|
||||
// Overlay at 8 bpp doesn't use alpha blending
|
||||
|
||||
if (src.depth() == 8)
|
||||
{
|
||||
if (src.colorCount() + overlay.colorCount() > 255)
|
||||
{
|
||||
kDebug(265) << "Too many colors in src + overlay!\n";
|
||||
return;
|
||||
}
|
||||
|
||||
// Find transparent pixel in overlay
|
||||
int trans;
|
||||
for (trans=0; trans<overlay.colorCount(); trans++)
|
||||
{
|
||||
if (qAlpha(overlay.color(trans)) == 0)
|
||||
{
|
||||
kDebug(265) << "transparent pixel found at " << trans << "\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (trans == overlay.colorCount())
|
||||
{
|
||||
kDebug(265) << "transparent pixel not found!\n";
|
||||
return;
|
||||
}
|
||||
|
||||
// Merge color tables
|
||||
int nc = src.colorCount();
|
||||
src.setColorCount(nc + overlay.colorCount());
|
||||
for (i=0; i<overlay.colorCount(); ++i)
|
||||
{
|
||||
src.setColor(nc+i, overlay.color(i));
|
||||
}
|
||||
|
||||
// Overwrite nontransparent pixels.
|
||||
unsigned char *oline, *sline;
|
||||
for (i=0; i<src.height(); ++i)
|
||||
{
|
||||
oline = overlay.scanLine(i);
|
||||
sline = src.scanLine(i);
|
||||
for (j=0; j<src.width(); ++j)
|
||||
{
|
||||
if (oline[j] != trans)
|
||||
sline[j] = oline[j]+nc;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // QT_VERSION < 0x041200
|
||||
|
||||
// Overlay at 32 bpp does use alpha blending
|
||||
|
||||
if (src.depth() == 32)
|
||||
|
|
|
@ -1116,9 +1116,6 @@ QPixmap KIconLoader::loadIcon(const QString& _name, KIconLoader::Group group, in
|
|||
{
|
||||
// ensure it is format supported by QPainter first
|
||||
switch (img.format()) {
|
||||
#if QT_VERSION < 0x041200
|
||||
case QImage::Format_Indexed8:
|
||||
#endif
|
||||
case QImage::Format_Mono:
|
||||
case QImage::Format_MonoLSB: {
|
||||
img = img.convertToFormat(QImage::Format_ARGB32);
|
||||
|
|
|
@ -323,11 +323,7 @@ KApplication::KApplication(Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap,
|
|||
#endif
|
||||
|
||||
KApplication::KApplication(const KComponentData &cData)
|
||||
#if QT_VERSION >= 0x041000
|
||||
: QApplication((KApplicationPrivate::preqapplicationhack(),KCmdLineArgs::qtArgc()), KCmdLineArgs::qtArgv()),
|
||||
#else
|
||||
: QApplication((KApplicationPrivate::preqapplicationhack(),KCmdLineArgs::qtArgc()), KCmdLineArgs::qtArgv(), KAPPLICATION_GUI_TYPE),
|
||||
#endif
|
||||
d (new KApplicationPrivate(this, cData))
|
||||
{
|
||||
d->read_app_startup_id();
|
||||
|
|
|
@ -333,9 +333,6 @@ struct KFontData
|
|||
const char* ConfigKey;
|
||||
const char* FontName;
|
||||
int Size;
|
||||
#if QT_VERSION < 0x041200
|
||||
QFont::StyleHint StyleHint;
|
||||
#endif
|
||||
};
|
||||
|
||||
// NOTE: keep in sync with kdebase/workspace/kcontrol/fonts/fonts.cpp
|
||||
|
@ -343,15 +340,6 @@ static const char GeneralId[] = "General";
|
|||
|
||||
static const KFontData DefaultFontData[KGlobalSettingsData::FontTypesCount] =
|
||||
{
|
||||
#if QT_VERSION < 0x041200
|
||||
{ GeneralId, "font", KDE_DEFAULT_FONT, 9, QFont::SansSerif },
|
||||
{ GeneralId, "fixed", KDE_DEFAULT_FIXED_FONT, 9, QFont::TypeWriter },
|
||||
{ GeneralId, "toolBarFont", KDE_DEFAULT_FONT, 8, QFont::SansSerif },
|
||||
{ GeneralId, "menuFont", KDE_DEFAULT_FONT, 9, QFont::SansSerif },
|
||||
{ "WM", "activeFont", KDE_DEFAULT_FONT, 8, QFont::SansSerif },
|
||||
{ GeneralId, "taskbarFont", KDE_DEFAULT_FONT, 9, QFont::SansSerif },
|
||||
{ GeneralId, "smallestReadableFont", KDE_DEFAULT_FONT, 8, QFont::SansSerif }
|
||||
#else
|
||||
{ GeneralId, "font", KDE_DEFAULT_FONT, 9 },
|
||||
{ GeneralId, "fixed", KDE_DEFAULT_FIXED_FONT, 9 },
|
||||
{ GeneralId, "toolBarFont", KDE_DEFAULT_FONT, 8 },
|
||||
|
@ -359,7 +347,6 @@ static const KFontData DefaultFontData[KGlobalSettingsData::FontTypesCount] =
|
|||
{ "WM", "activeFont", KDE_DEFAULT_FONT, 8 },
|
||||
{ GeneralId, "taskbarFont", KDE_DEFAULT_FONT, 9 },
|
||||
{ GeneralId, "smallestReadableFont", KDE_DEFAULT_FONT, 8 }
|
||||
#endif
|
||||
};
|
||||
|
||||
QFont KGlobalSettingsData::font( FontTypes fontType )
|
||||
|
@ -370,9 +357,6 @@ QFont KGlobalSettingsData::font( FontTypes fontType )
|
|||
{
|
||||
const KFontData& fontData = DefaultFontData[fontType];
|
||||
cachedFont = new QFont( fontData.FontName, fontData.Size );
|
||||
#if QT_VERSION < 0x041200
|
||||
cachedFont->setStyleHint( fontData.StyleHint );
|
||||
#endif
|
||||
|
||||
const KConfigGroup configGroup( KGlobal::config(), fontData.ConfigGroupKey );
|
||||
*cachedFont = configGroup.readEntry( fontData.ConfigKey, *cachedFont );
|
||||
|
|
|
@ -15,89 +15,13 @@
|
|||
#include <QImageReader>
|
||||
#include <QImageWriter>
|
||||
|
||||
// https://www.iana.org/assignments/media-types/media-types.xhtml#image
|
||||
static const struct ImageFormatTblData {
|
||||
const char *mime;
|
||||
const QLatin1String format;
|
||||
} ImageFormatTbl[] = {
|
||||
{ "image/png", QLatin1String("png") },
|
||||
{ "image/x-xpixmap", QLatin1String("xpm") },
|
||||
{ "image/svg+xml", QLatin1String("svg") },
|
||||
{ "image/svg+xml-compressed", QLatin1String("svgz") },
|
||||
{ "image/katie", QLatin1String("kat") },
|
||||
};
|
||||
static const qint16 ImageFormatTblSize = sizeof(ImageFormatTbl) / sizeof(ImageFormatTblData);
|
||||
|
||||
static QStringList toolkitSupported(KImageIO::Mode mode)
|
||||
{
|
||||
QStringList formats;
|
||||
if (mode == KImageIO::Reading) {
|
||||
foreach(const QByteArray &format, QImageReader::supportedImageFormats()) {
|
||||
formats << QString::fromLatin1(format.constData());
|
||||
}
|
||||
} else {
|
||||
foreach(const QByteArray &format, QImageWriter::supportedImageFormats()) {
|
||||
formats << QString::fromLatin1(format.constData());
|
||||
}
|
||||
}
|
||||
return formats;
|
||||
}
|
||||
|
||||
static QStringList toolkitSupportedMimeTypes(KImageIO::Mode mode)
|
||||
{
|
||||
QStringList mimeTypes;
|
||||
#if QT_VERSION >= 0x041200
|
||||
if (mode == KImageIO::Reading) {
|
||||
foreach(const QByteArray &mime, QImageReader::supportedMimeTypes()) {
|
||||
mimeTypes << QString::fromLatin1(mime.constData());
|
||||
}
|
||||
} else {
|
||||
foreach(const QByteArray &mime, QImageWriter::supportedMimeTypes()) {
|
||||
mimeTypes << QString::fromLatin1(mime.constData());
|
||||
}
|
||||
}
|
||||
#else
|
||||
foreach(const QString &format, toolkitSupported(mode)) {
|
||||
for(int i = 0; i < ImageFormatTblSize; i++) {
|
||||
if (ImageFormatTbl[i].format == format) {
|
||||
mimeTypes << QString::fromLatin1(ImageFormatTbl[i].mime);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return mimeTypes;
|
||||
}
|
||||
|
||||
static QStringList toolkitSupportedTypes(const QString &mimeType)
|
||||
{
|
||||
QStringList types;
|
||||
#if QT_VERSION >= 0x041200
|
||||
const QByteArray latinType = QImageReader::formatForMimeType(mimeType.toLatin1());
|
||||
if (!latinType.isEmpty()) {
|
||||
types << latinType;
|
||||
}
|
||||
#else
|
||||
const QStringList supportedMimeTypes = toolkitSupportedMimeTypes(KImageIO::Reading);
|
||||
if (!supportedMimeTypes.contains(mimeType)) {
|
||||
return types;
|
||||
}
|
||||
const QByteArray latinMimeType = mimeType.toLatin1();
|
||||
for(int i = 0; i < ImageFormatTblSize; i++) {
|
||||
if (ImageFormatTbl[i].mime == latinMimeType) {
|
||||
types << ImageFormatTbl[i].format;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return types;
|
||||
}
|
||||
|
||||
QString KImageIO::pattern(Mode mode)
|
||||
{
|
||||
QStringList patterns;
|
||||
QString allPatterns;
|
||||
QString separator("|");
|
||||
|
||||
foreach(const QString &mimeType, toolkitSupportedMimeTypes(mode)) {
|
||||
foreach(const QString &mimeType, KImageIO::mimeTypes(mode)) {
|
||||
KMimeType::Ptr mime = KMimeType::mimeType(mimeType);
|
||||
if (!mime) {
|
||||
kWarning() << "unknown toolkit mimetype " << mimeType;
|
||||
|
@ -110,29 +34,6 @@ QString KImageIO::pattern(Mode mode)
|
|||
}
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x041200
|
||||
const KService::List services = KServiceTypeTrader::self()->query("QImageIOPlugins");
|
||||
foreach(const KService::Ptr &service, services)
|
||||
{
|
||||
if ( (service->property("X-KDE-Read").toBool() && mode == Reading) ||
|
||||
(service->property("X-KDE-Write").toBool() && mode == Writing ) ) {
|
||||
|
||||
QString mimeType = service->property("X-KDE-MimeType").toString();
|
||||
if ( mimeType.isEmpty() ) continue;
|
||||
KMimeType::Ptr mime = KMimeType::mimeType(mimeType);
|
||||
if (!mime) {
|
||||
kWarning() << service->entryPath() << " specifies unknown mimetype " << mimeType;
|
||||
} else {
|
||||
QString pattern = mime->patterns().join(" ");
|
||||
patterns.append( pattern + separator + mime->comment() );
|
||||
if (!allPatterns.isEmpty() )
|
||||
allPatterns += ' ';
|
||||
allPatterns += pattern;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
allPatterns = allPatterns + separator + i18n("All Pictures");
|
||||
patterns.sort();
|
||||
patterns.prepend(allPatterns);
|
||||
|
@ -142,62 +43,45 @@ QString KImageIO::pattern(Mode mode)
|
|||
|
||||
QStringList KImageIO::typeForMime(const QString &mimeType)
|
||||
{
|
||||
QStringList result;
|
||||
if (mimeType.isEmpty()) {
|
||||
return QStringList();
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList toolkitTypes = toolkitSupportedTypes(mimeType);
|
||||
if (!toolkitTypes.isEmpty()) {
|
||||
return toolkitTypes;
|
||||
const QByteArray latinType = QImageReader::formatForMimeType(mimeType.toLatin1());
|
||||
if (!latinType.isEmpty()) {
|
||||
result << latinType;
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x041200
|
||||
const KService::List services = KServiceTypeTrader::self()->query("QImageIOPlugins");
|
||||
foreach(const KService::Ptr &service, services) {
|
||||
if ( mimeType == service->property("X-KDE-MimeType").toString() )
|
||||
return ( service->property("X-KDE-ImageFormat").toStringList() );
|
||||
}
|
||||
#endif
|
||||
|
||||
return QStringList();
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList KImageIO::mimeTypes(Mode mode)
|
||||
{
|
||||
QStringList mimeList = toolkitSupportedMimeTypes(mode);
|
||||
|
||||
#if QT_VERSION < 0x041200
|
||||
const KService::List services = KServiceTypeTrader::self()->query("QImageIOPlugins");
|
||||
foreach(const KService::Ptr &service, services) {
|
||||
if ( (service->property("X-KDE-Read").toBool() && mode == Reading) ||
|
||||
(service->property("X-KDE-Write").toBool() && mode == Writing ) ) {
|
||||
|
||||
const QString mime = service->property("X-KDE-MimeType").toString();
|
||||
if ( !mime.isEmpty() )
|
||||
mimeList.append( mime );
|
||||
QStringList result;
|
||||
if (mode == KImageIO::Reading) {
|
||||
foreach(const QByteArray &mime, QImageReader::supportedMimeTypes()) {
|
||||
result << QString::fromLatin1(mime.constData());
|
||||
}
|
||||
} else {
|
||||
foreach(const QByteArray &mime, QImageWriter::supportedMimeTypes()) {
|
||||
result << QString::fromLatin1(mime.constData());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return mimeList;
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList KImageIO::types(Mode mode)
|
||||
{
|
||||
QStringList imagetypes = toolkitSupported(mode);
|
||||
|
||||
#if QT_VERSION < 0x041200
|
||||
const KService::List services = KServiceTypeTrader::self()->query("QImageIOPlugins");
|
||||
foreach(const KService::Ptr &service, services) {
|
||||
if ( (service->property("X-KDE-Read").toBool() && mode == Reading) ||
|
||||
(service->property("X-KDE-Write").toBool() && mode == Writing ) ) {
|
||||
|
||||
imagetypes += service->property("X-KDE-ImageFormat").toStringList();
|
||||
QStringList result;
|
||||
if (mode == KImageIO::Reading) {
|
||||
foreach(const QByteArray &format, QImageReader::supportedImageFormats()) {
|
||||
result << QString::fromLatin1(format.constData());
|
||||
}
|
||||
} else {
|
||||
foreach(const QByteArray &format, QImageWriter::supportedImageFormats()) {
|
||||
result << QString::fromLatin1(format.constData());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return imagetypes;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool KImageIO::isSupported(const QString& mimeType, Mode mode)
|
||||
|
@ -206,27 +90,11 @@ bool KImageIO::isSupported(const QString& mimeType, Mode mode)
|
|||
return false;
|
||||
}
|
||||
|
||||
foreach(const QString &mime, toolkitSupportedMimeTypes(mode)) {
|
||||
foreach(const QString &mime, KImageIO::mimeTypes(mode)) {
|
||||
if (mimeType == mime) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x041200
|
||||
const KService::List services = KServiceTypeTrader::self()->query("QImageIOPlugins");
|
||||
foreach(const KService::Ptr &service, services) {
|
||||
if ( mimeType == service->property("X-KDE-MimeType").toString() ) {
|
||||
|
||||
if ( (service->property("X-KDE-Read").toBool() && mode == Reading) ||
|
||||
(service->property("X-KDE-Write").toBool() && mode == Writing ) ) {
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1607,10 +1607,6 @@ int main(int argc, char **argv)
|
|||
X11fd = initXconnection();
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x041200
|
||||
QFont::initialize();
|
||||
#endif
|
||||
|
||||
for(int i = 1; i < argc; i++)
|
||||
{
|
||||
if (safe_argv[i][0] == '+')
|
||||
|
|
|
@ -51,13 +51,8 @@
|
|||
namespace KIO { struct PreviewItem; }
|
||||
using namespace KIO;
|
||||
|
||||
#if QT_VERSION >= 0x041200
|
||||
static const QByteArray thumbFormat = QImageWriter::defaultImageFormat();
|
||||
static const QByteArray thumbExt = "." + thumbFormat;
|
||||
#else
|
||||
static const QByteArray thumbFormat = "png";
|
||||
static const QByteArray thumbExt = ".png";
|
||||
#endif
|
||||
|
||||
// NOTE: keep in sync with:
|
||||
// kde-baseapps/dolphin/src/settings/general/previewssettingspage.cpp
|
||||
|
|
|
@ -43,11 +43,7 @@ static inline QWidget* widgetForWindowID(const qlonglong windowid)
|
|||
|
||||
static inline QByteArray hashForBytes(const QByteArray &bytes)
|
||||
{
|
||||
#if QT_VERSION >= 0x041200
|
||||
return QCryptographicHash::hash(bytes, QCryptographicHash::KAT).toHex();
|
||||
#else
|
||||
return QCryptographicHash::hash(bytes, QCryptographicHash::Sha256).toHex();
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline QByteArray genBytes(const QByteArray &data, const int length)
|
||||
|
|
|
@ -36,11 +36,7 @@ static QByteArray getCookie()
|
|||
if (cookietype == "pid") {
|
||||
return QByteArray::number(::getpid());
|
||||
} else if (cookietype == "random") {
|
||||
#if QT_VERSION >= 0x041200
|
||||
return qRandomUuid();
|
||||
#else
|
||||
return QByteArray::number(qrand());
|
||||
#endif
|
||||
}
|
||||
return QByteArray::number(::getuid());
|
||||
}
|
||||
|
@ -114,11 +110,7 @@ bool KPasswdStore::storePasswd(const QByteArray &key, const QString &passwd, con
|
|||
|
||||
QByteArray KPasswdStore::makeKey(const QString &string)
|
||||
{
|
||||
#if QT_VERSION >= 0x041200
|
||||
return QCryptographicHash::hash(string.toUtf8(), QCryptographicHash::KAT).toHex();
|
||||
#else
|
||||
return QCryptographicHash::hash(string.toUtf8(), QCryptographicHash::Sha256).toHex();
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "moc_kpasswdstore.cpp"
|
||||
|
|
|
@ -48,11 +48,7 @@
|
|||
#include "plasma/private/packages_p.h"
|
||||
#include "plasma/private/wallpaper_p.h"
|
||||
|
||||
#if QT_VERSION >= 0x041200
|
||||
static const QByteArray imageFormat = QImageWriter::defaultImageFormat();
|
||||
#else
|
||||
static const QByteArray imageFormat = "png";
|
||||
#endif
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue