mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 05:55:59 +03:00
make addFolderDefintion easier to read
This commit is contained in:
parent
e353193fbb
commit
aee0f0c882
1 changed files with 5 additions and 12 deletions
|
@ -404,24 +404,17 @@ void FolderMan::slotFolderSyncFinished( const SyncResult& )
|
||||||
QTimer::singleShot(200, this, SLOT(slotScheduleFolderSync()));
|
QTimer::singleShot(200, this, SLOT(slotScheduleFolderSync()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a folder definition to the config
|
|
||||||
* Params:
|
|
||||||
* QString alias
|
|
||||||
* QString sourceFolder on local machine
|
|
||||||
* QString targetPath on remote
|
|
||||||
*/
|
|
||||||
void FolderMan::addFolderDefinition(const QString& alias, const QString& sourceFolder, const QString& targetPath )
|
void FolderMan::addFolderDefinition(const QString& alias, const QString& sourceFolder, const QString& targetPath )
|
||||||
{
|
{
|
||||||
QString escapedAlias = escapeAlias(alias);
|
QString escapedAlias = escapeAlias(alias);
|
||||||
// Create a settings file named after the alias
|
// Create a settings file named after the alias
|
||||||
QSettings settings( _folderConfigPath + QLatin1Char('/') + escapedAlias, QSettings::IniFormat);
|
QSettings settings( _folderConfigPath + QLatin1Char('/') + escapedAlias, QSettings::IniFormat);
|
||||||
|
settings.beginGroup(escapedAlias);
|
||||||
settings.setValue(QString::fromLatin1("%1/localPath").arg(escapedAlias), sourceFolder );
|
settings.setValue(QLatin1String("localPath"), sourceFolder );
|
||||||
settings.setValue(QString::fromLatin1("%1/targetPath").arg(escapedAlias), targetPath );
|
settings.setValue(QLatin1String("targetPath"), targetPath );
|
||||||
// for compat reasons
|
// for compat reasons
|
||||||
settings.setValue(QString::fromLatin1("%1/backend").arg(escapedAlias), "owncloud" );
|
settings.setValue(QLatin1String("backend"), "owncloud" );
|
||||||
settings.setValue(QString::fromLatin1("%1/connection").arg(escapedAlias), Theme::instance()->appName());
|
settings.setValue(QLatin1String("connection"), Theme::instance()->appName());
|
||||||
settings.sync();
|
settings.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue