Fixed tons of warnings and clazy findings (#811)

This commit is contained in:
niansa/tuxifan
2023-06-02 21:46:41 +02:00
committed by GitHub
parent d6a70ddb5f
commit f3564ac6b9
12 changed files with 28 additions and 25 deletions

View File

@@ -387,7 +387,7 @@ QList<QString> Chat::modelList() const
QDir dir(exePath);
dir.setNameFilters(QStringList() << "ggml-*.bin");
QStringList fileNames = dir.entryList();
for (QString f : fileNames) {
for (const QString& f : fileNames) {
QString filePath = exePath + f;
QFileInfo info(filePath);
QString name = info.completeBaseName().remove(0, 5);
@@ -404,7 +404,7 @@ QList<QString> Chat::modelList() const
QDir dir(localPath);
dir.setNameFilters(QStringList() << "ggml-*.bin" << "chatgpt-*.txt");
QStringList fileNames = dir.entryList();
for (QString f : fileNames) {
for (const QString &f : fileNames) {
QString filePath = localPath + f;
QFileInfo info(filePath);
QString basename = info.completeBaseName();