Move application strings into separate namespace

Them being in the overlay controller required them to be static, which
forces the compiler to give them a memory location at compile time. They
also don't really fit into the overlaycontroller.
This commit is contained in:
Vasily
2019-03-11 11:24:57 +01:00
parent cab99041be
commit 5b9e94869c
8 changed files with 30 additions and 34 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ void AudioTabController::initStage2( OverlayController* var_parent,
this->widget = var_widget;
std::string notifKey
= std::string( OverlayController::applicationKey ) + ".pptnotification";
= std::string( application_strings::applicationKey ) + ".pptnotification";
vr::VROverlayError overlayError = vr::VROverlay()->CreateOverlay(
notifKey.c_str(), notifKey.c_str(), &m_ulNotificationOverlayHandle );
@@ -540,8 +540,7 @@ void ChaperoneTabController::handleChaperoneWarnings( float distance )
{
if ( !vr::VROverlay()->IsDashboardVisible() )
{
vr::VROverlay()->ShowDashboard(
OverlayController::applicationKey );
vr::VROverlay()->ShowDashboard( application_strings::applicationKey );
}
m_chaperoneShowDashboardActive = true;
}
+3 -3
View File
@@ -8,7 +8,7 @@ namespace advsettings
void SettingsTabController::initStage1()
{
m_autoStartEnabled = vr::VRApplications()->GetApplicationAutoLaunch(
OverlayController::applicationKey );
application_strings::applicationKey );
auto settings = OverlayController::appSettings();
settings->beginGroup( "applicationSettings" );
auto value = settings->value( "forceRevivePage", m_forceRevivePage );
@@ -33,7 +33,7 @@ void SettingsTabController::eventLoopTick()
if ( parent->isDashboardVisible() )
{
setAutoStartEnabled( vr::VRApplications()->GetApplicationAutoLaunch(
OverlayController::applicationKey ) );
application_strings::applicationKey ) );
}
settingsUpdateCounter = 0;
}
@@ -54,7 +54,7 @@ void SettingsTabController::setAutoStartEnabled( bool value, bool notify )
{
m_autoStartEnabled = value;
auto apperror = vr::VRApplications()->SetApplicationAutoLaunch(
OverlayController::applicationKey, m_autoStartEnabled );
application_strings::applicationKey, m_autoStartEnabled );
if ( apperror != vr::VRApplicationError_None )
{
LOG( ERROR ) << "Could not set auto start: "
@@ -259,8 +259,8 @@ QString getBatteryIconPath( int batteryState )
vr::VROverlayHandle_t createBatteryOverlay( vr::TrackedDeviceIndex_t index )
{
vr::VROverlayHandle_t handle = vr::k_ulOverlayHandleInvalid;
std::string batteryKey = std::string( OverlayController::applicationKey )
+ ".battery." + std::to_string( index );
std::string batteryKey = std::string( application_strings::applicationKey ) + ".battery."
+ std::to_string( index );
vr::VROverlayError overlayError = vr::VROverlay()->CreateOverlay(
batteryKey.c_str(), batteryKey.c_str(), &handle );
if ( overlayError == vr::VROverlayError_None )