cosmetics: list -> vector in more places

This commit is contained in:
Jean-Francois Dockes
2012-04-11 19:58:08 +02:00
parent 78bd8d63da
commit ec7b40a52e
44 changed files with 285 additions and 313 deletions
+9 -9
View File
@@ -294,17 +294,17 @@ void AdvSearch::fillFileTypes()
QStringList ql;
if (m_ignByCats == false) {
list<string> types = theconfig->getAllMimeTypes();
for (list<string>::iterator it = types.begin();
vector<string> types = theconfig->getAllMimeTypes();
for (vector<string>::iterator it = types.begin();
it != types.end(); it++) {
QString qs = QString::fromUtf8(it->c_str());
if (m_ignTypes.indexOf(qs) < 0)
ql.append(qs);
}
} else {
list<string> cats;
vector<string> cats;
theconfig->getMimeCategories(cats);
for (list<string>::const_iterator it = cats.begin();
for (vector<string>::const_iterator it = cats.begin();
it != cats.end(); it++) {
map<QString, QString>::const_iterator it1;
QString cat;
@@ -321,7 +321,7 @@ void AdvSearch::fillFileTypes()
yesFiltypsLB->insertItems(0, ql);
}
// Save current list of ignored file types to prefs
// Save current set of ignored file types to prefs
void AdvSearch::saveFileTypes()
{
prefs.asearchIgnFilTyps = m_ignTypes;
@@ -383,9 +383,9 @@ void AdvSearch::runSearch()
} else {
cat = (const char *)qcat.toUtf8();
}
list<string> types;
vector<string> types;
theconfig->getMimeCatTypes(cat, types);
for (list<string>::const_iterator it = types.begin();
for (vector<string>::const_iterator it = types.begin();
it != types.end(); it++) {
sdata->addFiletype(*it);
}
@@ -419,7 +419,7 @@ void AdvSearch::runSearch()
QString current = subtreeCMB->currentText();
sdata->setTopdir((const char*)subtreeCMB->currentText().toUtf8(),
direxclCB->isChecked());
// Keep history list clean and sorted. Maybe there would be a
// Keep history clean and sorted. Maybe there would be a
// simpler way to do this
list<QString> entries;
for (int i = 0; i < subtreeCMB->count(); i++) {
@@ -427,7 +427,7 @@ void AdvSearch::runSearch()
}
entries.push_back(subtreeCMB->currentText());
entries.sort();
unique(entries.begin(), entries.end());
entries.unique();
subtreeCMB->clear();
for (list<QString>::iterator it = entries.begin();
it != entries.end(); it++) {
+2 -2
View File
@@ -296,10 +296,10 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config)
// customized in the system config like .thunderbird or
// .purple. This doesn't prevent them to add and customize them
// further.
list<string> allkeydirs = config->getSubKeys(true);
vector<string> allkeydirs = config->getSubKeys(true);
QStringList qls;
for (list<string>::const_iterator it = allkeydirs.begin();
for (vector<string>::const_iterator it = allkeydirs.begin();
it != allkeydirs.end(); it++) {
qls.push_back(QString::fromUtf8(it->c_str()));
}
+1 -1
View File
@@ -133,7 +133,7 @@ bool maybeOpenDb(string &reason, bool force, bool *maindberror)
return true;
}
bool getStemLangs(list<string>& langs)
bool getStemLangs(vector<string>& langs)
{
string reason;
if (!maybeOpenDb(reason)) {
+4 -4
View File
@@ -178,12 +178,12 @@ void RclMain::init()
bgrp->addButton(allRDB, bgrpid++);
connect(bgrp, SIGNAL(buttonClicked(int)), this, SLOT(catgFilter(int)));
allRDB->setChecked(true);
list<string> cats;
vector<string> cats;
theconfig->getGuiFilterNames(cats);
// Text for button 0 is not used. Next statement just avoids unused
// variable compiler warning for catg_strings
m_catgbutvec.push_back(catg_strings[0]);
for (list<string>::const_iterator it = cats.begin();
for (vector<string>::const_iterator it = cats.begin();
it != cats.end(); it++) {
QRadioButton *but = new QRadioButton(catgBGRP);
QString catgnm = QString::fromUtf8(it->c_str(), it->length());
@@ -1089,12 +1089,12 @@ void RclMain::showActiveTypes()
}
// All types listed in mimeconf:
list<string> mtypesfromconfig = theconfig->getAllMimeTypes();
vector<string> mtypesfromconfig = theconfig->getAllMimeTypes();
// Intersect file system types with config types (those not in the
// config can be indexed by name, not by content)
set<string> mtypesfromdbconf;
for (list<string>::const_iterator it = mtypesfromconfig.begin();
for (vector<string>::const_iterator it = mtypesfromconfig.begin();
it != mtypesfromconfig.end(); it++) {
if (mtypesfromdb.find(*it) != mtypesfromdb.end())
mtypesfromdbconf.insert(*it);
+1 -1
View File
@@ -31,7 +31,7 @@ extern bool maybeOpenDb(std::string &reason, bool force = true,
bool *maindberror = 0);
/** Retrieve configured stemming languages */
bool getStemLangs(list<string>& langs);
bool getStemLangs(vector<string>& langs);
extern RclConfig *theconfig;
extern RclConfig *thestableconfig;
+2 -2
View File
@@ -66,12 +66,12 @@ void SpellW::init()
// Stemming language combobox
stemLangCMB->clear();
list<string> langs;
vector<string> langs;
if (!getStemLangs(langs)) {
QMessageBox::warning(0, "Recoll",
tr("error retrieving stemming languages"));
}
for (list<string>::const_iterator it = langs.begin();
for (vector<string>::const_iterator it = langs.begin();
it != langs.end(); it++) {
stemLangCMB->
addItem(QString::fromAscii(it->c_str(), it->length()));
+2 -2
View File
@@ -140,13 +140,13 @@ void UIPrefsDialog::setFromPrefs()
stemLangCMB->clear();
stemLangCMB->addItem(g_stringNoStem);
stemLangCMB->addItem(g_stringAllStem);
list<string> langs;
vector<string> langs;
if (!getStemLangs(langs)) {
QMessageBox::warning(0, "Recoll",
tr("error retrieving stemming languages"));
}
int cur = prefs.queryStemLang == "" ? 0 : 1;
for (list<string>::const_iterator it = langs.begin();
for (vector<string>::const_iterator it = langs.begin();
it != langs.end(); it++) {
stemLangCMB->
addItem(QString::fromAscii(it->c_str(), it->length()));