mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 21:09:27 -06:00
Cleanup (#600)
* General Code Cleanup * Add check for TABs to check_style_guide.py * Removing warnings
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2017 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -68,7 +68,9 @@ std::string WebBrowserModule::findHelperExecutable() {
|
||||
auto execLocation = absPath(OsEng.configurationManager().value<std::string>(
|
||||
ConfigurationManager::KeyWebHelperLocation) + SUBPROCESS_ENDING);
|
||||
if (!FileSys.fileExists(execLocation)) {
|
||||
LERROR(fmt::format("Could not find web helper executable at location: {}" , execLocation));
|
||||
LERROR(fmt::format(
|
||||
"Could not find web helper executable at location: {}" , execLocation
|
||||
));
|
||||
}
|
||||
return execLocation;
|
||||
}
|
||||
@@ -78,19 +80,29 @@ std::string WebBrowserModule::findHelperExecutable() {
|
||||
LWARNING(fmt::format("Assuming web helper name is {}", subprocessName));
|
||||
auto subLength = (int)subprocessName.length();
|
||||
|
||||
Directory binDir("${BASE}/bin/openspace", Directory::AbsolutePath::No);
|
||||
std::vector<std::string> foundFiles = binDir.readFiles(Directory::Recursive::Yes, Directory::Sort::Yes);
|
||||
Directory binDir("${BASE}/bin/openspace", Directory::RawPath::No);
|
||||
std::vector<std::string> foundFiles = binDir.readFiles(
|
||||
Directory::Recursive::Yes,
|
||||
Directory::Sort::Yes
|
||||
);
|
||||
|
||||
// find files matching the given file name
|
||||
std::vector<std::string> matchingFiles;
|
||||
std::copy_if(foundFiles.begin(), foundFiles.end(), std::back_inserter(matchingFiles),
|
||||
std::copy_if(
|
||||
foundFiles.begin(),
|
||||
foundFiles.end(),
|
||||
std::back_inserter(matchingFiles),
|
||||
[subprocessName, subLength](std::string s) {
|
||||
s = s.substr(s.size() - subLength);
|
||||
return s == subprocessName;
|
||||
});
|
||||
s = s.substr(s.size() - subLength);
|
||||
return s == subprocessName;
|
||||
}
|
||||
);
|
||||
|
||||
if (matchingFiles.empty()) {
|
||||
LERROR(fmt::format("Could not find requested sub process executable file name: {}", subprocessName));
|
||||
LERROR(fmt::format(
|
||||
"Could not find requested sub process executable file name: {}",
|
||||
subprocessName
|
||||
));
|
||||
}
|
||||
|
||||
return matchingFiles.back();
|
||||
@@ -125,7 +137,9 @@ void WebBrowserModule::removeBrowser(std::shared_ptr<BrowserInstance> browser) {
|
||||
LDEBUG(fmt::format("Number of browsers stored: {}", _browsers.size()));
|
||||
}
|
||||
|
||||
void WebBrowserModule::attachEventHandler(std::shared_ptr<BrowserInstance> browserInstance) {
|
||||
void WebBrowserModule::attachEventHandler(
|
||||
std::shared_ptr<BrowserInstance> browserInstance)
|
||||
{
|
||||
_eventHandler.setBrowserInstance(browserInstance);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user