- 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:
Xawotihs
2012-01-06 23:54:57 +00:00
parent 1f3aedcd3f
commit d9625ed034
7 changed files with 46 additions and 16 deletions
+20 -3
View File
@@ -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()
{
}
}