void favorites2::updateVolumeList( const std::vector< favorites::entry >& e,int row ) { _updateList( m_ui->tableWidget,this->font(),e,row ) ; if( size_t( row ) < e.size() ){ this->setVolumeProperties( e[ size_t( row ) ] ) ; }else{ this->setVolumeProperties( {} ) ; } }
void favorites2::updateVolumeList( const std::vector<favorites::entry>& e,const QString& volPath ) { _updateList( m_ui->tableWidget,this->font(),e,volPath ) ; auto _update = [ & ]()->const favorites::entry&{ for( const auto& it : e ){ if( it.volumePath == volPath ){ return it ; } } static favorites::entry m ; return m ; } ; this->setVolumeProperties( _update() ) ; }
void DormantNodeView::MessageReceived( BMessage *message) { D_MESSAGE(("DormantNodeView::MessageReceived()\n")); switch (message->what) { case B_MEDIA_FLAVORS_CHANGED: { D_MESSAGE((" -> B_MEDIA_FLAVORS_CHANGED\n")); // init & re-populate the list int32 addOnID = 0; if (message->FindInt32("be:addon_id", &addOnID) != B_OK) { D_MESSAGE((" -> messages doesn't contain 'be:addon_id'!\n")); return; } _updateList(addOnID); break; } case InfoWindowManager::M_INFO_WINDOW_REQUESTED: { D_MESSAGE((" -> InfoWindowManager::M_INFO_WINDOW_REQUESTED)\n")); DormantNodeListItem *item; item = dynamic_cast<DormantNodeListItem *>(ItemAt(CurrentSelection())); if (item) { InfoWindowManager *manager = InfoWindowManager::Instance(); if (manager && manager->Lock()) { manager->openWindowFor(item->info()); manager->Unlock(); } } break; } default: { _inherited::MessageReceived(message); } } }