mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:10:06 +00:00 
			
		
		
		
	Make SettingsManager an object instead of a namespace
This commit is contained in:
		
							parent
							
								
									1f964c49f8
								
							
						
					
					
						commit
						67881d31d5
					
				
					 5 changed files with 76 additions and 42 deletions
				
			
		|  | @ -1,6 +1,9 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <string> | ||||
| #include <memory> | ||||
| 
 | ||||
| #include <QObject> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -8,15 +11,28 @@ namespace qt | |||
| { | ||||
| namespace manager | ||||
| { | ||||
| namespace SettingsManager | ||||
| 
 | ||||
| class SettingsManager : public QObject | ||||
| { | ||||
|    Q_OBJECT | ||||
|    Q_DISABLE_COPY_MOVE(SettingsManager) | ||||
| 
 | ||||
| void Initialize(); | ||||
| void ReadSettings(const std::string& settingsPath); | ||||
| void SaveSettings(); | ||||
| void Shutdown(); | ||||
| public: | ||||
|    explicit SettingsManager(); | ||||
|    ~SettingsManager(); | ||||
| 
 | ||||
|    void Initialize(); | ||||
|    void ReadSettings(const std::string& settingsPath); | ||||
|    void SaveSettings(); | ||||
|    void Shutdown(); | ||||
| 
 | ||||
|    static SettingsManager& Instance(); | ||||
| 
 | ||||
| private: | ||||
|    class Impl; | ||||
|    std::unique_ptr<Impl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace SettingsManager
 | ||||
| } // namespace manager
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat