diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/plugin-api.cpp | 6 | ||||
-rw-r--r-- | api/plugin-api.hpp | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/api/plugin-api.cpp b/api/plugin-api.cpp index eed377b0..6820ff2c 100644 --- a/api/plugin-api.cpp +++ b/api/plugin-api.cpp @@ -1,4 +1,5 @@ #include "plugin-api.hpp" +#include "compat/macros.hpp" using namespace plugin_api::detail; @@ -66,4 +67,7 @@ module_status::module_status(const QString& error) : error(error) {} module_status module_status_mixin::status_ok() { return module_status(); } -module_status module_status_mixin::error(const QString& error) { return module_status(error); } +module_status module_status_mixin::error(const QString& error) +{ + return module_status(error.isEmpty() ? QString(_("Unknown error")) : error); +} diff --git a/api/plugin-api.hpp b/api/plugin-api.hpp index 48a1f408..4a797f73 100644 --- a/api/plugin-api.hpp +++ b/api/plugin-api.hpp @@ -90,12 +90,15 @@ struct OTR_API_EXPORT module_status final module_status(const QString& error = QString()); }; +/* + * implement in all module types + */ struct OTR_API_EXPORT module_status_mixin { - static module_status status_ok(); - static module_status error(const QString& error); + static module_status status_ok(); // return from initialize() if ok + static module_status error(const QString& error); // return error message on init failure - virtual module_status initialize() = 0; + virtual module_status initialize() = 0; // where to return from }; // implement this in filters |