MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / loadIgnorePatterns

Method loadIgnorePatterns

context/IgnoreManager.cpp:143–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143QStringList IgnoreManager::loadIgnorePatterns(ProjectExplorer::Project *project)
144{
145 QStringList patterns;
146 if (!project)
147 return patterns;
148
149 QString ignoreFile = ignoreFilePath(project);
150 if (ignoreFile.isEmpty() || !QFile::exists(ignoreFile)) {
151 // LOG_MESSAGE(
152 // QString("No .qodeassistignore file found for project: %1").arg(project->displayName()));
153 return patterns;
154 }
155
156 QFile file(ignoreFile);
157 if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
158 LOG_MESSAGE(QString("Could not open .qodeassistignore file: %1").arg(ignoreFile));
159 return patterns;
160 }
161
162 QTextStream in(&file);
163 while (!in.atEnd()) {
164 QString line = in.readLine().trimmed();
165 if (!line.isEmpty() && !line.startsWith('#'))
166 patterns << line;
167 }
168
169 LOG_MESSAGE(QString("Successfully loaded .qodeassistignore file: %1 with %2 patterns")
170 .arg(ignoreFile)
171 .arg(patterns.size()));
172
173 return patterns;
174}
175
176void IgnoreManager::reloadIgnorePatterns(ProjectExplorer::Project *project)
177{

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected