use QStandardPaths to get resource locations (#44)

* use QStandardPaths to get resource locations

While this shouldn't change behaviour for windows, it allows installing the resource files seperate from the binary on unix systems

* initialize battery overlay handles to 0
This commit is contained in:
Robin Appelman
2019-01-12 16:34:45 -06:00
committed by ykeara
parent b418c76315
commit e75a4c2353
5 changed files with 43 additions and 34 deletions
+5 -2
View File
@@ -411,8 +411,11 @@ int main( int argc, char* argv[] )
advsettings::OverlayController controller(
desktopMode, noSound, qmlEngine );
QQmlComponent component(
&qmlEngine, QUrl::fromLocalFile( "res/qml/mainwidget.qml" ) );
QString path = QStandardPaths::locate(
QStandardPaths::AppDataLocation,
QStringLiteral( "res/qml/mainwidget.qml" ) );
QQmlComponent component( &qmlEngine, QUrl::fromLocalFile( path ) );
auto errors = component.errors();
for ( auto& e : errors )
{