diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 2 |
2 files changed, 20 insertions, 4 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 7168c33ce2..0c893dddd6 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -156,6 +156,8 @@ BOOL LLInventoryPanel::postBuild() initializeViews(); } + gIdleCallbacks.addFunction(onIdle, (void*)this); + if (mSortOrderSetting != INHERIT_SORT_ORDER) { setSortOrder(gSavedSettings.getU32(mSortOrderSetting)); @@ -255,13 +257,11 @@ void LLInventoryPanel::modelChanged(U32 mask) bool handled = false; - // inventory just initialized, do complete build - if ((mask & LLInventoryObserver::ADD) && mInventory->isInventoryUsable() && gInventory.getChangedIDs().empty() && !mViewsInitialized) + if (!mViewsInitialized) { - initializeViews(); return; } - + if (mask & LLInventoryObserver::LABEL) { handled = true; @@ -371,6 +371,20 @@ void LLInventoryPanel::modelChanged(U32 mask) } } +// static +void LLInventoryPanel::onIdle(void *userdata) +{ + LLInventoryPanel *self = (LLInventoryPanel*)userdata; + // inventory just initialized, do complete build + if (!self->mViewsInitialized && gInventory.isInventoryUsable()) + { + self->initializeViews(); + } + if (self->mViewsInitialized) + { + gIdleCallbacks.deleteFunction(onIdle, (void*)self); + } +} void LLInventoryPanel::initializeViews() { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 5b1104936d..fd23b375fa 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -160,6 +160,8 @@ public: void openSelected(); void unSelectAll() { mFolders->setSelection(NULL, FALSE, FALSE); } + static void onIdle(void* user_data); + private: // Given the id and the parent, build all of the folder views. |