Fixed: Don't try to use a directory if empty
This commit is contained in:
parent
218bc058d0
commit
5c69240979
3 changed files with 23 additions and 11 deletions
|
@ -502,6 +502,8 @@ bool CConfigFile::isRyzomInstalledIn(const QString &directory) const
|
||||||
|
|
||||||
bool CConfigFile::areRyzomDataInstalledIn(const QString &directory) const
|
bool CConfigFile::areRyzomDataInstalledIn(const QString &directory) const
|
||||||
{
|
{
|
||||||
|
if (directory.isEmpty()) return false;
|
||||||
|
|
||||||
QDir dir(directory);
|
QDir dir(directory);
|
||||||
|
|
||||||
// directory doesn't exist
|
// directory doesn't exist
|
||||||
|
@ -528,6 +530,8 @@ bool CConfigFile::areRyzomDataInstalledIn(const QString &directory) const
|
||||||
|
|
||||||
bool CConfigFile::isRyzomClientInstalledIn(const QString &directory) const
|
bool CConfigFile::isRyzomClientInstalledIn(const QString &directory) const
|
||||||
{
|
{
|
||||||
|
if (directory.isEmpty()) return false;
|
||||||
|
|
||||||
QDir dir(directory);
|
QDir dir(directory);
|
||||||
|
|
||||||
// directory doesn't exist
|
// directory doesn't exist
|
||||||
|
@ -557,6 +561,8 @@ bool CConfigFile::isRyzomClientInstalledIn(const QString &directory) const
|
||||||
|
|
||||||
bool CConfigFile::foundTemporaryFiles(const QString &directory) const
|
bool CConfigFile::foundTemporaryFiles(const QString &directory) const
|
||||||
{
|
{
|
||||||
|
if (directory.isEmpty()) return false;
|
||||||
|
|
||||||
QDir dir(directory);
|
QDir dir(directory);
|
||||||
|
|
||||||
// directory doesn't exist
|
// directory doesn't exist
|
||||||
|
|
|
@ -52,6 +52,8 @@ void CFilesCleaner::setDirectory(const QString &src)
|
||||||
|
|
||||||
bool CFilesCleaner::exec()
|
bool CFilesCleaner::exec()
|
||||||
{
|
{
|
||||||
|
if (m_directory.isEmpty()) return false;
|
||||||
|
|
||||||
if (m_listener) m_listener->operationPrepare();
|
if (m_listener) m_listener->operationPrepare();
|
||||||
|
|
||||||
QDir dir(m_directory);
|
QDir dir(m_directory);
|
||||||
|
|
|
@ -37,6 +37,9 @@ QString qBytesToHumanReadable(qint64 bytes)
|
||||||
qint64 getDirectorySize(const QString &directory)
|
qint64 getDirectorySize(const QString &directory)
|
||||||
{
|
{
|
||||||
qint64 size = 0;
|
qint64 size = 0;
|
||||||
|
|
||||||
|
if (!directory.isEmpty())
|
||||||
|
{
|
||||||
QDir dir(directory);
|
QDir dir(directory);
|
||||||
|
|
||||||
if (dir.exists())
|
if (dir.exists())
|
||||||
|
@ -57,6 +60,7 @@ qint64 getDirectorySize(const QString &directory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue