From 6c0ae194a51eda971ede8de6666a8d16761f9506 Mon Sep 17 00:00:00 2001 From: Vasily Date: Sun, 17 Mar 2019 16:53:30 +0100 Subject: [PATCH] Convert main to new paths --- src/main.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index cbc8c03..de0ca5f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,10 +78,18 @@ int main( int argc, char* argv[] ) { try { - const auto manifestPath = QDir::cleanPath( - QDir( QCoreApplication::applicationDirPath() ) - .absoluteFilePath( manifest::kVRManifestName ) ); - manifest::installApplicationManifest( manifestPath ); + const auto manifestPath = paths::binaryDirectoryFindFile( + manifest::kVRManifestName ); + if ( !manifestPath.has_value() ) + { + throw std::runtime_error( + "Could not find applications manifest." ); + } + else + { + manifest::installApplicationManifest( + QString::fromStdString( *manifestPath ) ); + } } catch ( std::exception& e ) {