diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-26 22:13:52 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-26 22:15:20 +0100 |
commit | 0b56957297167538addd330e699e2e3cd2731d68 (patch) | |
tree | 7718aacad23f2800db8a53af9f2d4970bed9c992 /api | |
parent | c8d8702431e5b4fb275e9952d59efac69ca00960 (diff) |
compat: use gettext convention for tr()
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 |