mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
Simplified config file write method, removed don't store pwd.
This commit is contained in:
parent
a8bc849b5d
commit
6c5d5a543c
2 changed files with 4 additions and 13 deletions
|
@ -136,25 +136,17 @@ bool MirallConfigFile::connectionExists( const QString& conn )
|
|||
void MirallConfigFile::writeOwncloudConfig( const QString& connection,
|
||||
const QString& url,
|
||||
const QString& user,
|
||||
const QString& passwd,
|
||||
bool https, bool skipPwd )
|
||||
const QString& passwd )
|
||||
{
|
||||
const QString file = configFile();
|
||||
bool skipPwd = false; // can be refactored - remove it.
|
||||
qDebug() << "*** writing mirall config to " << file << " Skippwd: " << skipPwd;
|
||||
|
||||
QSettings settings( file, QSettings::IniFormat);
|
||||
settings.setIniCodec( "UTF-8" );
|
||||
QString cloudsUrl( url );
|
||||
|
||||
if( !cloudsUrl.startsWith( QLatin1String("http")) ) {
|
||||
if (https)
|
||||
cloudsUrl.prepend(QLatin1String("https://"));
|
||||
else
|
||||
cloudsUrl.prepend(QLatin1String("http://"));
|
||||
}
|
||||
|
||||
settings.beginGroup( connection );
|
||||
settings.setValue( QLatin1String("url"), cloudsUrl );
|
||||
settings.setValue( QLatin1String("url"), url );
|
||||
settings.setValue( QLatin1String("user"), user );
|
||||
|
||||
|
||||
|
|
|
@ -50,8 +50,7 @@ public:
|
|||
void writeOwncloudConfig( const QString& connection,
|
||||
const QString& url,
|
||||
const QString& user,
|
||||
const QString& passwd,
|
||||
bool https, bool skipPwd );
|
||||
const QString& passwd );
|
||||
|
||||
void removeConnection( const QString& connection = QString() );
|
||||
|
||||
|
|
Loading…
Reference in a new issue