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

Method generateIntermediateFileName

ChatView/ChatFileManager.cpp:171–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171QString ChatFileManager::generateIntermediateFileName(const QString &originalPath)
172{
173 const QFileInfo fileInfo(originalPath);
174 const QString extension = fileInfo.suffix();
175 QString baseName = fileInfo.completeBaseName().left(30);
176
177 static const QRegularExpression specialChars("[^a-zA-Z0-9_-]");
178 baseName.replace(specialChars, "_");
179
180 if (baseName.isEmpty()) {
181 baseName = "file";
182 }
183
184 const QString timestamp = QDateTime::currentDateTime().toString("yyyyMMdd_HHmmss");
185 const QString uuid = QUuid::createUuid().toString(QUuid::WithoutBraces).left(8);
186
187 return QString("%1_%2_%3.%4").arg(baseName, timestamp, uuid, extension);
188}
189
190} // namespace QodeAssist::Chat
191

Callers

nothing calls this directly

Calls 2

isEmptyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected