void D3_Hero::setItems( QVariant _items ) { clearItems(); QVariantMap mItems = _items.toMap(); if( !mItems.contains( lstrItemsKey[ e_Item_Special ] ) ) { for( uint i = e_Item_Head; i<e_Item_MainHand; ++i ) { D3_Item* pItem = new D3_Item(); QJson::QObjectHelper::qvariant2qobject( mItems[ lstrItemsKey[ i ] ].toMap(), pItem ); m_hItems.insert( i, pItem ); } } else { D3_Item* pItem = new D3_Item(); QJson::QObjectHelper::qvariant2qobject( mItems[ lstrItemsKey[ e_Item_Special ] ].toMap(), pItem ); m_hItems.insert( e_Item_Special, pItem ); } for( uint i = e_Item_MainHand; i<e_Item_Special; ++i ) { D3_Item* pItem = new D3_Item(); QJson::QObjectHelper::qvariant2qobject( mItems[ lstrItemsKey[ i ] ].toMap(), pItem ); m_hItems.insert( i, pItem ); } }
IBucket *Pipeline::nextItem() { while(1) { if (buffer.empty()) { #ifdef DEBUG // It should not be possible to propagate more buckets clearItems(); I(buffer.empty()); #endif return 0; } if( ((buffer.top())->getClock() + PipeLength) > globalClock ) return 0; IBucket *b = buffer.top(); buffer.pop(); I(!b->empty()); if (!b->cleanItem) { I(!b->empty()); I(b->top() != 0); return b; } I(b->cleanItem); I(!b->empty()); I(b->top() == 0); b->pop(); I(b->empty()); cleanBucketPool.push_back(b); } I(0); }
void SpawnShell::clear(void) { #ifdef SPAWNSHELL_DIAG printf("SpawnShell::clear()\n"); #endif emit clearItems(); m_spawns.clear(); m_coins.clear(); m_doors.clear(); m_drops.clear(); // clear the players list, reinsert the player m_players.clear(); m_players.insert(0, m_player); // emit an changeItem for the player emit changeItem(m_player, tSpawnChangedALL); m_cntDeadSpawnIDs = 0; m_posDeadSpawnIDs = 0; for (int i = 0; i < MAX_DEAD_SPAWNIDS; i++) m_deadSpawnID[i] = 0; } // end clear
void GuiDirectoryFileListCtrl::openDirectory() { String path; if( mFilePath && mFilePath[ 0 ] ) path = String::ToString( "%s/%s", Platform::getMainDotCsDir(), mFilePath ); else path = Platform::getMainDotCsDir(); Vector<Platform::FileInfo> fileVector; Platform::dumpPath( path, fileVector, 0 ); // Clear the current file listing clearItems(); // Does this dir have any files? if( fileVector.empty() ) return; // If so, iterate through and list them Vector<Platform::FileInfo>::iterator i = fileVector.begin(); for( S32 j=0 ; i != fileVector.end(); i++, j++ ) { if( !mFilter[ 0 ] || FindMatch::isMatchMultipleExprs( mFilter, (*i).pFileName,false ) ) addItem( (*i).pFileName ); } }
ListFileProvider::~ListFileProvider() { stopThread(); clearItems(); clearThreadItems(); }
UIGDetailsSet::~UIGDetailsSet() { /* Cleanup items: */ clearItems(); /* Remove set from the parent group: */ parentItem()->removeItem(this); }
UIGDetailsSet::~UIGDetailsSet() { /* Delete all the items: */ clearItems(); /* Remove item from the parent: */ parentItem()->removeItem(this); }
void K3bDataFileView::slotSetCurrentDir( K3bDirItem* dir ) { if( dir ) { m_currentDir = dir; clearItems(); checkForNewItems(); } }
void GxsCommentTreeWidget::loadThread(const uint32_t &token) { clearItems(); service_loadThread(token); completeItems(); }
void UIGDetailsGroup::clearItems(UIGDetailsItemType type /* = UIGDetailsItemType_Set */) { switch (type) { case UIGDetailsItemType_Any: clearItems(UIGDetailsItemType_Set); break; case UIGDetailsItemType_Set: while (!m_sets.isEmpty()) { delete m_sets.last(); } break; default: AssertMsgFailed(("Invalid item type!")); break; } }
UIGSelectorItemGroup::~UIGSelectorItemGroup() { /* Delete all the items: */ clearItems(); /* Remove item from the parent: */ if (parentItem()) parentItem()->removeItem(this); }
void ListFileProvider::refresh() { stopThread(); clearItems(); if ( !paths_.empty() ) startThread(); }
void LLWorldMap::reset() { clearItems(true); // Clear the items lists clearImageRefs(); // Clear the world mipmap and the land for sale tiles clearSimFlags(); // Clear the block info flags array // Finally, clear the region map itself for_each(mSimInfoMap.begin(), mSimInfoMap.end(), DeletePairedPointer()); mSimInfoMap.clear(); }
void QuteComboBox::setText(QString text) { #ifdef USE_WIDGET_MUTEX widgetLock.lockForWrite(); #endif clearItems(); QStringList items = text.split(","); int counter = 0; foreach (QString item, items) { addItem(item, counter++, ""); }
void ListFileProvider::init( const std::string& type, const std::string& paths, const std::string& extensions, const std::string& includeFolders, const std::string& excludeFolders, int flags ) { stopThread(); // member variables type_ = type; flags_ = flags; paths_.clear(); extensions_.clear(); includeFolders_.clear(); excludeFolders_.clear(); std::string pathsL = paths; std::replace( pathsL.begin(), pathsL.end(), '/', '\\' ); StringUtils::vectorFromString( pathsL, paths_ ); std::string extL = extensions; StringUtils::toLowerCase( extL ); StringUtils::vectorFromString( extL, extensions_ ); hasImages_ = false; for( std::vector<std::string>::iterator i = extensions_.begin(); i != extensions_.end(); ++i ) { if ( (*i) == "dds" ) { hasImages_ = true; break; } } std::string includeFoldersL = includeFolders; std::replace( includeFoldersL.begin(), includeFoldersL.end(), '/', '\\' ); StringUtils::vectorFromString( includeFoldersL, includeFolders_ ); std::string excludeFoldersL = excludeFolders; std::replace( excludeFoldersL.begin(), excludeFoldersL.end(), '/', '\\' ); StringUtils::vectorFromString( excludeFoldersL, excludeFolders_ ); StringUtils::filterSpecVector( paths_, excludeFolders_ ); // clear items and start file-seeking thread clearItems(); if ( !paths_.empty() ) startThread(); }
void LLWorldMap::reloadItems(bool force) { //LL_INFOS("World Map") << "LLWorldMap::reloadItems()" << LL_ENDL; if (clearItems(force)) { LLWorldMapMessage::getInstance()->sendItemRequest(MAP_ITEM_TELEHUB); LLWorldMapMessage::getInstance()->sendItemRequest(MAP_ITEM_PG_EVENT); LLWorldMapMessage::getInstance()->sendItemRequest(MAP_ITEM_MATURE_EVENT); LLWorldMapMessage::getInstance()->sendItemRequest(MAP_ITEM_ADULT_EVENT); LLWorldMapMessage::getInstance()->sendItemRequest(MAP_ITEM_LAND_FOR_SALE); } }
D3_Hero::~D3_Hero() { if( NULL != m_pSkillContainer ) { delete m_pSkillContainer; } if( NULL != m_pStats ) { delete m_pStats; } clearItems(); }
void ScrollList::setContent(const std::vector<int>& models){ clearItems(); for(auto it = models.begin(); it < models.end(); ++it){ mItemPlaceHolders.push_back(ItemPlaceHolder((*it))); } layout(); if(mScrollArea){ mScrollArea->resetScrollerPosition(); } animateItemsOn(); }
void FXTabSim::reiniciar(void) { FXint i; limpiar(); clearItems(); setTableSize(10,9); for ( i = 0; i < 9; i++ ) setColumnText(i, cabecera[i]); tope = -1; numRegs = 0; bloques->clear(); }
void FSBrowser::refresh() { clearItems(); StopProcessing(); if (_model->requiresAuthentication() && !_model->isAuthenticated()) { _authWidget->setUsernameclearPassword(); _authWidget->show(); } else { _authWidget->hide(); bool compact = false; if (_viewType == ListView) { compact = true; _scrollPaneLayout->setContentsMargins(12, 8, 8, 8); //Position Folders _scrollPaneLayout->setSpacing(0); } else { _scrollPaneLayout->setContentsMargins(12, 12, 12, 12); //Position Files in recent _scrollPaneLayout->setSpacing(8); } int id = 0; foreach (const FSEntry &entry, _model->entries()) { FSEntryWidget *button = new FSEntryWidget(entry, _scrollPane); button->setCompact(compact); _buttonGroup->addButton(button, id++); _scrollPaneLayout->addWidget(button); connect(button, SIGNAL(selected()), this, SLOT(entrySelectedHandler())); connect(button, SIGNAL(opened()), this, SLOT(entryOpenedHandler())); } } }
void LLWorldMap::reset() { clearItems(true); // Clear the items lists clearImageRefs(); // Clear the world mipmap and the land for sale tiles clearSimFlags(); // Clear the block info flags array // Finally, clear the region map itself for_each(mSimInfoMap.begin(), mSimInfoMap.end(), DeletePairedPointer()); mSimInfoMap.clear(); mMapLoaded = false; mMapLayers.clear(); for (U32 map=SIM_LAYER_BEGIN; map<SIM_LAYER_OVERLAY; ++map) { mMapBlockMap[map].clear(); } }
/* BrowserWindow::clearItems * Removes all items from [node] and its children recursively *******************************************************************/ void BrowserWindow::clearItems(BrowserTreeNode* node) { // Check node was given to begin clear if (!node) node = items_root; // Clear all items from node node->clearItems(); // Clear all child nodes while (node->nChildren() > 0) { BrowserTreeNode* child = (BrowserTreeNode*)node->getChild(0); clearItems(child); node->removeChild(child); delete child; } }
void SeafileModel::loadDirectory(const QString &path) { QStringList pathList = path.split('/', QString::SkipEmptyParts); clearItems(); setLoading(true); if (pathList.isEmpty()){ // this is a request for the root. ie. the list of libraries. server()->loadLibraries(); this->currentPath=""; } else { QByteArray library = pathList.takeFirst().toUtf8(); QByteArray newPath = pathList.join('/').toUtf8() + '/'; server()->loadDirectory(library, newPath); this->currentPath = newPath; } }
// initialize data writer StatusCode EvtCollectionStream::initialize() { MsgStream log(msgSvc(), name()); // Use the Job options service to set the Algorithm's parameters setProperties(); // Get access to the DataManagerSvc m_pTupleSvc = serviceLocator()->service(m_storeName); if( !m_pTupleSvc.isValid() ) { log << MSG::FATAL << "Unable to locate IDataManagerSvc interface" << endmsg; return StatusCode::FAILURE; } // Clear the item list clearItems(); // Take the new item list from the properties. for(ItemNames::iterator i = m_itemNames.begin(); i != m_itemNames.end(); i++) { addItem( *i ); } log << MSG::INFO << "Data source: " << m_storeName << endmsg; return StatusCode::SUCCESS; }
// PUBLIC SLOTS void Browser::loadDirectory(QString dir){ //qDebug() << "Load Directory" << dir; if(dir.isEmpty()){ dir = currentDir; } //reload current directory if(dir.isEmpty()){ return; } //nothing to do - nothing previously loaded if(currentDir != dir){ //let the main widget know to clear all current items (completely different dir) oldFiles.clear(); emit clearItems(); } currentDir = dir; //save this for later //clean up the watcher first QStringList watched; watched << watcher->files() << watcher->directories(); if(!watched.isEmpty()){ watcher->removePaths(watched); } QStringList old = oldFiles; //copy this over for the moment (both lists will change in a moment) oldFiles.clear(); //get ready for re-creating this list // read the given directory QDir directory(dir); if(directory.exists()){ QStringList files; if(showHidden){ files = directory.entryList( QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot, QDir::NoSort); } else{ files = directory.entryList( QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDir::NoSort); } emit itemsLoading(files.length()); QCoreApplication::processEvents(); for(int i=0; i<files.length(); i++){ watcher->addPath(directory.absoluteFilePath(files[i])); //qDebug() << "Future Starting:" << files[i]; QString path = directory.absoluteFilePath(files[i]); if(old.contains(path)){ old.removeAll(path); } oldFiles << path; //add to list for next time QtConcurrent::run(this, &Browser::loadItem, path ); QCoreApplication::sendPostedEvents(); } watcher->addPath(directory.absolutePath()); if(!old.isEmpty()){ old.removeAll(directory.absolutePath()); for(int i=0; i<old.length(); i++){ emit itemRemoved(old[i]); } } }else{ emit itemsLoading(0); //nothing to load } }
void MVList::setDataBounds(const MVRect& bounds) /**************************************************************************** * * Function: MVList::setDataBounds * Parameters: bounds - New bounds on the number of items in the list * * Description: When this is called, the array is first emptied of all * data, then re-sized to fit the new bounds. All data in * the list is effectively lost, so will need to be * re-inserted. * ****************************************************************************/ { dataBounds = bounds; visible.moveTo(dataBounds.topLeft); MVPoint size(bounds.botRight - bounds.topLeft); int count = size.x * size.y; cells.setCount(MAX(count,1)); clearItems(); }
void WSettings::loadImpl() { clearItems(); Config config(QLatin1String("weather")); config.beginGroup(QLatin1String("main")); ui.intervalBox->setValue(config.value(QLatin1String("interval"), 25)); ui.showStatusBox->setChecked(config.value(QLatin1String("showStatus"), true)); int index = ui.themeNameBox->findText(config.value(QLatin1String("themeName"), QString())); ui.themeNameBox->setCurrentIndex(qMax(0, index)); int count = config.beginArray(QLatin1String("contacts")); for (int i = 0; i < count; i++) { config.setArrayIndex(i); QString cityCode = config.value(QLatin1String("code"), QString()); QString cityName = config.value(QLatin1String("name"), QString()); QString stateName = config.value(QLatin1String("state"), QString()); WListItem *item = new WListItem(cityName, stateName, cityCode, ui.citiesList); connect(item, SIGNAL(buttonClicked()), this, SLOT(onRemoveButtonClicked())); m_items << item; } }
PlayList::PlayList(QWidget *parent) : QWidget(parent) { mFirstShow = true; mMaxRows = -1; mpModel = new PlayListModel(this); mpDelegate = new PlayListDelegate(this); mpListView = new QListView; //mpListView->setResizeMode(QListView::Adjust); mpListView->setModel(mpModel); mpListView->setItemDelegate(mpDelegate); mpListView->setSelectionMode(QAbstractItemView::ExtendedSelection); //ctrl,shift mpListView->setEditTriggers(QAbstractItemView::NoEditTriggers); mpListView->setToolTip("Ctrl/Shift + " + tr("Click to select multiple")); QVBoxLayout *vbl = new QVBoxLayout; setLayout(vbl); vbl->addWidget(mpListView); QHBoxLayout *hbl = new QHBoxLayout; mpClear = new QToolButton(0); mpClear->setText(tr("Clear")); mpRemove = new QToolButton(0); mpRemove->setText("-"); mpRemove->setToolTip(tr("Remove selected items")); mpAdd = new QToolButton(0); mpAdd->setText("+"); hbl->addWidget(mpClear); hbl->addSpacing(width()); hbl->addWidget(mpRemove); hbl->addWidget(mpAdd); vbl->addLayout(hbl); connect(mpClear, SIGNAL(clicked()), SLOT(clearItems())); connect(mpRemove, SIGNAL(clicked()), SLOT(removeSelectedItems())); connect(mpAdd, SIGNAL(clicked()), SLOT(addItems())); connect(mpListView, SIGNAL(doubleClicked(QModelIndex)), SLOT(onAboutToPlay(QModelIndex))); // enter to highight //connect(mpListView, SIGNAL(entered(QModelIndex)), SLOT(highlight(QModelIndex))); }
void UIGDetailsSet::clearItems(UIGDetailsItemType type /* = UIGDetailsItemType_Element */) { switch (type) { case UIGDetailsItemType_Element: { foreach (int iKey, m_elements.keys()) delete m_elements[iKey]; AssertMsg(m_elements.isEmpty(), ("Set items cleanup failed!")); break; } case UIGDetailsItemType_Any: { clearItems(UIGDetailsItemType_Element); break; } default: { AssertMsgFailed(("Invalid item type!")); break; } } }
void SpawnShell::clear(void) { #ifdef SPAWNSHELL_DIAG printf("SpawnShell::clear()\n"); #endif emit clearItems(); clearMap(m_spawns); clearMap(m_coins); clearMap(m_doors); clearMap(m_drops); // clear the players list, reinsert the player m_players.clear(); m_players.insert(0, m_player); // emit an changeItem for the player emit changeItem(m_player, tSpawnChangedALL); m_cntDeadSpawnIDs = 0; m_posDeadSpawnIDs = 0; memset((void*)&m_deadSpawnID[0], 0, sizeof(m_deadSpawnID)); } // end clear