forked from quickshell/quickshell
feat(socket): add SocketServer and Socket.write
This commit is contained in:
parent
f004454395
commit
f45d298b66
5 changed files with 248 additions and 7 deletions
|
@ -7,8 +7,10 @@
|
|||
#include <qobject.h>
|
||||
#include <qqmlcomponent.h>
|
||||
#include <qqmlengine.h>
|
||||
#include <qtimer.h>
|
||||
#include <qurl.h>
|
||||
|
||||
#include "reload.hpp"
|
||||
#include "shell.hpp"
|
||||
#include "watcher.hpp"
|
||||
|
||||
|
@ -48,14 +50,21 @@ void RootWrapper::reloadGraph(bool hard) {
|
|||
|
||||
component.completeCreate();
|
||||
|
||||
newRoot->onReload(hard ? nullptr : this->root);
|
||||
auto* oldRoot = this->root;
|
||||
this->root = newRoot;
|
||||
|
||||
if (this->root != nullptr) {
|
||||
this->root->deleteLater();
|
||||
this->root = nullptr;
|
||||
this->root->onReload(hard ? nullptr : oldRoot);
|
||||
|
||||
if (oldRoot != nullptr) {
|
||||
oldRoot->deleteLater();
|
||||
|
||||
QTimer::singleShot(0, [this, newRoot]() {
|
||||
if (this->root == newRoot) PostReloadHook::postReloadTree(this->root);
|
||||
});
|
||||
} else {
|
||||
PostReloadHook::postReloadTree(newRoot);
|
||||
}
|
||||
|
||||
this->root = newRoot;
|
||||
this->onConfigChanged();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue