Fix depreciation -> deprecation.

This commit is contained in:
Mikaël Capelle
2020-08-30 11:15:31 +02:00
parent 3780f157e4
commit d8657946e9
3 changed files with 12 additions and 10 deletions
+1 -1
View File
@@ -658,7 +658,7 @@ BOOST_PYTHON_MODULE(mobase)
// Kept but deprecated for backward compatibility:
.def("onModStateChanged", +[](IModList* modList, const std::function<void(const QString&, IModList::ModStates)>& fn) {
utils::show_depreciation_warning("onModStateChanged",
utils::show_deprecation_warning("onModStateChanged",
"onModStateChanged(Callable[[str, IModList.ModStates], None]) is deprecated, "
"use onModStateChanged(Callable[[Dict[str, IModList.ModStates], None]) instead.");
return modList->onModStateChanged([fn](auto const& map) {
+3 -3
View File
@@ -9,9 +9,9 @@
namespace utils {
void show_depreciation_warning(std::string_view name, std::string_view message, bool show_once) {
void show_deprecation_warning(std::string_view name, std::string_view message, bool show_once) {
// Contains the list of filename / line number for which a depreciation warning has already been shown.
// Contains the list of filename / line number for which a deprecation warning has already been shown.
static std::set<std::pair<std::string, int>> DeprecatedLines;
// Find the caller:
@@ -27,7 +27,7 @@ namespace utils {
return;
}
// Register the depreciation:
// Register the deprecation:
DeprecatedLines.emplace(filename, lineno);
auto path = relative(std::filesystem::path(filename), QCoreApplication::applicationDirPath().toStdWString());
+8 -6
View File
@@ -199,15 +199,17 @@ namespace utils {
/**
* @brief Show a depreciation warning.
* @brief Show a deprecation warning.
*
* This methods will print a warning in MO2 log containing the location of the call to
* the deprecated function. If show_once is true, the deprecation warning will only be
* logged the first time the function is called at this location.
*
* @param name Name of the deprecated function.
* @param message Depreciation message.
* @param show_once Only show the message once.
*
* @return a depreciation object.
* @param message Deprecation message.
* @param show_once Only show the message once per call location.
*/
void show_depreciation_warning(std::string_view name, std::string_view message = "", bool show_once = true);
void show_deprecation_warning(std::string_view name, std::string_view message = "", bool show_once = true);
}