Use QDir::cleanPath() to get unified input paths.

Paths stored are now always without trailing "/" or double "/" within
them.
This commit is contained in:
Florian Jacob 2011-12-19 08:35:29 +01:00 committed by Klaas Freitag
parent faf912b29d
commit b170150db3

View file

@ -274,6 +274,9 @@ void SyncWindow::on_buttonSave_clicked()
host.replace("https://","");
host.replace("webdav://","");
host.replace("webdavs://","");
// clean up double or trailing slashes..
QString remoteDir = QDir::cleanPath(ui->lineRemoteDir->text());
QString localDir = QDir::cleanPath(ui->lineLocalDir->text());
if( mEditingConfig >= 0 ) { // Editing an account
// If we are renaming the account, make sure that the new name
// does not already exist
@ -288,8 +291,8 @@ void SyncWindow::on_buttonSave_clicked()
ui->labelHttp->text()+host,
ui->lineUser->text(),
ui->linePassword->text(),
ui->lineRemoteDir->text(),
ui->lineLocalDir->text(),
remoteDir,
localDir,
ui->time->value());
}
} else { // New account
@ -302,8 +305,8 @@ void SyncWindow::on_buttonSave_clicked()
account->initialize(ui->labelHttp->text()+host,
ui->lineUser->text(),
ui->linePassword->text(),
ui->lineRemoteDir->text(),
ui->lineLocalDir->text(),
remoteDir,
localDir,
ui->time->value());
}
}