mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
impr: Don't display plugins in the list that couldn't be loaded
This commit is contained in:
@@ -58,13 +58,25 @@ namespace hex {
|
||||
other.m_handle = 0;
|
||||
|
||||
m_libraryPlugin = other.m_libraryPlugin;
|
||||
|
||||
m_path = std::move(other.m_path);
|
||||
m_path = std::move(other.m_path);
|
||||
|
||||
m_functions = other.m_functions;
|
||||
other.m_functions = {};
|
||||
}
|
||||
|
||||
Plugin& Plugin::operator=(Plugin &&other) noexcept {
|
||||
m_handle = other.m_handle;
|
||||
other.m_handle = 0;
|
||||
|
||||
m_libraryPlugin = other.m_libraryPlugin;
|
||||
m_path = std::move(other.m_path);
|
||||
|
||||
m_functions = other.m_functions;
|
||||
other.m_functions = {};
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Plugin::~Plugin() {
|
||||
#if defined(OS_WINDOWS)
|
||||
if (m_handle != 0)
|
||||
@@ -164,6 +176,10 @@ namespace hex {
|
||||
return m_path;
|
||||
}
|
||||
|
||||
bool Plugin::isValid() const {
|
||||
return m_handle != 0;
|
||||
}
|
||||
|
||||
bool Plugin::isLoaded() const {
|
||||
return m_initialized;
|
||||
}
|
||||
@@ -203,6 +219,10 @@ namespace hex {
|
||||
getPlugins().emplace_back(pluginPath.path(), false);
|
||||
}
|
||||
|
||||
std::erase_if(getPlugins(), [](const Plugin &plugin) {
|
||||
return !plugin.isValid();
|
||||
});
|
||||
|
||||
if (getPlugins().empty())
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user