Skip to content

Commit

Permalink
clang-format cleanup after 70e7042 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
leamas committed Sep 10, 2024
1 parent 70e7042 commit b5dd335
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
6 changes: 4 additions & 2 deletions gui/src/pluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3947,8 +3947,10 @@ void CatalogMgrPanel::OnTarballButton(wxCommandEvent& event) {
PluginMetadata metadata;
bool ok = handler->ExtractMetadata(path.ToStdString(), metadata);
if (!ok) {
OCPNMessageBox(this, _("Error extracting metadata from tarball (missing metadata.xml?)"),
_("OpenCPN Plugin Import Error"));
OCPNMessageBox(
this,
_("Error extracting metadata from tarball (missing metadata.xml?)"),
_("OpenCPN Plugin Import Error"));
return;
}
if (!PluginHandler::isCompatible(metadata)) {
Expand Down
17 changes: 10 additions & 7 deletions model/include/model/plugin_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,17 @@ class PluginHandler {
const std::string metadata_path, bool only_metadata);

/**
* Internal helper function to extract a tarball into platform-specific user directories.
* Internal helper function to extract a tarball into platform-specific user
* directories.
*
* @param path: Path to tarball.
* @param filelist: On return contains a list of files installed.
* @param metadata_path: If non-empty, location where to extract plugin metadata.xml file.
* @param metadata_path: If non-empty, location where to extract plugin
* metadata.xml file.
* @param only_metadata: If true don't install any files, just extract
* the metadata.xml file.
* @return true if tarball could be extracted and contains metadata.xml file.
* false otherwise.
* @return true if tarball could be extracted and contains metadata.xml
* file. false otherwise.
*/
bool explodeTarball(struct archive* src, struct archive* dest,
std::string& filelist, const std::string& metadata_path,
Expand All @@ -208,11 +210,12 @@ class PluginHandler {
*
* @param path: Path to tarball.
* @param filelist: On return contains a list of files installed.
* @param metadata_path: If non-empty, location where to extract plugin metadata.xml file.
* @param metadata_path: If non-empty, location where to extract plugin
* metadata.xml file.
* @param only_metadata: If true don't install any files, just extract
* the metadata.xml file.
* @return true if tarball could be extracted and contains metadata.xml file.
* false otherwise.
* @return true if tarball could be extracted and contains metadata.xml
* file. false otherwise.
*/
bool extractTarball(const std::string path, std::string& filelist,
const std::string metadata_path = "",
Expand Down
17 changes: 10 additions & 7 deletions model/src/plugin_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ class Plugin {
m_major_version = ocpn::split(m_abi_version.c_str(), ".")[0];
m_name = metadata.name;
DEBUG_LOG << "Plugin: setting up, name: " << m_name;
DEBUG_LOG << "Plugin: init: abi: " << m_abi << ", abi_version: " << m_abi_version <<
", major ver: " << m_major_version;
DEBUG_LOG << "Plugin: init: abi: " << m_abi
<< ", abi_version: " << m_abi_version
<< ", major ver: " << m_major_version;
}
const std::string& abi() const { return m_abi; }
const std::string& abi_version() const { return m_abi_version; }
Expand All @@ -229,8 +230,9 @@ class Host {
m_abi = compatOs->name();
m_abi_version = compatOs->version();
m_major_version = ocpn::split(m_abi_version.c_str(), ".")[0];
DEBUG_LOG << "Host: init: abi: " << m_abi << ", abi_version: " << m_abi_version <<
", major ver: " << m_major_version;
DEBUG_LOG << "Host: init: abi: " << m_abi
<< ", abi_version: " << m_abi_version
<< ", major ver: " << m_major_version;
}

bool is_version_compatible(const Plugin& plugin) const {
Expand Down Expand Up @@ -747,8 +749,8 @@ static bool entry_set_install_path(struct archive_entry* entry,
} else if (osSystemId & wxOS_MAC) {
rv = apple_entry_set_install_path(entry, installPaths);
} else {
MESSAGE_LOG << "set_install_path() invoked, unsupported platform " <<
wxPlatformInfo::Get().GetOperatingSystemDescription();
MESSAGE_LOG << "set_install_path() invoked, unsupported platform "
<< wxPlatformInfo::Get().GetOperatingSystemDescription();
rv = false;
}
#endif
Expand Down Expand Up @@ -1235,7 +1237,8 @@ bool PluginHandler::ClearInstallData(const std::string plugin_name) {
bool PluginHandler::DoClearInstallData(const std::string plugin_name) {
std::string path = PluginHandler::fileListPath(plugin_name);
if (!ocpn::exists(path)) {
MESSAGE_LOG << "Cannot find installation data for " << plugin_name << " (" << path << ")";
MESSAGE_LOG << "Cannot find installation data for " << plugin_name << " ("
<< path << ")";
return false;
}
std::vector<std::string> plug_paths = LoadLinesFromFile(path);
Expand Down

0 comments on commit b5dd335

Please sign in to comment.