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
+7 -6
View File
@@ -70,13 +70,14 @@ void AudioTabController::initStage2( OverlayController* var_parent,
notifKey.c_str(), notifKey.c_str(), &m_ulNotificationOverlayHandle );
if ( overlayError == vr::VROverlayError_None )
{
std::string notifIconPath
= QApplication::applicationDirPath().toStdString()
+ "/res/qml/ptt_notification.png";
if ( QFile::exists( QString::fromStdString( notifIconPath ) ) )
QString notifIconPath = QStandardPaths::locate(
QStandardPaths::AppDataLocation,
QStringLiteral( "/res/qml/ptt_notification.png" ) );
if ( QFile::exists( notifIconPath ) )
{
vr::VROverlay()->SetOverlayFromFile( m_ulNotificationOverlayHandle,
notifIconPath.c_str() );
vr::VROverlay()->SetOverlayFromFile(
m_ulNotificationOverlayHandle,
notifIconPath.toStdString().c_str() );
vr::VROverlay()->SetOverlayWidthInMeters(
m_ulNotificationOverlayHandle, 0.02f );
vr::HmdMatrix34_t notificationTransform