mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
libs: save and load group tasks pixmaps in Katie image format
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
769ed9882b
commit
cd2057d407
1 changed files with 9 additions and 2 deletions
|
@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <QTimer>
|
||||
#include <QUuid>
|
||||
#include <QFile>
|
||||
#include <QImageWriter>
|
||||
|
||||
#include <KDebug>
|
||||
#include <KService>
|
||||
|
@ -52,6 +53,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
namespace TaskManager
|
||||
{
|
||||
|
||||
#if QT_VERSION >= 0x041200
|
||||
static const QByteArray pixmapFormat = QImageWriter::defaultImageFormat();
|
||||
#else
|
||||
static const QByteArray pixmapFormat = "png";
|
||||
#endif
|
||||
|
||||
class GroupManagerPrivate
|
||||
{
|
||||
public:
|
||||
|
@ -806,7 +813,7 @@ void GroupManager::readLauncherConfig(const KConfigGroup &cg)
|
|||
} else if (item.length() >= 5) {
|
||||
QPixmap pixmap;
|
||||
QByteArray bytes = QByteArray::fromBase64(item.at(4).toAscii());
|
||||
pixmap.loadFromData(bytes);
|
||||
pixmap.loadFromData(bytes, pixmapFormat);
|
||||
icon.addPixmap(pixmap);
|
||||
}
|
||||
QString name(item.at(2));
|
||||
|
@ -997,7 +1004,7 @@ bool GroupManagerPrivate::saveLauncher(LauncherItem *launcher, KConfigGroup &cg)
|
|||
QByteArray bytes;
|
||||
QBuffer buffer(&bytes);
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG");
|
||||
pixmap.save(&buffer, pixmapFormat);
|
||||
launcherProperties.append(bytes.toBase64());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue