Refactor actions into separate action sets (#122)

* Fix indentation in action manifest

* Rename action sets to drop unnecessary prefix notation

Since the variable is in the action_sets namespace it does not make
sense to prepend it with an identifier for it being constant, or a set.

* Rename input keys to drop prefix notation

The vars are in a namespace that only contains constant inputs, it
doesn't make sense to prepend it to every var.

* Rename actions to drop prefixes

It is implicit that actions are const values for sets, therefore the
prefix is not needed.

* Remove unneeded action set member func

* Move active action set in preparation for more action sets

* Move action strings above class

Class is not able to use variables in namespaces, which is stupid.

* Move sets into member variable

* Split music into separate action set

* Convert action_manifest.json to spaces only

* Refactor actions into separate action sets

* Rename main set to haptic

* Reorder action sets

The haptics and misc sets are misc bindings.

* format

* fixed manifest path issue

* Change path concat to use QDir

The old way was not platform independent.

* Move accessibility actions to motion set

* Remove "(Held)" from action name

Might be confusing for end users.

* Replace slash with platform independent separator

* Make paths output native paths
This commit is contained in:
username223
2019-03-20 15:42:45 -05:00
committed by ykeara
parent fc34347c12
commit 86fdc8f26f
6 changed files with 220 additions and 192 deletions
+5 -4
View File
@@ -4,6 +4,7 @@
#include <QString>
#include <QFileInfo>
#include <easylogging++.h>
#include <QDir>
namespace paths
{
@@ -29,9 +30,9 @@ optional<string> binaryDirectoryFindFile( const string fileName )
return std::nullopt;
}
const auto filePath = QString::fromStdString( *path ) + "/"
+ QString::fromStdString( fileName );
QFileInfo file( filePath );
const auto filePath = QDir( QString::fromStdString( *path ) + '/'
+ QString::fromStdString( fileName ) );
QFileInfo file( filePath.path() );
if ( !file.exists() )
{
@@ -40,7 +41,7 @@ optional<string> binaryDirectoryFindFile( const string fileName )
return std::nullopt;
}
return filePath.toStdString();
return QDir::toNativeSeparators( file.filePath() ).toStdString();
}
optional<string> settingsDirectory()
+1
View File
@@ -146,6 +146,7 @@ void reinstallApplicationManifest( const std::string manifestPath )
if ( vr::VRApplications()->IsApplicationInstalled(
application_strings::applicationKey ) )
{
LOG( INFO ) << "Manifest Previously Installed";
// String size was arbitrarily chosen by original author.
constexpr auto kStringSize = 1024;
char oldApplicationWorkingDir[kStringSize] = { 0 };