From 551acaa2df046a25f90d716bd1153522821073e9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Jul 2010 14:19:07 -0700 Subject: eliminated a bunch of silent warnings on startup about multiple widget registration --- indra/llui/llloadingindicator.cpp | 2 +- indra/llui/llui.cpp | 1 - indra/llui/lluictrlfactory.cpp | 20 ++++++++++++++------ indra/llui/lluictrlfactory.h | 5 +++-- 4 files changed, 18 insertions(+), 10 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp index f8b029e19c..bf92f77386 100644 --- a/indra/llui/llloadingindicator.cpp +++ b/indra/llui/llloadingindicator.cpp @@ -41,7 +41,7 @@ #include "lluictrlfactory.h" #include "lluiimage.h" -static LLDefaultChildRegistry::Register r("loading_indicator"); +//static LLDefaultChildRegistry::Register r("loading_indicator"); /////////////////////////////////////////////////////////////////////////////// // LLLoadingIndicator::Data class diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index dff1cb93e7..7f9dca08d2 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -97,7 +97,6 @@ static LLDefaultChildRegistry::Register register_flyout_button(" static LLDefaultChildRegistry::Register register_search_editor("search_editor"); // register other widgets which otherwise may not be linked in -static LLDefaultChildRegistry::Register register_menu_button("menu_button"); static LLDefaultChildRegistry::Register register_loading_indicator("loading_indicator"); diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 6b337e0d74..a46d961709 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -452,14 +452,22 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st { // associate parameter block type with template .xml file std::string* existing_tag = LLWidgetNameRegistry::instance().getValue(param_block_type); - if (existing_tag != NULL && *existing_tag != tag) + if (existing_tag != NULL) { - std::cerr << "Duplicate entry for T::Params, try creating empty param block in derived classes that inherit T::Params" << std::endl; - // forcing crash here - char* foo = 0; - *foo = 1; + if(*existing_tag != tag) + { + std::cerr << "Duplicate entry for T::Params, try creating empty param block in derived classes that inherit T::Params" << std::endl; + // forcing crash here + char* foo = 0; + *foo = 1; + } + else + { + // widget already registered + return; + } } - LLWidgetNameRegistry ::instance().defaultRegistrar().add(param_block_type, tag); + LLWidgetNameRegistry::instance().defaultRegistrar().add(param_block_type, tag); // associate widget type with factory function LLDefaultWidgetRegistry::instance().defaultRegistrar().add(widget_type, creator_func); //FIXME: comment this in when working on schema generation diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 7da96ffce3..c99acee48e 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -373,8 +373,9 @@ LLChildRegistry::Register::Register(const char* tag, LLWidgetCreator LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), &LLUICtrlFactory::createDefaultWidget, tag); // since registry_t depends on T, do this in line here - typedef typename T::child_registry_t registry_t; - LLChildRegistryRegistry::instance().defaultRegistrar().add(&typeid(T), registry_t::instance()); + // TODO: uncomment this for schema generation + //typedef typename T::child_registry_t registry_t; + //LLChildRegistryRegistry::instance().defaultRegistrar().add(&typeid(T), registry_t::instance()); } -- cgit v1.2.3