forked from quickshell/quickshell
reload: encapsulate each engine generation more
This commit is contained in:
parent
211f454de9
commit
1687ff3614
7 changed files with 125 additions and 79 deletions
|
@ -21,15 +21,10 @@ public:
|
|||
class SingletonRegistry {
|
||||
public:
|
||||
SingletonRegistry() = default;
|
||||
~SingletonRegistry();
|
||||
Q_DISABLE_COPY_MOVE(SingletonRegistry);
|
||||
|
||||
void install(const QUrl& url, Singleton* singleton);
|
||||
void flip();
|
||||
|
||||
static SingletonRegistry* instance();
|
||||
void registerSingleton(const QUrl& url, Singleton* singleton);
|
||||
void onReload(SingletonRegistry* old);
|
||||
|
||||
private:
|
||||
QMap<QUrl, QObject*>* previousRegistry = nullptr;
|
||||
QMap<QUrl, QObject*>* currentRegistry = nullptr;
|
||||
QMap<QUrl, Singleton*> registry;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue