Changed: Added option ignore_free_disk_space_checks to ryzom_installer.ini

--HG--
branch : develop
This commit is contained in:
kervala 2016-11-25 10:44:06 +01:00
parent 6a76fc8317
commit c4b9d77eaa
5 changed files with 22 additions and 4 deletions

View file

@ -25,7 +25,8 @@
CConfigFile *CConfigFile::s_instance = NULL;
CConfigFile::CConfigFile(QObject *parent):QObject(parent), m_version(-1),
m_defaultServerIndex(0), m_defaultProfileIndex(0), m_installerCopied(false), m_use64BitsClient(false), m_shouldUninstallOldClient(true)
m_defaultServerIndex(0), m_defaultProfileIndex(0), m_installerCopied(false), m_use64BitsClient(false),
m_shouldUninstallOldClient(true), m_ignoreFreeDiskSpaceChecks(false)
{
s_instance = this;
@ -82,6 +83,7 @@ bool CConfigFile::load(const QString &filename)
m_installationDirectory = settings.value("installation_directory").toString();
m_use64BitsClient = settings.value("use_64bits_client", true).toBool();
m_shouldUninstallOldClient = settings.value("should_uninstall_old_client", true).toBool();
m_ignoreFreeDiskSpaceChecks = settings.value("ignore_free_disk_space_checks", false).toBool();
// fix problems when src directory doesn't exist anymore
if (!m_srcDirectory.isEmpty() && QFile::exists(m_srcDirectory)) m_srcDirectory.clear();
@ -175,6 +177,7 @@ bool CConfigFile::save() const
settings.setValue("installation_directory", m_installationDirectory);
settings.setValue("use_64bits_client", m_use64BitsClient);
settings.setValue("should_uninstall_old_client", m_shouldUninstallOldClient);
settings.setValue("ignore_free_disk_space_checks", m_ignoreFreeDiskSpaceChecks);
#if defined(Q_OS_WIN)
settings.setValue("installer_filename_windows", m_installerFilename);
@ -441,6 +444,16 @@ void CConfigFile::setShouldUninstallOldClient(bool on)
m_shouldUninstallOldClient = on;
}
bool CConfigFile::ignoreFreeDiskSpaceChecks() const
{
return m_ignoreFreeDiskSpaceChecks;
}
void CConfigFile::setIgnoreFreeDiskSpaceChecks(bool on)
{
m_ignoreFreeDiskSpaceChecks = on;
}
bool CConfigFile::uninstallingOldClient() const
{
return QFile::exists(getInstallationDirectory() + "/ryzom_installer_uninstalling_old_client");

View file

@ -113,6 +113,9 @@ public:
bool shouldUninstallOldClient() const;
void setShouldUninstallOldClient(bool on);
bool ignoreFreeDiskSpaceChecks() const;
void setIgnoreFreeDiskSpaceChecks(bool on);
bool uninstallingOldClient() const;
void setUninstallingOldClient(bool on) const;
@ -158,6 +161,7 @@ private:
QString m_srcDirectory;
bool m_use64BitsClient;
bool m_shouldUninstallOldClient;
bool m_ignoreFreeDiskSpaceChecks;
QString m_installerFilename;
QString m_language;

View file

@ -18,6 +18,7 @@
#include "operation.h"
#include "downloader.h"
#include "utils.h"
#include "configfile.h"
#include "nel/misc/system_info.h"
#include "nel/misc/path.h"
@ -179,7 +180,7 @@ void CDownloader::getFileHead()
void CDownloader::downloadFile()
{
qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_fullPath.toUtf8().constData());
qint64 freeSpace = CConfigFile::getInstance()->ignoreFreeDiskSpaceChecks() ? 0:NLMISC::CSystemInfo::availableHDSpace(m_fullPath.toUtf8().constData());
if (freeSpace == 0)
{

View file

@ -130,7 +130,7 @@ void CInstallDialog::updateDestinationText()
void CInstallDialog::accept()
{
// check free disk space
qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData());
qint64 freeSpace = CConfigFile::getInstance()->ignoreFreeDiskSpaceChecks() ? 0:NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData());
// shouldn't happen
if (freeSpace == 0)

View file

@ -123,7 +123,7 @@ void CMigrateDialog::updateDestinationText()
void CMigrateDialog::accept()
{
// check free disk space
qint64 freeSpace = NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData());
qint64 freeSpace = CConfigFile::getInstance()->ignoreFreeDiskSpaceChecks() ? 0:NLMISC::CSystemInfo::availableHDSpace(m_dstDirectory.toUtf8().constData());
// shouldn't happen
if (freeSpace == 0)