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

Method cleanupGlobalIntermediateStorage

ChatView/ChatFileManager.cpp:91–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void ChatFileManager::cleanupGlobalIntermediateStorage()
92{
93 const QString basePath = Core::ICore::userResourcePath().toFSPathString();
94 const QString intermediatePath = QDir(basePath).filePath("qodeassist/chat_temp_files");
95
96 QDir dir(intermediatePath);
97 if (!dir.exists()) {
98 return;
99 }
100
101 const QFileInfoList files = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
102 int removedCount = 0;
103 int failedCount = 0;
104
105 for (const QFileInfo &fileInfo : files) {
106 QFile file(fileInfo.absoluteFilePath());
107 file.setPermissions(QFile::WriteUser | QFile::ReadUser);
108 if (file.remove()) {
109 removedCount++;
110 } else {
111 failedCount++;
112 }
113 }
114
115 if (removedCount > 0 || failedCount > 0) {
116 LOG_MESSAGE(QString("ChatFileManager global cleanup: removed=%1, failed=%2")
117 .arg(removedCount)
118 .arg(failedCount));
119 }
120}
121
122QString ChatFileManager::copyToIntermediateStorage(const QString &filePath)
123{

Callers

nothing calls this directly

Calls 1

filePathMethod · 0.45

Tested by

no test coverage detected