Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2016-05-17 11:49:57 +0300
committerOlivier Goffart <ogoffart@woboq.com>2016-05-18 11:52:22 +0300
commit010649f997e894c6a782cfb309b5d5931c2b69e5 (patch)
treea53fbce78fc5d8d45f8035d3e9327473cfcb14c4 /src/gui/folderwizard.cpp
parent597f2a4dfc92010e86ad17653c000bc5a1a1e3f9 (diff)
FolderWizard: remove dead code and fix the alias
Remove a bunch of dead code. And also set the root folder name properly since alias is gone. Fix the warning: QWizard::field: No such field 'alias'
Diffstat (limited to 'src/gui/folderwizard.cpp')
-rw-r--r--src/gui/folderwizard.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp
index 60e3fe581..6fcc19206 100644
--- a/src/gui/folderwizard.cpp
+++ b/src/gui/folderwizard.cpp
@@ -68,13 +68,6 @@ FolderWizardLocalPath::FolderWizardLocalPath()
_ui.localFolderLineEdit->setText( QDir::toNativeSeparators( defaultPath ) );
_ui.localFolderLineEdit->setToolTip(tr("Enter the path to the local folder."));
- QString newAlias = Theme::instance()->appName();
- int count = 0;
- while (FolderMan::instance()->folder(newAlias)) {
- // There is already a folder configured with this name and folder names need to be unique
- newAlias = Theme::instance()->appName() + QString::number(++count);
- }
-
_ui.warnLabel->setTextFormat(Qt::RichText);
_ui.warnLabel->hide();
}
@@ -135,14 +128,6 @@ void FolderWizardLocalPath::slotChooseLocalFolder()
if (!dir.isEmpty()) {
// set the last directory component name as alias
_ui.localFolderLineEdit->setText(QDir::toNativeSeparators(dir));
-
- QDir pickedDir(dir);
- QString newAlias = pickedDir.dirName();
- int count = 0;
- while (FolderMan::instance()->folder(newAlias)) {
- // There is already a folder configured with this name and folder names need to be unique
- newAlias = pickedDir.dirName() + QString::number(++count);
- }
}
emit completeChanged();
}
@@ -503,11 +488,13 @@ FolderWizardSelectiveSync::~FolderWizardSelectiveSync()
void FolderWizardSelectiveSync::initializePage()
{
- QString alias = wizard()->field(QLatin1String("alias")).toString();
QString targetPath = wizard()->property("targetPath").toString();
if (targetPath.startsWith('/')) {
targetPath = targetPath.mid(1);
}
+ QString alias = QFileInfo(targetPath).fileName();
+ if (alias.isEmpty())
+ alias = Theme::instance()->appName();
_treeView->setFolderInfo(targetPath, alias);
QWizardPage::initializePage();
}
@@ -520,8 +507,10 @@ bool FolderWizardSelectiveSync::validatePage()
void FolderWizardSelectiveSync::cleanupPage()
{
- QString alias = wizard()->field(QLatin1String("alias")).toString();
QString targetPath = wizard()->property("targetPath").toString();
+ QString alias = QFileInfo(targetPath).fileName();
+ if (alias.isEmpty())
+ alias = Theme::instance()->appName();
_treeView->setFolderInfo(targetPath, alias);
QWizardPage::cleanupPage();
}