on xenial help sign in
Remove wizardEnabledPath if it's a folder
f4fdb19Marius Gripsgard
plugins/Wizard/System.cpp+4
@@ -115,6 +115,10 @@ void System::setWizardEnabled(bool enabled)
115 if (QFile::exists(wizardEnabledPath())) {
115 if (QFile::exists(wizardEnabledPath())) {
116 QFile::remove(wizardEnabledPath());
116 QFile::remove(wizardEnabledPath());
117 }
117 }
118+ // For special cases check if wizardEnabledPath is a folder
119+ if (QDir(wizardEnabledPath()).exists()) {
120+ QDir(wizardEnabledPath()).removeRecursively();
121+ }
118 QFile::copy(currentFrameworkPath(), wizardEnabledPath());
122 QFile::copy(currentFrameworkPath(), wizardEnabledPath());
119 m_fsWatcher.addPath(wizardEnabledPath());
123 m_fsWatcher.addPath(wizardEnabledPath());
120 Q_EMIT wizardEnabledChanged();
124 Q_EMIT wizardEnabledChanged();