本文整理汇总了C++中qfileinfolist::iterator::isSymLink方法的典型用法代码示例。如果您正苦于以下问题:C++ iterator::isSymLink方法的具体用法?C++ iterator::isSymLink怎么用?C++ iterator::isSymLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qfileinfolist::iterator
的用法示例。
在下文中一共展示了iterator::isSymLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: soInfo
QString
AudioPluginOSCGUI::getGUIFilePath(QString identifier)
{
QString type, soName, label;
PluginIdentifier::parseIdentifier(identifier, type, soName, label);
RG_DEBUG << "AudioPluginOSCGUI::getGUIFilePath(" << identifier << ")";
QFileInfo soInfo(soName);
if (soInfo.isRelative()) {
//!!!
RG_DEBUG << "AudioPluginOSCGUI::AudioPluginOSCGUI: Unable to deal with relative .so path \"" << soName << "\" in identifier \"" << identifier << "\" yet";
throw Exception("Can't deal with relative .soname");
}
QDir dir(soInfo.dir());
QString fileBase(soInfo.completeBaseName());
if (!dir.cd(fileBase)) {
RG_DEBUG << "AudioPluginOSCGUI::AudioPluginOSCGUI: No GUI subdir for plugin .so " << soName;
throw Exception("No GUI subdir available");
}
QFileInfoList list = dir.entryInfoList();
// in order of preference:
const char *suffixes[] = { "_rg", "_kde", "_qt", "_gtk2", "_gtk", "_x11", "_gui"
};
int nsuffixes = int(sizeof(suffixes) / sizeof(suffixes[0]));
for (int k = 0; k <= nsuffixes; ++k) {
for (int fuzzy = 0; fuzzy <= 1; ++fuzzy) {
QFileInfoList::iterator info;
for (info = list.begin(); info != list.end(); ++info) { //### JAS Check for errors
RG_DEBUG << "Looking at " << info->fileName() << " in path "
<< info->filePath() << " for suffix " << (k == nsuffixes ? "(none)" : suffixes[k]) << ", fuzzy " << fuzzy << endl;
if (!(info->isFile() || info->isSymLink())
|| !info->isExecutable()) {
RG_DEBUG << "(not executable)";
continue;
}
if (fuzzy) {
if (info->fileName().left(fileBase.length()) != fileBase)
continue;
RG_DEBUG << "(is file base)";
} else {
if (info->fileName().left(label.length()) != label)
continue;
RG_DEBUG << "(is label)";
}
if (k == nsuffixes || info->fileName().toLower().endsWith(suffixes[k])) {
RG_DEBUG << "(ends with suffix " << (k == nsuffixes ? "(none)" : suffixes[k]) << " or out of suffixes)";
return info->filePath();
}
RG_DEBUG << "(doesn't end with suffix " << (k == nsuffixes ? "(none)" : suffixes[k]) << ")";
}
}
}
return QString();
}