get rid of piForeach

apply some code analyzer recommendations
ICU flag now check if libicu exists
prepare for more accurate growth of containers (limited PoT, then constantly increase size)
This commit is contained in:
2024-11-20 20:01:47 +03:00
parent 24112498ce
commit caa7880cc4
40 changed files with 415 additions and 320 deletions

View File

@@ -15,7 +15,7 @@ PIStringList FileManager::TileDir::selectedNames() const {
PIStringList ret;
PIMutexLocker ml(e_mutex);
PIVector<int> sind = selected.toVector();
piForeachC(int i, sind)
for (const auto i: sind)
ret << entries[i].name();
ret.removeOne("..");
return ret;
@@ -181,7 +181,7 @@ void FileManager::TileDir::buildNames() {
CharFlags cf = 0;
Color cc = Default;
PIString fcol, scol;
piForeachC(PIFile::FileInfo & e, entries) {
for (const auto & e: entries) {
if (e.isDir()) {
t = '/';
cf = Bold;
@@ -258,7 +258,7 @@ FileManager::FileManager() {
labels->direction = Horizontal;
PIVector<SSPair> ll;
ll << SSPair(" Esc", "Exit") << SSPair(" F5", "Copy") << SSPair(" F6", "Move") << SSPair(" F7", "MkDir") << SSPair(" F8", "Delete");
piForeachC(SSPair & l, ll) {
for (const auto & l: ll) {
tl = new TileSimple();
labels->addTile(tl);
tl->content << TileSimple::Row(l.first, CellFormat(White, Transparent, Bold));
@@ -315,7 +315,7 @@ PIStringList FileManager::selectedRemote() const {
PIStringList ret;
panels[1]->lock();
PIVector<int> sil = panels[1]->selected.toVector();
piForeachC(int i, sil)
for (const auto i: sil)
ret << panels[1]->entries[i].path;
panels[1]->unlock();
return ret;