Move utilities to core/utils folder.

Also move the names to Utils namespace.
This commit is contained in:
Vladimir Golovnev (Glassez) 2015-05-06 14:53:27 +03:00
parent 427688cb34
commit 191cdc2849
67 changed files with 1172 additions and 1135 deletions

View file

@ -38,8 +38,8 @@
#include <zlib.h>
#include "core/fs_utils.h"
#include "core/misc.h"
#include "core/utils/fs.h"
#include "core/utils/misc.h"
#include "downloadmanager.h"
#include "downloadhandler.h"
@ -108,7 +108,7 @@ void DownloadHandler::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal)
// Total number of bytes is available
if (bytesTotal > m_sizeLimit) {
m_reply->abort();
emit downloadFailed(m_url, msg.arg(misc::friendlyUnit(bytesTotal)).arg(misc::friendlyUnit(m_sizeLimit)));
emit downloadFailed(m_url, msg.arg(Utils::Misc::friendlyUnit(bytesTotal)).arg(Utils::Misc::friendlyUnit(m_sizeLimit)));
}
else {
disconnect(m_reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(checkDownloadSize(qint64, qint64)));
@ -116,7 +116,7 @@ void DownloadHandler::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal)
}
else if (bytesReceived > m_sizeLimit) {
m_reply->abort();
emit downloadFailed(m_url, msg.arg(misc::friendlyUnit(bytesReceived)).arg(misc::friendlyUnit(m_sizeLimit)));
emit downloadFailed(m_url, msg.arg(Utils::Misc::friendlyUnit(bytesReceived)).arg(Utils::Misc::friendlyUnit(m_sizeLimit)));
}
}
@ -154,7 +154,7 @@ bool DownloadHandler::saveToFile(QString &filePath)
}
else {
delete tmpfile;
fsutils::forceRemove(filePath);
Utils::Fs::forceRemove(filePath);
}
return false;