source: s10k/Vago/wizardfactory.h@ 1092

Last change on this file since 1092 was 1061, checked in by s10k, 8 years ago

Added Vago 1.3

File size: 1.6 KB
Line 
1#ifndef WIZARDFACTORY_H
2#define WIZARDFACTORY_H
3
4#include "soundwizard.h"
5
6// This template class allows us to create wizards in the heap which auto-delete themselves once finished
7template<typename T>
8class WizardFactory : public T
9{
10public:
11 static void startInstance(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger){
12 (new WizardFactory<T>(appDir, workspaceWizardLocation, vagoSettings, myLogger))->exec();
13 }
14private:
15 // We need to have a constructor to be able to acess "exec" protected function
16 WizardFactory
17 (
18 const QString &appDir,
19 const QString &workspaceWizardLocation,
20 QSettings *vagoSettings,
21 Logger *myLogger
22 ):T(appDir, workspaceWizardLocation, vagoSettings, myLogger){}
23};
24
25// Specialization for SoundWizard (it receives extra variables)
26template<>
27class WizardFactory<SoundWizard> : public SoundWizard
28{
29public:
30 static void startInstance(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger, QHash<QString, QString> *commandMap){
31 (new WizardFactory(appDir, workspaceWizardLocation, vagoSettings, myLogger, commandMap))->exec();
32 }
33private:
34 WizardFactory
35 (
36 const QString &appDir,
37 const QString &workspaceWizardLocation,
38 QSettings *vagoSettings,
39 Logger *myLogger,
40 QHash<QString, QString> *commandMap
41 ):SoundWizard(appDir, workspaceWizardLocation, vagoSettings, myLogger, commandMap){}
42};
43
44
45
46
47
48#endif // WIZARDFACTORY_H
Note: See TracBrowser for help on using the repository browser.