1616#include " ../window/floatingwindow.hpp"
1717#include " generation.hpp"
1818#include " instanceinfo.hpp"
19+ #include " logging.hpp"
1920#include " qmlglobal.hpp"
2021#include " scan.hpp"
2122
@@ -63,16 +64,20 @@ void RootWrapper::reloadGraph(bool hard) {
6364 url.setScheme (" qsintercept" );
6465 auto component = QQmlComponent (generation->engine , url);
6566
66- auto * newRoot = component.beginCreate (generation->engine ->rootContext ());
67+ if (!component.isReady ()) {
68+ qCritical () << " Failed to load configuration:" ;
69+ auto error = component.errorString ().trimmed ();
70+ qCCritical (logBare).noquote () << error;
6771
68- if (newRoot == nullptr ) {
69- const QString error = " failed to create root component\n " + component.errorString ();
70- qWarning ().noquote () << error;
72+ auto newFiles = generation->scanner .scannedFiles ;
7173 generation->destroy ();
7274
7375 if (this ->generation != nullptr ) {
74- auto showPopup = true ;
76+ if (this ->generation ->setExtraWatchedFiles (newFiles)) {
77+ qInfo () << " Watching additional files picked up in reload for changes..." ;
78+ }
7579
80+ auto showPopup = true ;
7681 if (this ->generation ->qsgInstance != nullptr ) {
7782 this ->generation ->qsgInstance ->clearReloadPopupInhibit ();
7883 emit this ->generation ->qsgInstance ->reloadFailed (error);
@@ -89,6 +94,8 @@ void RootWrapper::reloadGraph(bool hard) {
8994 return ;
9095 }
9196
97+ auto * newRoot = component.beginCreate (generation->engine ->rootContext ());
98+
9299 if (auto * item = qobject_cast<QQuickItem*>(newRoot)) {
93100 auto * window = new FloatingWindowInterface ();
94101 item->setParent (window);
0 commit comments