MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / path

Method path

src/common/util/environment.cpp:154–180  ·  view source on GitHub ↗

! * @brief package::native::path * get local install offline packge path * @param category use package name to search * @return if Category is empty return install top path, else return package name path */

Source from the content-addressed store, hash-verified

152 * @return if Category is empty return install top path, else return package name path
153 */
154QString package::native::path(const Category::type_value &category)
155{
156 QString envPath = QString(LIBRARY_INSTALL_PREFIX)
157 + QDir::separator() + "tools"
158 + QDir::separator() + "env";
159 if (category.isEmpty()) {
160 return envPath;
161 } else {
162 QDirIterator sameItera(envPath, QDir::Files|QDir::NoDotAndDotDot);
163 while (sameItera.hasNext()) {
164 sameItera.next();
165 QFileInfo info = sameItera.fileInfo();
166 if (category == info.fileName()) {
167 return info.filePath();
168 }
169 }
170 QDirIterator containsItera(envPath, QDir::Files|QDir::NoDotAndDotDot);
171 while (containsItera.hasNext()) {
172 containsItera.next();
173 QFileInfo info = containsItera.fileInfo();
174 if (info.fileName().contains(category)) {
175 return info.filePath();
176 }
177 }
178 }
179 return envPath;
180}
181
182/*!
183 * \brief environment::package::native::installed

Callers 7

dropEventMethod · 0.45
exportConfigMethod · 0.45
scriptsPathMethod · 0.45
scanfAllPluginMethod · 0.45
rmExpiredLogsFunction · 0.45
rmExpiredLogsFunction · 0.45
checkCreateDirMethod · 0.45

Calls 6

fileNameMethod · 0.80
QStringClass · 0.70
isEmptyMethod · 0.45
nextMethod · 0.45
filePathMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected