Update the debug view every time GlobalStorage changes.

This commit is contained in:
Teo Mrnjavac 2015-03-05 19:39:12 +01:00
parent edb21e05af
commit 8729b6a25f

View File

@ -36,7 +36,14 @@ DebugWindow::DebugWindow()
QJsonModel* jsonModel = new QJsonModel( this ); QJsonModel* jsonModel = new QJsonModel( this );
globalStorageView->setModel( jsonModel ); globalStorageView->setModel( jsonModel );
jsonModel->loadJson( QJsonDocument::fromVariant( Calamares::JobQueue::instance()->globalStorage()->m ).toJson() ); GlobalStorage* gs = JobQueue::instance()->globalStorage();
connect( gs, &GlobalStorage::changed, [ jsonModel, gs ]
{
jsonModel->loadJson( QJsonDocument::fromVariant( gs->m ).toJson() );
} );
jsonModel->loadJson( QJsonDocument::fromVariant( gs->m ).toJson() );
CALAMARES_RETRANSLATE( retranslateUi( this ); ) CALAMARES_RETRANSLATE( retranslateUi( this ); )
} }