From: Gunnar Beutner Date: Tue, 24 Oct 2017 08:18:32 +0000 (+0200) Subject: Make the 'deprecated' keyword work for all field types X-Git-Tag: v2.8.0~28^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F5693%2Fhead;p=icinga2 Make the 'deprecated' keyword work for all field types --- diff --git a/tools/mkclass/classcompiler.cpp b/tools/mkclass/classcompiler.cpp index eb44de809..04e9abdeb 100644 --- a/tools/mkclass/classcompiler.cpp +++ b/tools/mkclass/classcompiler.cpp @@ -514,7 +514,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&) if (field.Type.GetRealType().find("::Ptr") != std::string::npos) m_Impl << "\t" << "if (" << argName << ")" << std::endl; else - m_Impl << "\t" << "if (!" << argName << ".IsEmpty())" << std::endl; + m_Impl << "\t" << "if (" << argName << " != GetDefault" << field.GetFriendlyName() << "())" << std::endl; m_Impl << "\t\t" << "Log(LogWarning, \"" << klass.Name << "\") << \"Attribute '" << field.Name << "' for object '\" << dynamic_cast(this)->GetName() << \"' of type '\" << dynamic_cast(this)->GetReflectionType()->GetName() << \"' is deprecated and should not be used.\";" << std::endl; }