- // Run rescan in user lyx directory
- Path p(user_lyxdir);
- Systemcall one;
- one.startscript(Systemcall::Wait,
- LibFileSearch("scripts", "TeXFiles.sh"));
- p.pop();
+ string filename;
+ switch (type) {
+ case ControlTexinfo::bst:
+ filename = "bstFiles.lst";
+ break;
+ case ControlTexinfo::cls:
+ filename = "clsFiles.lst";
+ break;
+ case ControlTexinfo::sty:
+ filename = "styFiles.lst";
+ break;
+ }
+ getTexFileList(filename, list);
+ if (list.empty()) {
+ // build filelists of all availabe bst/cls/sty-files.
+ // Done through kpsewhich and an external script,
+ // saved in *Files.lst
+ rescanTexStyles();
+ getTexFileList(filename, list);
+ }
+ if (withPath)
+ return;
+ vector<string>::iterator it = list.begin();
+ vector<string>::iterator end = list.end();
+ for (; it != end; ++it) {
+ *it = onlyFilename(*it);
+ }
+ // sort on filename only (no path)
+ std::sort(list.begin(), list.end());