Skip to content

Commit

Permalink
Update KDE Thumbnailer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghabry committed Sep 25, 2020
1 parent 6f4dcbd commit 168bde0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion xyz-thumbnailer/kde/COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016 xyz-kde-thumbnailer authors
Copyright (c) 2020 xyz-kde-thumbnailer authors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
9 changes: 4 additions & 5 deletions xyz-thumbnailer/kde/src/xyz.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* This file is part of kde-xyz-thumbnailer. Copyright (c) 2017 kde-xyz-thumbnailer authors.
* This file is part of kde-xyz-thumbnailer. Copyright (c) 2020 kde-xyz-thumbnailer authors.
* https://github.com/EasyRPG/Tools - https://easyrpg.org
*
* kde-xyz-thumbnailer is Free/Libre Open Source Software, released under the MIT License.
Expand Down Expand Up @@ -67,15 +67,15 @@ QImageIOHandler* XyzImageIOPlugin::create(QIODevice *device, const QByteArray &f

QImageIOPlugin::Capabilities XyzImageIOPlugin::capabilities(QIODevice *device, const QByteArray &format) const {
if (format.isNull() && !device) {
return 0;
return {};
}

if (!format.isNull() && format.toLower() != "xyz") {
return 0;
return {};
}

if (device && !XyzImageIOHandler::canRead(device)) {
return 0;
return {};
}

return CanRead;
Expand Down Expand Up @@ -162,7 +162,6 @@ bool XyzImage::toImage(char* data, size_t size, QImage &img) {
*dst++ = 255;
}
}

QImage q((uchar*)pixels, w, h, QImage::Format_ARGB32);
img = q;

Expand Down
14 changes: 7 additions & 7 deletions xyz-thumbnailer/kde/src/xyz.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* This file is part of kde-xyz-thumbnailer. Copyright (c) 2017 kde-xyz-thumbnailer authors.
* This file is part of kde-xyz-thumbnailer. Copyright (c) 2020 kde-xyz-thumbnailer authors.
* https://github.com/EasyRPG/Tools - https://easyrpg.org
*
* kde-xyz-thumbnailer is Free/Libre Open Source Software, released under the MIT License.
Expand All @@ -16,8 +16,8 @@
// Required by KDE ThumbCreator
class XyzThumbnailCreator : public ThumbCreator {
public:
virtual bool create(const QString &path, int width, int height, QImage &img);
Flags flags() const;
virtual bool create(const QString &path, int width, int height, QImage &img) override;
Flags flags() const override;
};

// Required by QImageIOPlugin
Expand All @@ -28,15 +28,15 @@ class XyzImageIOPlugin : public QImageIOPlugin {
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "qxyz.json")

public:
Capabilities capabilities(QIODevice *device, const QByteArray &format) const;
QImageIOHandler* create(QIODevice *device, const QByteArray &format) const;
Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
QImageIOHandler* create(QIODevice *device, const QByteArray &format) const override;
};

class XyzImageIOHandler : public QImageIOHandler {
public:
bool canRead() const;
bool canRead() const override;
static bool canRead(QIODevice *device);
bool read(QImage* image);
bool read(QImage* image) override;
};

// Shared code for creating a XYZ QImage
Expand Down
1 change: 1 addition & 0 deletions xyz-thumbnailer/kde/src/xyzthumbnail.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ MimeType=image/xyz;
CacheThumbnail=true
X-KDE-ServiceTypes=ThumbCreator
X-KDE-Library=xyzthumbnail
ThumbnailerVersion=2

0 comments on commit 168bde0

Please sign in to comment.