mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
Keep the member variable, avoids double instanciation
This commit is contained in:
parent
b37645e14d
commit
99fbf25fb2
1 changed files with 11 additions and 4 deletions
|
@ -107,7 +107,8 @@ Application::Application(int &argc, char **argv) :
|
|||
_logFlush(false),
|
||||
_helpOnly(false),
|
||||
_fileItemDialog(0),
|
||||
_statusDialog(0)
|
||||
_statusDialog(0),
|
||||
_folderWizard(0)
|
||||
{
|
||||
setApplicationName( _theme->appNameGUI() );
|
||||
setWindowIcon( _theme->applicationIcon() );
|
||||
|
@ -134,8 +135,6 @@ Application::Application(int &argc, char **argv) :
|
|||
|
||||
setQuitOnLastWindowClosed(false);
|
||||
|
||||
_folderWizard = new FolderWizard;
|
||||
|
||||
_owncloudSetupWizard = new OwncloudSetupWizard( _folderMan, _theme, this );
|
||||
connect( _owncloudSetupWizard, SIGNAL(ownCloudWizardDone(int)),
|
||||
this, SLOT(slotownCloudWizardDone(int)));
|
||||
|
@ -685,12 +684,17 @@ void Application::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
|
|||
|
||||
void Application::slotAddFolder()
|
||||
{
|
||||
if (_folderWizard) {
|
||||
raiseDialog(_folderWizard);
|
||||
return;
|
||||
}
|
||||
|
||||
// disables sync queuing while in scope
|
||||
FolderMan::SyncDisabler disableSync(_folderMan);
|
||||
|
||||
Folder::Map folderMap = _folderMan->map();
|
||||
_folderWizard = new FolderWizard;
|
||||
_folderWizard->setFolderMap( &folderMap );
|
||||
_folderWizard->restart();
|
||||
|
||||
if (_folderWizard->exec() == QDialog::Accepted) {
|
||||
qDebug() << "* Folder wizard completed";
|
||||
|
@ -713,6 +717,9 @@ void Application::slotAddFolder()
|
|||
} else {
|
||||
qDebug() << "* Folder wizard cancelled";
|
||||
}
|
||||
_folderWizard->deleteLater();
|
||||
_folderWizard = 0;
|
||||
|
||||
_folderMan->slotScheduleAllFolders();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue