Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
toloudis committed May 21, 2024
1 parent 8ad44a6 commit 1753304
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ if(WIN32)
WriteRegStr HKCR 'agave\\\\DefaultIcon' '' '\\\"$INSTDIR\\\\agave-install\\\\agave.exe\\\"'
WriteRegStr HKCR 'agave\\\\shell' '' ''
WriteRegStr HKCR 'agave\\\\shell\\\\open' '' ''
WriteRegStr HKCR 'agave\\\\shell\\\\open\\\\command' '' '\\\"$INSTDIR\\\\agave-install\\\\agave.exe\\\" --load %1'
WriteRegStr HKCR 'agave\\\\shell\\\\open\\\\command' '' '\\\"$INSTDIR\\\\agave-install\\\\agave.exe\\\" --load \\\"%1\\\"'
")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
DeleteRegKey HKCR 'agave'
Expand Down
9 changes: 7 additions & 2 deletions agave_app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,13 @@ main(int argc, char* argv[])
bool listDevices = parser.isSet(listDevicesOption);
int selectedGpu = parser.value(selectGpuOption).toInt();
QString fileToLoad = parser.value(loadOption);
// the file path may be percent encoded, if it came through a url protocol handler, so decode it
fileToLoad = QUrl::fromPercentEncoding(fileToLoad.toUtf8());
if (fileToLoad.startsWith("agave://")) {
// the file path may be percent encoded, if it came through a url protocol handler, so decode it
// remove any leading and trailing double quotes or protocol prefixes
fileToLoad = QUrl::fromPercentEncoding(fileToLoad.toUtf8());
// remove agave:// prefix and trailing slash
fileToLoad = fileToLoad.replace(QRegExp("^agave://|/$"), "");
}

QString appPath = QCoreApplication::applicationDirPath();
std::string appPathStr = appPath.toStdString();
Expand Down

0 comments on commit 1753304

Please sign in to comment.