Changeset View
Changeset View
Standalone View
Standalone View
src/context/ContextView.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 58 | { | |||
---|---|---|---|---|---|
74 | rootContext()->setContextProperty( QStringLiteral( "Svg" ), The::svgHandler() ); | 74 | rootContext()->setContextProperty( QStringLiteral( "Svg" ), The::svgHandler() ); | ||
75 | 75 | | |||
76 | quickWindow()->setColor( The::paletteHandler()->palette().color( QPalette::Window ) ); | 76 | quickWindow()->setColor( The::paletteHandler()->palette().color( QPalette::Window ) ); | ||
77 | 77 | | |||
78 | auto qmlPackage = KPackage::PackageLoader::self()->loadPackage( QStringLiteral( "KPackage/GenericQML" ), | 78 | auto qmlPackage = KPackage::PackageLoader::self()->loadPackage( QStringLiteral( "KPackage/GenericQML" ), | ||
79 | QStringLiteral( "org.kde.amarok.context" ) ); | 79 | QStringLiteral( "org.kde.amarok.context" ) ); | ||
80 | Q_ASSERT( qmlPackage.isValid() ); | 80 | Q_ASSERT( qmlPackage.isValid() ); | ||
81 | 81 | | |||
82 | const QString sourcePath = qmlPackage.filePath( "mainscript" ); | 82 | const QUrl sourceUrl = qmlPackage.fileUrl( "mainscript" ); | ||
83 | Q_ASSERT( QFile::exists( sourcePath ) ); | | |||
84 | 83 | | |||
85 | ::debug() << "Loading context qml mainscript:" << sourcePath; | 84 | ::debug() << "Loading context qml mainscript:" << sourceUrl; | ||
86 | 85 | | |||
87 | setSource( QUrl::fromLocalFile( sourcePath ) ); | 86 | setSource( sourceUrl ); | ||
88 | setResizeMode( SizeRootObjectToView ); | 87 | setResizeMode( SizeRootObjectToView ); | ||
89 | 88 | | |||
90 | // keep this assignment at bottom so that premature usage of ::self() asserts out | 89 | // keep this assignment at bottom so that premature usage of ::self() asserts out | ||
91 | s_self = this; | 90 | s_self = this; | ||
92 | } | 91 | } | ||
93 | 92 | | |||
94 | ContextView::~ContextView() | 93 | ContextView::~ContextView() | ||
95 | { | 94 | { | ||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |