bool TraverseStmt(clang::Stmt *S) { if (!S) return true; auto const Visible = getPresence(S); auto const Show = shouldShow(S, Visible); Visibilities.push(Visible); Shown.push(Show); Parents.push(S); if (Show) { if (CurrentDepth > MaxDepth) MaxDepth = CurrentDepth; Depths[S] = CurrentDepth; ++CurrentDepth; } auto const Result = DoTraverseStmt(S); if (Show) --CurrentDepth; Visibilities.pop(); Shown.pop(); Parents.pop(); return Result; }
void InfoView::loaded(bool ok) { if (!ok || !shouldShow()) { deleteLater(); return; } QDesktopWidget* desktop = Application::getInstance()->desktop(); QWebFrame* mainFrame = page()->mainFrame(); int height = mainFrame->contentsSize().height() > desktop->height() ? desktop->height() * MAX_DIALOG_HEIGHT_RATIO : mainFrame->contentsSize().height(); resize(mainFrame->contentsSize().width(), height); move(desktop->screen()->rect().center() - rect().center()); setWindowTitle(title()); setAttribute(Qt::WA_DeleteOnClose); show(); }
void LLPanelNearByMedia::refreshList() { bool all_items_deleted = false; if(!mMediaList) { // None of this makes any sense if the media list isn't there. return; } // Check whether the debug column has been shown/hidden. bool debug_info_visible = gSavedSettings.getBOOL("MediaPerformanceManagerDebug"); if(debug_info_visible != mDebugInfoVisible) { mDebugInfoVisible = debug_info_visible; // Clear all items so the list gets regenerated. mMediaList->deleteAllItems(); mParcelAudioItem = NULL; mParcelMediaItem = NULL; all_items_deleted = true; updateColumns(); } refreshParcelItems(); // Get the canonical list from LLViewerMedia LLViewerMedia::impl_list impls = LLViewerMedia::getPriorityList(); LLViewerMedia::impl_list::iterator priority_iter; U32 enabled_count = 0; U32 disabled_count = 0; // iterate over the impl list, creating rows as necessary. for(priority_iter = impls.begin(); priority_iter != impls.end(); priority_iter++) { LLViewerMediaImpl *impl = *priority_iter; // If we just emptied out the list, every flag needs to be reset. if(all_items_deleted) { impl->setInNearbyMediaList(false); } if (!impl->isParcelMedia()) { LLUUID media_id = impl->getMediaTextureID(); S32 proximity = impl->getProximity(); // This is expensive (i.e. a linear search) -- don't use it here. We now use mInNearbyMediaList instead. //S32 index = mMediaList->getItemIndex(media_id); if (proximity < 0 || !shouldShow(impl)) { if (impl->getInNearbyMediaList()) { // There's a row for this impl -- remove it. removeListItem(media_id); impl->setInNearbyMediaList(false); } } else { if (!impl->getInNearbyMediaList()) { // We don't have a row for this impl -- add one. addListItem(media_id); impl->setInNearbyMediaList(true); } } // Update counts if (impl->isMediaDisabled()) { disabled_count++; } else { enabled_count++; } } } mDisableAllCtrl->setEnabled((gSavedSettings.getBOOL("AudioStreamingMusic") || gSavedSettings.getBOOL("AudioStreamingMedia")) && (LLViewerMedia::isAnyMediaShowing() || LLViewerMedia::isParcelMediaPlaying() || LLViewerMedia::isParcelAudioPlaying())); mEnableAllCtrl->setEnabled( (gSavedSettings.getBOOL("AudioStreamingMusic") || gSavedSettings.getBOOL("AudioStreamingMedia")) && (disabled_count > 0 || // parcel media (if we have it, and it isn't playing, enable "start") (LLViewerMedia::hasParcelMedia() && ! LLViewerMedia::isParcelMediaPlaying()) || // parcel audio (if we have it, and it isn't playing, enable "start") (LLViewerMedia::hasParcelAudio() && ! LLViewerMedia::isParcelAudioPlaying()))); // Iterate over the rows in the control, updating ones whose impl exists, and deleting ones whose impl has gone away. std::vector<LLScrollListItem*> items = mMediaList->getAllData(); for (std::vector<LLScrollListItem*>::iterator item_it = items.begin(); item_it != items.end(); ++item_it) { LLScrollListItem* item = (*item_it); LLUUID row_id = item->getUUID(); if (row_id != PARCEL_MEDIA_LIST_ITEM_UUID && row_id != PARCEL_AUDIO_LIST_ITEM_UUID) { LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(row_id); if(impl) { updateListItem(item, impl); } else { // This item's impl has been deleted -- remove the row. // Removing the row won't throw off our iteration, since we have a local copy of the array. // We just need to make sure we don't access this item after the delete. removeListItem(row_id); } } } // Set the selection to whatever media impl the media focus/hover is on. // This is an experiment, and can be removed by ifdefing out these 4 lines. LLUUID media_target = LLViewerMediaFocus::getInstance()->getControlsMediaID(); if(media_target.notNull()) { mMediaList->selectByID(media_target); } }