const Workspace& Ide::IdeWorkspace() const { static Workspace wspc; static String _main; if(main != _main || wspc.GetCount() == 0) { wspc.Scan(main); _main = main; } else { for(int i = 0; i < wspc.GetCount(); i++) if(wspc.GetPackage(i).time != FileGetTime(PackagePath(wspc[i]))) { wspc.Scan(main); break; } } return wspc; }
void WorkspaceWork::SerializeClosed(Stream& s) { Workspace wspc; wspc.Scan(main); Vector<Sepfo> list; for(int i = 0; i < wspc.GetCount(); i++) { String pk = wspc[i]; const Package& p = wspc.GetPackage(i); for(int i = 0; i < p.GetCount(); i++) if(p[i].separator) { Sepfo sf(pk, p[i]); if(closed.Find(sf) >= 0) list.Add(sf); } } s % list; closed = pick(list); }
void WorkspaceWork::ScanWorkspace() { Workspace wspc; if(main.GetCount()) wspc.Scan(main); actualpackage.Clear(); actualfileindex = -1; filelist.Clear(); package.Clear(); Vector<String> pks; speed.Clear(); for(int i = 0; i < wspc.package.GetCount(); i++) { pks.Add(wspc.package.GetKey(i)); speed.Add(wspc.GetPackage(i).optimize_speed); } if(sort && wspc.GetCount()) { PackageOrder po; po.mainpath = PackagePath(pks[0]); IndexSort(pks.Begin() + 1, pks.End(), speed.Begin() + 1, po); } for(int i = 0; i < wspc.package.GetCount(); i++) { String pk = pks[i]; Font fnt = ListFont(); if(i == 0) fnt.Bold(); PackageInfo pi = GetPackageInfo(pk); if(pi.bold) fnt.Bold(); if(pi.italic) fnt.Italic(); package.Add(pk, Null, fnt, Nvl(pi.ink, SColorText()), false, 0, Null, SColorMark); } if(!organizer) { if(main.GetCount()) package.Add(prjaux, IdeImg::PrjAux(), ListFont(), Magenta); package.Add(ideaux, IdeImg::IdeAux(), ListFont(), Magenta); package.Add(tempaux, IdeImg::TempAux(), ListFont(), Magenta); if(main.GetCount()) package.Add(METAPACKAGE, IdeImg::Meta(), ListFont(), Red); } package.SetCursor(0); SyncErrorPackages(); }