From e27374324daccab939e4f55ec1b9b46c459b8b48 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 2 Dec 2015 12:24:33 +0100 Subject: [PATCH] AccountSettings: Remove the F5 reset folder shortcut This secret key was used to wipe the database. In the past this was usefull because of many bugs, but now this is not usefull anymore. And cause trouble because it also erase the selective sync list. Issue #4182 --- src/gui/accountsettings.cpp | 30 ------------------------------ src/gui/accountsettings.h | 1 - 2 files changed, 31 deletions(-) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index ff7953fad..4324b2758 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -99,11 +99,6 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) : connect(_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(refreshSelectiveSyncStatus())); - QAction *resetFolderAction = new QAction(this); - resetFolderAction->setShortcut(QKeySequence(Qt::Key_F5)); - connect(resetFolderAction, SIGNAL(triggered()), SLOT(slotResetCurrentFolder())); - addAction(resetFolderAction); - QAction *syncNowAction = new QAction(this); syncNowAction->setShortcut(QKeySequence(Qt::Key_F6)); connect(syncNowAction, SIGNAL(triggered()), SLOT(slotSyncCurrentFolderNow())); @@ -340,31 +335,6 @@ void AccountSettings::slotRemoveCurrentFolder() } } -void AccountSettings::slotResetCurrentFolder() -{ - QModelIndex selected = ui->_folderList->selectionModel()->currentIndex(); - if( selected.isValid() ) { - QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString(); - if (alias.isEmpty()) - return; - int ret = QMessageBox::question( 0, tr("Confirm Folder Reset"), - tr("

Do you really want to reset folder %1 and rebuild your client database?

" - "

Note: This function is designed for maintenance purposes only. " - "No files will be removed, but this can cause significant data traffic and " - "take several minutes or hours to complete, depending on the size of the folder. " - "Only use this option if advised by your administrator.

").arg(alias), - QMessageBox::Yes|QMessageBox::No ); - if( ret == QMessageBox::Yes ) { - FolderMan *folderMan = FolderMan::instance(); - if(Folder *f = folderMan->folder(alias)) { - f->slotTerminateSync(); - f->wipe(); - } - folderMan->slotScheduleAllFolders(); - } - } -} - void AccountSettings::slotOpenCurrentFolder() { QModelIndex selected = ui->_folderList->selectionModel()->currentIndex(); diff --git a/src/gui/accountsettings.h b/src/gui/accountsettings.h index f7a416975..38c2e27f1 100644 --- a/src/gui/accountsettings.h +++ b/src/gui/accountsettings.h @@ -72,7 +72,6 @@ protected slots: void slotEnableCurrentFolder(); void slotSyncCurrentFolderNow(); void slotRemoveCurrentFolder(); - void slotResetCurrentFolder(); void slotOpenCurrentFolder(); void slotFolderWizardAccepted(); void slotFolderWizardRejected();