Runnable 1.6 instances!

This commit is contained in:
Petr Mrázek
2013-08-05 03:29:50 +02:00
parent 005a010ee6
commit 183a735145
23 changed files with 502 additions and 214 deletions

View File

@ -26,8 +26,6 @@ public:
QString expected_md5 = QString()
);
public:
static bool ensurePathExists(QString filenamepath);
public slots:
virtual void start();

View File

@ -29,4 +29,6 @@ LIBUTIL_EXPORT QString RemoveInvalidFilenameChars(QString string, QChar replaceW
LIBUTIL_EXPORT QString DirNameFromString(QString string, QString inDir = ".");
LIBUTIL_EXPORT bool ensurePathExists(QString filenamepath);
#endif // PATHUTILS_H

View File

@ -1,4 +1,5 @@
#include "include/dlqueue.h"
#include <include/pathutils.h>
DownloadJob::DownloadJob (QUrl url,
QString target_path,
@ -48,13 +49,6 @@ JobPtr DownloadJob::create (QSharedPointer<QNetworkAccessManager> net_mgr,
return JobPtr ( new DownloadJob ( net_mgr, url, target_path, expected_md5 ) );
}
bool DownloadJob::ensurePathExists(QString filenamepath)
{
QFileInfo a ( filenamepath );
QDir dir;
return (dir.mkpath ( a.path() ));
}
void DownloadJob::start()
{
if ( m_save_to_file )

View File

@ -65,3 +65,11 @@ QString DirNameFromString(QString string, QString inDir)
}
return dirName;
}
bool ensurePathExists(QString filenamepath)
{
QFileInfo a ( filenamepath );
QDir dir;
return (dir.mkpath ( a.path() ));
}