- Moved the resource URL inside the QML app
- Updated local path for all the platforms - Fixed local path creation problem on Linux
This commit is contained in:
@@ -1,14 +1,30 @@
|
||||
#include "filedownloader.h"
|
||||
#include <QDir>
|
||||
|
||||
FileDownloader::FileDownloader(QUrl url, QString localPath, QObject *parent) :
|
||||
QObject(parent), m_received(0), m_localPath(localPath), m_OK(false), m_done(false)
|
||||
FileDownloader::FileDownloader(QString localPath, QUrl url, QObject *parent) :
|
||||
QObject(parent), m_received(0), m_OK(false), m_done(false)
|
||||
|
||||
{
|
||||
QDir dir(QDir::homePath());
|
||||
if(!dir.mkpath(localPath))
|
||||
{
|
||||
m_OK = false;
|
||||
return;
|
||||
}
|
||||
dir.cd(localPath);
|
||||
m_localPath = dir.filePath("core.zip");
|
||||
|
||||
QFile local(m_localPath);
|
||||
if(local.exists()) {
|
||||
m_done = true;
|
||||
return;
|
||||
}
|
||||
if(!url.isEmpty())
|
||||
setDownloadUrl(url);
|
||||
}
|
||||
|
||||
void FileDownloader::setDownloadUrl(QUrl url)
|
||||
{
|
||||
connect(&m_WebCtrl, SIGNAL(finished(QNetworkReply*)),
|
||||
SLOT(fileDownloaded(QNetworkReply*)));
|
||||
|
||||
@@ -21,7 +37,8 @@ FileDownloader::FileDownloader(QUrl url, QString localPath, QObject *parent) :
|
||||
m_OK = m_tmp.open();
|
||||
}
|
||||
|
||||
|
||||
FileDownloader::~FileDownloader()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user