MCPcopy Create free account
hub / github.com/KDE/kid3 / classifyFile

Method classifyFile

src/plugins/kid3qml/scriptutils.cpp:279–295  ·  view source on GitHub ↗

* @brief Get type of file. * @param filePath path to file * @return "/" for directories, "@" for symlinks, "*" for executables, * " " for files. */

Source from the content-addressed store, hash-verified

277 * " " for files.
278 */
279QString ScriptUtils::classifyFile(const QString& filePath)
280{
281 if (QFileInfo fi(filePath); fi.isSymLink()) {
282 return QLatin1String("@");
283 } else {
284 if (fi.isDir()) {
285 return QLatin1String("/");
286 }
287 if (fi.isExecutable()) {
288 return QLatin1String("*");
289 }
290 if (fi.isFile()) {
291 return QLatin1String(" ");
292 }
293 return QString();
294 }
295}
296
297/**
298 * Rename file.

Callers

nothing calls this directly

Calls 4

isSymLinkMethod · 0.80
QStringClass · 0.50
isDirMethod · 0.45
isFileMethod · 0.45

Tested by

no test coverage detected