diff options
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 6 |
2 files changed, 14 insertions, 9 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1a6e25fb0f..9e4f4c0adc 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2334,14 +2334,14 @@ void LLInventorySingleFolderPanel::clearNavigationHistory() mBackwardFolders.clear(); } -bool LLInventorySingleFolderPanel::isBackwardAvailable() +bool LLInventorySingleFolderPanel::isBackwardAvailable() const { - return (!mBackwardFolders.empty() && (mFolderID != mBackwardFolders.back())); + return !mBackwardFolders.empty() && (mFolderID != mBackwardFolders.back()); } -bool LLInventorySingleFolderPanel::isForwardAvailable() +bool LLInventorySingleFolderPanel::isForwardAvailable() const { - return (!mForwardFolders.empty() && (mFolderID != mForwardFolders.back())); + return !mForwardFolders.empty() && (mFolderID != mForwardFolders.back()); } boost::signals2::connection LLInventorySingleFolderPanel::setRootChangedCallback(root_changed_callback_t cb) @@ -2406,9 +2406,14 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot() } } -bool LLInventorySingleFolderPanel::hasVisibleItems() +bool LLInventorySingleFolderPanel::hasVisibleItems() const { - return mFolderRoot.get()->hasVisibleChildren(); + if (const LLFolderView* root = mFolderRoot.get()) + { + return root->hasVisibleChildren(); + } + + return false; } void LLInventorySingleFolderPanel::doCreate(const LLSD& userdata) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 6dead2cf6d..56909c8d98 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -420,10 +420,10 @@ public: void doToSelected(const LLSD& userdata); void doShare(); - bool isBackwardAvailable(); - bool isForwardAvailable(); + bool isBackwardAvailable() const; + bool isForwardAvailable() const; - bool hasVisibleItems(); + bool hasVisibleItems() const; void setNavBackwardList(std::list<LLUUID> backward_list) { mBackwardFolders = backward_list; } void setNavForwardList(std::list<LLUUID> forward_list) { mForwardFolders = forward_list; } |