1616#include " ../window/floatingwindow.hpp"
1717#include " generation.hpp"
1818#include " instanceinfo.hpp"
19- #include " logging.hpp"
2019#include " qmlglobal.hpp"
2120#include " scan.hpp"
2221
@@ -32,7 +31,6 @@ RootWrapper::RootWrapper(QString rootPath, QString shellId)
3231 this ->reloadGraph (true );
3332
3433 if (this ->generation == nullptr ) {
35- qCritical () << " could not create scene graph, exiting" ;
3634 exit (-1 ); // NOLINT
3735 }
3836}
@@ -54,6 +52,7 @@ void RootWrapper::reloadGraph(bool hard) {
5452
5553 // todo: move into EngineGeneration
5654 if (this ->generation != nullptr ) {
55+ qInfo () << " Reloading configuration..." ;
5756 QuickshellSettings::reset ();
5857 }
5958
@@ -65,9 +64,17 @@ void RootWrapper::reloadGraph(bool hard) {
6564 auto component = QQmlComponent (generation->engine , url);
6665
6766 if (!component.isReady ()) {
68- qCritical () << " Failed to load configuration:" ;
69- auto error = component.errorString ().trimmed ();
70- qCCritical (logBare).noquote () << error;
67+ qCritical () << " Failed to load configuration" ;
68+ QString errorString = " Failed to load configuration" ;
69+
70+ auto errors = component.errors ();
71+ for (auto & error: errors) {
72+ auto rel = " **/" % rootPath.relativeFilePath (error.url ().path ());
73+ auto msg = " caused by " % rel % ' [' % QString::number (error.line ()) % ' :'
74+ % QString::number (error.column ()) % " ]: " % error.description ();
75+ errorString += ' \n ' % msg;
76+ qCritical ().noquote () << msg;
77+ }
7178
7279 auto newFiles = generation->scanner .scannedFiles ;
7380 generation->destroy ();
@@ -80,15 +87,16 @@ void RootWrapper::reloadGraph(bool hard) {
8087 auto showPopup = true ;
8188 if (this ->generation ->qsgInstance != nullptr ) {
8289 this ->generation ->qsgInstance ->clearReloadPopupInhibit ();
83- emit this ->generation ->qsgInstance ->reloadFailed (error );
90+ emit this ->generation ->qsgInstance ->reloadFailed (errorString );
8491 showPopup = !this ->generation ->qsgInstance ->isReloadPopupInhibited ();
8592 }
8693
87- if (showPopup) qs::ui::ReloadPopup::spawnPopup (InstanceInfo::CURRENT.instanceId , true , error);
94+ if (showPopup)
95+ qs::ui::ReloadPopup::spawnPopup (InstanceInfo::CURRENT.instanceId , true , errorString);
8896 }
8997
9098 if (this ->generation != nullptr && this ->generation ->qsgInstance != nullptr ) {
91- emit this ->generation ->qsgInstance ->reloadFailed (error );
99+ emit this ->generation ->qsgInstance ->reloadFailed (errorString );
92100 }
93101
94102 return ;
0 commit comments