Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit eb0585e8 authored by Christian Ehrlicher's avatar Christian Ehrlicher

KF5 port: replace KTempDir with QTemporaryDir

Summary: first of seven patches to remove kde4support from Palepeli frameworks branch

Test Plan: Start application - temporary directory is created/removed as before

Reviewers: #kde_games, ltoscano

Reviewed By: ltoscano

Subscribers: ltoscano, #kde_games

Differential Revision: https://phabricator.kde.org/D7416
parent ebd26298
......@@ -20,8 +20,8 @@
#include <KIO/ThumbCreator>
#include <kdemacros.h>
#include <QImage>
#include <QTemporaryDir>
#include <KTar>
#include <KTempDir>
namespace Palapeli
{
......@@ -47,8 +47,8 @@ bool Palapeli::ThumbCreator::create(const QString& path, int width, int height,
KTar tar(path, "application/x-gzip");
if (!tar.open(QIODevice::ReadOnly))
return false;
KTempDir cache;
const QString cachePath = cache.name(); //note: includes trailing slash
QTemporaryDir cache;
const QString cachePath = cache.path() + QLatin1Char('/');
tar.directory()->copyTo(cachePath);
tar.close();
//read image
......
......@@ -22,27 +22,27 @@
#include <QtCore/QFutureSynchronizer>
#include <KConfigGroup>
#include <KDesktopFile>
#include <KTempDir>
#include <QTemporaryDir>
Palapeli::DirectoryStorageComponent::DirectoryStorageComponent()
: m_dir(new KTempDir)
: m_dir(new QTemporaryDir)
{
}
Palapeli::DirectoryStorageComponent::~DirectoryStorageComponent()
{
m_dir->unlink();
m_dir->remove();
delete m_dir;
}
QString Palapeli::DirectoryStorageComponent::directory() const
{
return m_dir->name();
return m_dir->path() + QLatin1Char('/');
}
Palapeli::PuzzleComponent* Palapeli::DirectoryStorageComponent::cast(Palapeli::PuzzleComponent::Type type) const
{
QDir dir(m_dir->name());
QDir dir(m_dir->path());
//load metadata from directory
if (type == Metadata)
{
......
......@@ -23,7 +23,7 @@
#include "puzzlestructs.h"
class KConfigGroup;
class KTempDir;
class QTemporaryDir;
#define COMPONENT_SUBCLASS(mytype) \
public: \
......@@ -86,7 +86,7 @@ namespace Palapeli
QString directory() const;
Palapeli::PuzzleComponent* cast(Type type) const Q_DECL_OVERRIDE;
private:
KTempDir* m_dir;
QTemporaryDir* m_dir;
};
///This is a valid mainComponent.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment