bool SessionChannelManager::add(SessionChannel *ch) { bool ret = false; ret = addEntry(ch); return ret; /* for (std::map<DWORD,SessionChannel*>::iterator it=channelList.begin(); it!=channelList.end();it++) { if (!strncmp(ch->name,it->second->name,MAX_NAMESIZE)) return false; } if (channelList.end()==channelList.find(ch->tempid)) { channelList[ch->tempid] = ch; return true; } return false; */ }
void SendCoinsDialog::setAddress(const QString &address) { SendCoinsEntry *entry = 0; // Replace the first entry if it is still unused if(ui->entries->count() == 1) { SendCoinsEntry *first = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(0)->widget()); if(first->isClear()) { entry = first; } } if(!entry) { entry = addEntry(); } entry->setAddress(address); }
// При инициализации. LRESULT RSSPage::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { if (m_CodeingList.empty()) { m_CodeingList.insert(CodeingMapPair(TSTRING(RSS_CODEING_AUTO), RSSManager::getInstance()->getCodeing(0))); m_CodeingList.insert(CodeingMapPair(TSTRING(RSS_CODEING_UTF8), RSSManager::getInstance()->getCodeing(1))); m_CodeingList.insert(CodeingMapPair(TSTRING(RSS_CODEING_CP1251), RSSManager::getInstance()->getCodeing(2))); } PropPage::translate((HWND)(*this), texts); PropPage::read((HWND)*this, items); CRect rc; ctrlCommands.Attach(GetDlgItem(IDC_RSS_ITEMS)); ctrlCommands.GetClientRect(rc); ctrlCommands.InsertColumn(0, CTSTRING(RSS_URL), LVCFMT_LEFT, rc.Width() / 3, 0); ctrlCommands.InsertColumn(1, CTSTRING(RSS_TITLE), LVCFMT_LEFT, rc.Width() / 3, 1); ctrlCommands.InsertColumn(2, CTSTRING(RSS_CODEING), LVCFMT_LEFT, rc.Width() / 3, 1); SET_EXTENDENT_LIST_VIEW_STYLE(ctrlCommands); #ifdef USE_SET_LIST_COLOR_IN_SETTINGS SET_LIST_COLOR_IN_SETTING(ctrlCommands); #endif CUpDownCtrl spin; spin.Attach(GetDlgItem(IDC_RSS_AUTO_REFRESH_TIME_SPIN)); spin.SetRange(1, 10); spin.Detach(); // Do specialized reading here const RSSManager::FeedList& lst = RSSManager::getInstance()->lockFeedList(); auto cnt = ctrlCommands.GetItemCount(); for (auto i = lst.cbegin(); i != lst.cend(); ++i) { addEntry((*i), cnt++); } RSSManager::getInstance()->unlockFeedList(); return TRUE; }
void Table::open_file(std::string table_name) { // set the values of this Table according to the table_name file std::string file_name = table_name; file_name += ".db"; fstream table_file; table_file.open(file_name); if (table_file.is_open()) { string tableName; getline(table_file, tableName); setName(tableName); _name = tableName; string numCols; getline(table_file, numCols); setNumCols(std::stoi(numCols)); string file_colTypes; getline(table_file, file_colTypes); for (unsigned int i = 0; i < file_colTypes.length(); i++) { char c = colTypes[i]; if (c != ',' && (c == 's' || c == 'f' || c == 'i')) { // if this is a valid column type identifier colTypes.push_back(c); } } string colNamesStrings; vector<string> fileColNames = split(colNamesStrings, ','); colNames = fileColNames; string fieldsLine; while (getline(table_file, fieldsLine)) { vector<string> fieldsVec = split(fieldsLine, ','); addEntry(fieldsVec); } std::cout << "File is open!\n"; } }
LRESULT FavoriteHubsFrame::onMoveUp(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { nosave = true; int j = ctrlHubs.GetItemCount(); FavoriteHubEntry::List& fh = FavoriteManager::getInstance()->getFavoriteHubs(); ctrlHubs.SetRedraw(FALSE); for(int i = 1; i < j; ++i) { if(ctrlHubs.GetItemState(i, LVIS_SELECTED)) { FavoriteHubEntry* e = fh[i]; swap(fh[i], fh[i-1]); ctrlHubs.DeleteItem(i); addEntry(e, i-1); ctrlHubs.SetItemState(i-1, LVIS_SELECTED, LVIS_SELECTED); ctrlHubs.EnsureVisible(i-1, FALSE); } } ctrlHubs.SetRedraw(TRUE); nosave = false; FavoriteManager::getInstance()->save(); return 0; }
bool RssReader::endElement( const QString & namespaceURI, const QString & localName, const QString & qName ) { if (localName == "entry" || localName == "item") { m_location &= ~InEntry; addEntry(); } else if (m_location & InEntry) { if (localName == "title") { m_location &= ~InTitle; } else if (localName == "issued" || localName == "pubDate") { m_location &= ~InDate; } else if (localName == "link") { m_location &= ~InLink; } else if (localName == "description") { m_location &= ~InDesc; } } return true; }
void AbstractNetworkTableEntryStore::offerIncomingAssignment(NetworkTableEntry* entry){ { NTSynchronized sync(LOCK); std::map<std::string, NetworkTableEntry*>::iterator itr = namedEntries.find(entry->name); NetworkTableEntry* tableEntry; if(addEntry(entry)){ if(itr != namedEntries.end()){ tableEntry = itr->second; } else{ tableEntry = entry; } tableEntry->FireListener(listenerManager);//if we didnt have a pointer, then the copy of the version in the list would call this method, however with the pointer we are updating the version in the list incomingReceiver->offerOutgoingAssignment(tableEntry); } else delete entry; } }
void AutoSearchFrame::handleAdd() { AutoSearch search; AutoSearchProperties dlg(this, &search); if(dlg.run() == IDOK) { AutoSearchManager::SearchCollection& collection = AutoSearchManager::getInstance()->collection; int index; // Add new search to the end or if selected, just before if(items->countSelected() == 1) { index = items->getSelected(); collection.insert(collection.begin() + index, search); } else { index = -1; collection.push_back(search); } addEntry(search, index); } }
/** * Compute the symmetric set difference of the contents of * two folders. (That is, it returns what is left over when * you subtract the intersection from the union.) */ dirInfo* symmetricDifference( dirInfo *di1, dirInfo *di2 ){ dirInfo *result = NULL; dirInfo *iter = di1; dirInfo *other = di2; if( NULL == di1 ) return di2; if( NULL == di2 ) return di1; if( di2->count > di1->count ){ iter = di2; other = di1; } for(int i = 0; i < iter->count; i++){ if( ! contains( other, iter->entries[i] )){ result = addEntry(result, iter->entries[i] ); } } return result; }
void Config::parseOption(s8 *str) { s8 *cur = str, *end = str + strlen(str) - 1; while (*cur == ' ') cur++; if (!*cur || *cur == '#') return; s8 *key = cur; while (*cur && *cur != '=') cur++; if (!*cur) return; *cur = 0; s8 *val = ++cur; cur = end; while (*cur == ' ') cur--; if (cur < val) return; *(cur + 1) = 0; addEntry(key, val); }
SendCoinsDialog::SendCoinsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SendCoinsDialog), model(0) { ui->setupUi(this); #ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac // ui->addButton->setIcon(QIcon()); ui->clearButton->setIcon(QIcon()); ui->sendButton->setIcon(QIcon()); #endif addEntry(); // connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addEntry())); connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); fNewRecipientAllowed = true; }
/* Add a protocol processor implemented in Python into flowtable */ int addPyModule(flowtable_t *flowtable, char *mod_name) { PyRun_SimpleString("import sys"); PyRun_SimpleString("sys.path.append('./')"); PyObject *PyModule, *PyModuleGlobalDict, *PyFunProcess, *PyFunCommandLine, *PyFunConfig, *PyTupleConfig; module_config_t *config = (module_config_t *) calloc(1, sizeof (module_config_t)); PyModule = PyImport_ImportModule(mod_name); if (PyModule) { PyModuleGlobalDict = PyModule_GetDict(PyModule); if (PyModuleGlobalDict) { config->command = (void *) PyDict_GetItemString(PyModuleGlobalDict, "Command_Line"); if (config->command == NULL) verbose(2, "[addPyModule]PyFunCommandLine is NULL!!\n", PyFunCommandLine); /* return a tuple of config info */ PyFunConfig = PyDict_GetItemString(PyModuleGlobalDict, "Config"); if (PyFunConfig) { PyTupleConfig = PyObject_CallFunction(PyFunConfig, NULL); verbose(2, "[addPyModule] got config\n"); PyArg_ParseTuple(PyTupleConfig, "sissss", &config->name, &config->protocol, &config->command_str, &config->shelp, &config->usage, &config->lhelp); verbose(2, "[addPyModule] set config 1\n"); config->processor = PyDict_GetItemString(PyModuleGlobalDict, "Protocol_Processor"); if (config->processor) { printConfigInfo(config); addEntry(flowtable, CLASSICAL, PYTHON_FUNCTION, config); //add protocol into flow table verbose(2, "[addPyModule]:: Python Processor added into flowtable!!!"); return EXIT_SUCCESS; } } } printf("[addPyModule]:: Failed to get Main Dictionary of module -%s- !\n", mod_name); return EXIT_FAILURE; } printf("[addPyModule]:: Failed to load module -%s- !\n", mod_name); return EXIT_FAILURE; }
void FavoriteHubsFrame::fillList() { bool old_nosave = nosave; nosave = true; ctrlHubs.DeleteAllItems(); // sort groups TStringList groups(getSortedGroups()); for(size_t i = 0; i < groups.size(); ++i) { // insert groups LVGROUP lg = {0}; lg.cbSize = sizeof(lg); lg.iGroupId = i; lg.state = LVGS_NORMAL | (WinUtil::getOsMajor() >= 6 ? LVGS_COLLAPSIBLE : 0); lg.mask = LVGF_GROUPID | LVGF_HEADER | LVGF_STATE | LVGF_ALIGN; lg.uAlign = LVGA_HEADER_LEFT; // Header-title must be unicode (Convert if necessary) lg.pszHeader = (LPWSTR)groups[i].c_str(); lg.cchHeader = groups[i].size(); ctrlHubs.InsertGroup(i, &lg ); } const FavoriteHubEntryList& fl = FavoriteManager::getInstance()->getFavoriteHubs(); for(FavoriteHubEntryList::const_iterator i = fl.begin(); i != fl.end(); ++i) { const string& group = (*i)->getGroup(); int index = 0; if(!group.empty()) { TStringList::const_iterator groupI = find(groups.begin() + 1, groups.end(), Text::toT(group)); if(groupI != groups.end()) index = groupI - groups.begin(); } addEntry(*i, ctrlHubs.GetItemCount(), index); } nosave = old_nosave; }
//! [1a] void MainWindow::createMenus() { fileMenu = menuBar()->addMenu(tr("&File")); openAct = new QAction(tr("&Open..."), this); fileMenu->addAction(openAct); connect(openAct, SIGNAL(triggered()), this, SLOT(openFile())); //! [1a] saveAct = new QAction(tr("&Save As..."), this); fileMenu->addAction(saveAct); connect(saveAct, SIGNAL(triggered()), this, SLOT(saveFile())); fileMenu->addSeparator(); exitAct = new QAction(tr("E&xit"), this); fileMenu->addAction(exitAct); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); toolMenu = menuBar()->addMenu(tr("&Tools")); addAct = new QAction(tr("&Add Entry..."), this); toolMenu->addAction(addAct); connect(addAct, SIGNAL(triggered()), addressWidget, SLOT(addEntry())); //! [1b] editAct = new QAction(tr("&Edit Entry..."), this); editAct->setEnabled(false); toolMenu->addAction(editAct); connect(editAct, SIGNAL(triggered()), addressWidget, SLOT(editEntry())); toolMenu->addSeparator(); removeAct = new QAction(tr("&Remove Entry"), this); removeAct->setEnabled(false); toolMenu->addAction(removeAct); connect(removeAct, SIGNAL(triggered()), addressWidget, SLOT(removeEntry())); connect(addressWidget, SIGNAL(selectionChanged(QItemSelection)), this, SLOT(updateActions(QItemSelection))); }
void Table<V,A>::read(std::istream& is) { std::string line; const std::string comments="#;!"; //starts comment V vv; A aa; while (is) { getline(is,line); // skip leading white space: size_t i; for (i=0; isspace(line[i]) && i<line.length(); i++) ; // skip line if blank or just comment if (i==line.length()) continue; if (comments.find(line[i])!=std::string::npos) continue; // try reading arg & val from line: std::istringstream iss(line); iss >> aa >> vv; if (iss.fail()) throw TableReadError(line) ; addEntry(aa,vv); } }
void MenuFile::performAction(const ActionAtom *atom) { switch(atom->action) { case ADD_ENTRY: addEntry(atom->arg1, atom->arg2); return; case REMOVE_ENTRY: removeEntry(atom->arg1, atom->arg2); return; case ADD_MENU: addMenu(atom->arg1, atom->arg2); return; case REMOVE_MENU: removeMenu(atom->arg1); return; case MOVE_MENU: moveMenu(atom->arg1, atom->arg2); return; } }
Identifier *IdentifierTable::identifierImpl(const Heap::String *str) { if (str->identifier) return str->identifier; uint hash = str->hashValue(); if (str->subtype == Heap::String::StringType_ArrayIndex) return 0; uint idx = hash % alloc; while (Heap::String *e = entries[idx]) { if (e->stringHash == hash && e->isEqualTo(str)) { str->identifier = e->identifier; return e->identifier; } ++idx; idx %= alloc; } addEntry(const_cast<QV4::Heap::String *>(str)); return str->identifier; }
LRESULT AutoSearchFrame::onMoveDown(WORD , WORD , HWND , BOOL& ) { int i = ctrlAutoSearch.GetSelectedIndex(); if(i != -1 && i != (ctrlAutoSearch.GetItemCount()-1) ) { //swap and reload list, not the best solution :P ctrlAutoSearch.SetRedraw(FALSE); AutoSearchManager::getInstance()->moveAutoSearchDown(i); ctrlAutoSearch.DeleteAllItems(); AutoSearchList lst = AutoSearchManager::getInstance()->getSearchItems(); for(auto j = lst.begin(); j != lst.end(); ++j) { const AutoSearchPtr as = *j; addEntry(as, ctrlAutoSearch.GetItemCount()); } ctrlAutoSearch.SetRedraw(TRUE); ctrlAutoSearch.Invalidate(); ctrlAutoSearch.SetItemState(i+1, LVIS_SELECTED, LVIS_SELECTED); ctrlAutoSearch.EnsureVisible(i+1, FALSE); } return 0; }
bool StructureList::characters ( const QString & ch ) { if (entrada && myStartsWith(ch,m_word_normalized)) { if(addEntry == 0) { if (m_list.length()==0) { //We don't want extra \n at first //time m_list=ch; } else { m_list=m_list+"\n"+ch; } }//#endif else { addEntry(ch); } } return true; }
int MLSymbolTable::getSymbolID(const char * sym) { int r = 0; bool found = false; // process characters in place. On failure, return null symbol. int len = processSymbolText(sym); if(!(len > 0)) return 0; // look up ID by symbol // This is the fast path, and how we look up symbols from char* in typical code. const std::vector<int>& bin = mHashTable[KRhash(sym)]; // there should be few collisions, so probably the first ID in the hash bin // will be the symbol we are looking for. Unfortunately to test for equality we have to // compare the entire string. // if we replace std::string with a custom char * type that stores its length, // and use SSE to do the compares, they could probably be significantly faster. { MLScopedLock lock(mLock); for(int ID : bin) { const char* symB = mSymbolsByID[ID].c_str(); int lenB = processSymbolText(symB); if(!strncmp(sym, symB, std::max(len, lenB))) { r = ID; found = true; break; } } if(!found) { r = addEntry(sym, len); } } return r; }
main() { int response; signed int iStatus = 0; FILE *pWrite; FILE *pRead; do{ printf("\n\tPhone Book\n"); printf("\n1\tAdd phone book entry\n"); printf("2\tPrint phone book\n"); printf("3\tEdit phone book\n"); printf("4\tDelete entry in phone book\n"); printf("5\tExit\n\n"); printf("Select an option: "); scanf("%d", &response); if ( response == 1 ) { addEntry(); } else if ( response == 2 ) { printEntries(); } else if ( response == 3 ) { editEntries(); } else if ( response == 4 ) { deleteEntries(); } else if (iStatus == -1 ) { goto ErrorHandler; } }while(response != 5); system("clear"); exit(EXIT_SUCCESS); //exit program normally ErrorHandler: perror("The following error occurred"); exit(EXIT_FAILURE); //exit program with error } //end main
void HistoryContentsWidget::populateEntries() { const QDate date = QDate::currentDate(); QList<QDate> dates; dates << date << date.addDays(-1) << date.addDays(-7) << date.addDays(-14) << date.addDays(-30) << date.addDays(-365); for (int i = 0; i < m_model->rowCount(); ++i) { m_ui->historyView->setRowHidden(i, m_model->invisibleRootItem()->index(), true); QStandardItem *groupItem = m_model->item(i, 0); if (groupItem) { groupItem->setData(dates.value(i, QDate()), Qt::UserRole); groupItem->removeRows(0, groupItem->rowCount()); } } const QList<HistoryEntry> entries = HistoryManager::getEntries(); for (int i = 0; i < entries.count(); ++i) { addEntry(entries.at(i)); } for (int i = 0; i < m_model->rowCount(); ++i) { QStandardItem *groupItem = m_model->item(i, 0); if (groupItem) { groupItem->sortChildren(2, Qt::DescendingOrder); } } m_isLoading = false; emit loadingChanged(false); }
int main (int argc, char* argv[]) { MAXSIZE = 10; FILE *inFile, *outFile; inFile = fopen("stockData.dat", "r"); if (!inFile) { printf("Please create a file named \"stockData.dat\""); exit(1); } outFile = fopen("stockRpt.dat", "w"); if (!outFile) { printf("There was an error opening or creating \"stockRpt.dat\""); exit(1); } report *r; entry en; r = (report *)malloc(sizeof(report)); r->e = malloc(sizeof(entry)*MAXSIZE); initReport(r); int x; while (!feof(inFile)) { x = fscanf(inFile, "%d %d %f %f", &en.code, &en.shares, &en.prevcps, &en.currcps); if (x ==4) { addEntry(en, r); } } exportReport(*r, outFile); close(inFile); close(outFile); return 0; }
void AutoSearchFrame::handleProperties() { // Get selection info std::vector<unsigned> selected = items->getSelection(); for(std::vector<unsigned>::const_iterator i = selected.begin(); i != selected.end(); ++i) { // Edit existing AutoSearchManager::SearchCollection& collection = AutoSearchManager::getInstance()->collection; AutoSearch search = collection[*i]; // Invoke dialog with selected search AutoSearchProperties dlg(this, &search); if(dlg.run() == IDOK) { // Update search collection collection[*i] = search; // Update list control HoldRedraw hold(items); items->erase(*i); addEntry(search, *i); items->select(*i); } } }
Identifier *IdentifierTable::identifier(const char *s, int len) { uint subtype; uint hash = String::createHashValue(s, len, &subtype); if (hash == UINT_MAX) return identifier(QString::fromUtf8(s, len)); QLatin1String latin(s, len); uint idx = hash % alloc; while (Heap::String *e = entries[idx]) { if (e->stringHash == hash && e->toQString() == latin) return e->identifier; ++idx; idx %= alloc; } Heap::String *str = engine->newString(QString::fromLatin1(s, len)); str->stringHash = hash; str->subtype = subtype; addEntry(str); return str->identifier; }
/** * Free memory **/ void kma_free(void* ptr, kma_size_t size) { addEntry(ptr, size); pageHeader* baseAdd = BASEADDR(ptr); baseAdd->blockCount--; pageHeader* firstPage = (pageHeader*)(mainPage->ptr); int totalPages = firstPage->pageCount; int count = 1; pageHeader* lastPage; for (; count; totalPages--) { lastPage = ((pageHeader*)((long int)firstPage + totalPages * PAGESIZE)); count = 0; if (lastPage->blockCount == 0) { count = 1; block* tmp; for (tmp = firstPage->head; tmp != NULL; tmp = tmp->next) { if (BASEADDR(tmp) == lastPage) { deleteEntry(tmp); } } count = 1; if (lastPage == firstPage) { count = 0; mainPage = NULL; } free_page(lastPage->self); if (mainPage) { firstPage->pageCount--; } } } }
HistoryContentsWidget::HistoryContentsWidget(Window *window) : ContentsWidget(window), m_model(new QStandardItemModel(this)), m_isLoading(true), m_ui(new Ui::HistoryContentsWidget) { m_ui->setupUi(this); QStringList groups; groups << tr("Today") << tr("Yesterday") << tr("Earlier This Week") << tr("Previous Week") << tr("Earlier This Month") << tr("Earlier This Year") << tr("Older"); for (int i = 0; i < groups.count(); ++i) { m_model->appendRow(new QStandardItem(Utils::getIcon(QLatin1String("inode-directory")), groups.at(i))); } QStringList labels; labels << tr("Address") << tr("Title") << tr("Date"); m_model->setHorizontalHeaderLabels(labels); m_model->setSortRole(Qt::DisplayRole); m_ui->historyView->setModel(m_model); m_ui->historyView->setItemDelegate(new ItemDelegate(this)); m_ui->historyView->header()->setTextElideMode(Qt::ElideRight); m_ui->historyView->header()->setSectionResizeMode(0, QHeaderView::Stretch); m_ui->historyView->expand(m_model->index(0, 0)); QTimer::singleShot(100, this, SLOT(populateEntries())); connect(HistoryManager::getInstance(), SIGNAL(cleared()), this, SLOT(populateEntries())); connect(HistoryManager::getInstance(), SIGNAL(entryAdded(qint64)), this, SLOT(addEntry(qint64))); connect(HistoryManager::getInstance(), SIGNAL(entryUpdated(qint64)), this, SLOT(updateEntry(qint64))); connect(HistoryManager::getInstance(), SIGNAL(entryRemoved(qint64)), this, SLOT(removeEntry(qint64))); connect(HistoryManager::getInstance(), SIGNAL(dayChanged()), this, SLOT(populateEntries())); connect(m_ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterHistory(QString))); connect(m_ui->historyView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(openEntry(QModelIndex))); connect(m_ui->historyView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); }
// ----------------------------------------------------------------------------- // Moves [entry] to [position] in [dir]. // If [dir] is null, the root dir is used. // Returns false if the entry was invalid, true otherwise // ----------------------------------------------------------------------------- bool Archive::moveEntry(ArchiveEntry* entry, unsigned position, ArchiveTreeNode* dir) { // Abort if read only if (read_only_) return false; // Check the entry if (!checkEntry(entry)) return false; // Check if the entry is locked if (entry->isLocked()) return false; // Get the entry's current directory auto cdir = entry->parentDir(); // Error if no dir if (!cdir) return false; // If no destination dir specified, use root if (!dir) dir = &dir_root_; // Remove the entry from its current dir auto sptr = dir->sharedEntryAt(dir->entryIndex(entry)); // Get a shared pointer so it isn't deleted removeEntry(entry); // Add it to the destination dir addEntry(entry, position, dir); // Set modified setModified(true); // Return success return true; }
void AVLTreeIndex::load() { std::ifstream fin; fin.open(filename, std::ios::in); if (!fin.is_open()) { std::cout << "Error opening " << filename << std::endl; return; } else {std::cout << filename << " successfully opened." << std::endl;} // read in index from file std::string ref; do { std::getline(fin, ref); if(ref != "ENDREFS") this->addReference(ref); } while(ref != "ENDREFS"); while (!fin.eof()) { entry e; std::string keyword_in, idf_in, id_in, tf_in; std::getline(fin, keyword_in, ';'); e.keyword = keyword_in; //std::cout << keyword_in << ";" << idf_in << ";"; bool val = true; while(val) { std::getline(fin, id_in, ','); std::getline(fin, tf_in, ';'); entry::doc d; d.id = std::atoi(id_in.c_str()); d.termFreq = std::atof(tf_in.c_str()); e.documents.push_back(d); if (fin.peek() == '\n' || !fin.good()) { fin.get(); val = false; } } addEntry(e); } fin.close(); }
void SendCoinsDialog::pasteEntry(const SendCoinsRecipient &rv) { if(!fNewRecipientAllowed) return; SendCoinsEntry *entry = 0; // Replace the first entry if it is still unused if(ui->entries->count() == 1) { SendCoinsEntry *first = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(0)->widget()); if(first->isClear()) { entry = first; } } if(!entry) { entry = addEntry(); } entry->setValue(rv); updateTabsAndLabels(); }