@ -110,8 +110,6 @@ void Settings::loadGlobal()
createSettingsDir ( ) ;
createSettingsDir ( ) ;
makeToxPortable = Settings : : isToxPortable ( ) ;
QDir dir ( paths . getSettingsDirPath ( ) ) ;
QDir dir ( paths . getSettingsDirPath ( ) ) ;
QString filePath = dir . filePath ( globalSettingsFile ) ;
QString filePath = dir . filePath ( globalSettingsFile ) ;
@ -262,20 +260,6 @@ void Settings::loadGlobal()
loaded = true ;
loaded = true ;
}
}
bool Settings : : isToxPortable ( )
{
QString localSettingsPath = qApp - > applicationDirPath ( ) + QDir : : separator ( ) + globalSettingsFile ;
if ( ! QFile ( localSettingsPath ) . exists ( ) ) {
return false ;
}
QSettings ps ( localSettingsPath , QSettings : : IniFormat ) ;
ps . setIniCodec ( " UTF-8 " ) ;
ps . beginGroup ( " Advanced " ) ;
bool result = ps . value ( " makeToxPortable " , false ) . toBool ( ) ;
ps . endGroup ( ) ;
return result ;
}
void Settings : : updateProfileData ( Profile * profile , const QCommandLineParser * parser )
void Settings : : updateProfileData ( Profile * profile , const QCommandLineParser * parser )
{
{
QMutexLocker locker { & bigLock } ;
QMutexLocker locker { & bigLock } ;
@ -889,13 +873,12 @@ void Settings::setMakeToxPortable(bool newValue)
bool changed = false ;
bool changed = false ;
{
{
QMutexLocker locker { & bigLock } ;
QMutexLocker locker { & bigLock } ;
QFile ( paths . getSettingsDirPath ( ) + globalSettingsFile ) . remove ( )
if ( newValue ! = makeToxPortable ) {
if ( newValue ! = makeToxPortable ) {
QFile ( paths . getSettingsDirPath ( ) + globalSettingsFile ) . remove ( ) ;
QFile ( paths . getSettingsDirPath ( ) + globalSettingsFile ) . remove ( ) ;
makeToxPortable = newValue ;
makeToxPortable = newValue ;
changed = paths . setPortable ( newValue ) ;
saveGlobal ( ) ;
saveGlobal ( ) ;
changed = true ;
}
}
}
}
if ( changed ) {
if ( changed ) {