]> granicus.if.org Git - icinga2/commitdiff
Make the 'deprecated' keyword work for all field types 5693/head
authorGunnar Beutner <gunnar.beutner@icinga.com>
Tue, 24 Oct 2017 08:18:32 +0000 (10:18 +0200)
committerJean Flach <jean-marcel.flach@icinga.com>
Tue, 24 Oct 2017 13:54:16 +0000 (15:54 +0200)
tools/mkclass/classcompiler.cpp

index eb44de809649c18cd2bfcd65344ce4a4792c7df9..04e9abdeb8e29dd747a75a57348d24f90c2ef35d 100644 (file)
@@ -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<ConfigObject *>(this)->GetName() << \"' of type '\" << dynamic_cast<ConfigObject *>(this)->GetReflectionType()->GetName() << \"' is deprecated and should not be used.\";" << std::endl;
                }