mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-18 16:32:33 +02:00
Fix path
This commit is contained in:
parent
ba4e9d2607
commit
7c7b614d2a
@ -49,26 +49,24 @@ bool Create::copyRecursively(const QString& srcFilePath, const QString& tgtFileP
|
|||||||
|
|
||||||
void Create::createWallpaperStart(QString videoPath)
|
void Create::createWallpaperStart(QString videoPath)
|
||||||
{
|
{
|
||||||
|
|
||||||
videoPath.remove("file:///");
|
videoPath.remove("file:///");
|
||||||
|
|
||||||
QtConcurrent::run([=]() {
|
QtConcurrent::run([=]() {
|
||||||
|
|
||||||
QDir dir;
|
QDir dir;
|
||||||
dir.cd(m_settings->localStoragePath().toString());
|
dir.cd(this->m_settings->localStoragePath().toString());
|
||||||
|
|
||||||
CreateWallpaperData createWallpaperData;
|
CreateWallpaperData createWallpaperData;
|
||||||
createWallpaperData.videoPath = videoPath;
|
createWallpaperData.videoPath = videoPath;
|
||||||
|
|
||||||
// Create a temp dir so we can later alter it to the workshop id
|
// Create a temp dir so we can later alter it to the workshop id
|
||||||
createWallpaperData.exportPath = QString(dir.path() + "/" + "_tmp_" + QTime::currentTime().toString()).replace(":", "");
|
auto folderName = QString( "_tmp_" + QTime::currentTime().toString()).replace(":", "");
|
||||||
|
|
||||||
|
if (!dir.mkdir(folderName))
|
||||||
if (dir.mkdir(createWallpaperData.exportPath)) {
|
|
||||||
// TODO
|
|
||||||
} else {
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
createWallpaperData.exportPath = dir.path() + "/" + folderName;
|
||||||
|
m_workingDir = createWallpaperData.exportPath;
|
||||||
|
|
||||||
// If we return early/false this means the creation
|
// If we return early/false this means the creation
|
||||||
// process did not work
|
// process did not work
|
||||||
@ -205,10 +203,10 @@ bool Create::createWallpaperVideoPreview(CreateWallpaperData& createWallpaperDat
|
|||||||
emit createWallpaperStateChanged(Create::State::ConvertingPreviewVideoFinished);
|
emit createWallpaperStateChanged(Create::State::ConvertingPreviewVideoFinished);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Create gif
|
* Create gif
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
emit createWallpaperStateChanged(Create::State::ConvertingPreviewGif);
|
emit createWallpaperStateChanged(Create::State::ConvertingPreviewGif);
|
||||||
args.clear();
|
args.clear();
|
||||||
@ -239,7 +237,7 @@ bool Create::createWallpaperVideoPreview(CreateWallpaperData& createWallpaperDat
|
|||||||
|
|
||||||
bool Create::createWallpaperVideo(CreateWallpaperData& createWallpaperData)
|
bool Create::createWallpaperVideo(CreateWallpaperData& createWallpaperData)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Create::createWallpaperProjectFile(CreateWallpaperData& createWallpaperData)
|
bool Create::createWallpaperProjectFile(CreateWallpaperData& createWallpaperData)
|
||||||
|
@ -34,6 +34,9 @@ class Create : public QObject {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Create(Settings* st, QMLUtilities* util, QObject* parent = nullptr);
|
explicit Create(Settings* st, QMLUtilities* util, QObject* parent = nullptr);
|
||||||
|
|
||||||
|
Q_PROPERTY(QString workingDir READ workingDir WRITE setWorkingDir NOTIFY workingDirChanged)
|
||||||
|
|
||||||
Create() {}
|
Create() {}
|
||||||
~Create() {}
|
~Create() {}
|
||||||
|
|
||||||
@ -58,11 +61,18 @@ public:
|
|||||||
Q_ENUM(State)
|
Q_ENUM(State)
|
||||||
|
|
||||||
|
|
||||||
|
QString workingDir() const
|
||||||
|
{
|
||||||
|
return m_workingDir;
|
||||||
|
}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void createWallpaperStateChanged(Create::State state);
|
void createWallpaperStateChanged(Create::State state);
|
||||||
void processOutput(QString text);
|
void processOutput(QString text);
|
||||||
|
|
||||||
|
|
||||||
|
void workingDirChanged(QString workingDir);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void copyProject(QString relativeProjectPath, QString toPath);
|
void copyProject(QString relativeProjectPath, QString toPath);
|
||||||
bool copyRecursively(const QString& srcFilePath, const QString& tgtFilePath);
|
bool copyRecursively(const QString& srcFilePath, const QString& tgtFilePath);
|
||||||
@ -75,8 +85,18 @@ public slots:
|
|||||||
bool createWallpaperVideo(CreateWallpaperData& createWallpaperData);
|
bool createWallpaperVideo(CreateWallpaperData& createWallpaperData);
|
||||||
bool createWallpaperProjectFile(CreateWallpaperData& createWallpaperData);
|
bool createWallpaperProjectFile(CreateWallpaperData& createWallpaperData);
|
||||||
|
|
||||||
|
void setWorkingDir(QString workingDir)
|
||||||
|
{
|
||||||
|
if (m_workingDir == workingDir)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_workingDir = workingDir;
|
||||||
|
emit workingDirChanged(m_workingDir);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Settings* m_settings;
|
Settings* m_settings;
|
||||||
QMLUtilities* m_utils;
|
QMLUtilities* m_utils;
|
||||||
|
|
||||||
|
QString m_workingDir;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user