本文整理汇总了C++中qstringlist::iterator::endsWith方法的典型用法代码示例。如果您正苦于以下问题:C++ iterator::endsWith方法的具体用法?C++ iterator::endsWith怎么用?C++ iterator::endsWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstringlist::iterator
的用法示例。
在下文中一共展示了iterator::endsWith方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetDirectory
void DisplayWidget::SetDirectory(QString filename)
{
QDir dir(filename);
if(!dir.isAbsolute())
LOG_WARNING(cString::Format("Path is not absolute. Force absolute path!"));
QStringList fileList = dir.entryList(QDir::Files);
QStringList files;
for(QStringList::iterator it = fileList.begin(); it != fileList.end(); it++)
{
if(it->endsWith(".xml"))
{
cDOM oDOM;
QString qString = dir.absoluteFilePath(".") + "/" + *it;
LOG_INFO(cString::Format("path %s", qString.toStdString().c_str()));
oDOM.Load(qString.toStdString().c_str());
cDOMElementRefList oElems;
if(IS_OK(oDOM.FindNodes("presets/sensorPreset", oElems)))
files.push_back(*it);
}
}
m_dropDownFileChooser->addItems(files);
}
示例2: updateScanFolders
void ScanFolderPlugin::updateScanFolders()
{
QStringList folders = ScanFolderPluginSettings::folders();
// make sure folders end with /
for (QStringList::iterator i = folders.begin();i !=folders.end(); i++)
{
if (!i->endsWith(bt::DirSeparator()))
(*i) += bt::DirSeparator();
}
if (ScanFolderPluginSettings::actionDelete())
tlq->setLoadedTorrentAction(DeleteAction);
else if (ScanFolderPluginSettings::actionMove())
tlq->setLoadedTorrentAction(MoveAction);
else
tlq->setLoadedTorrentAction(DefaultAction);
scanner->setRecursive(ScanFolderPluginSettings::recursive());
scanner->setFolderList(folders);
}
示例3: loadPlugins
void PluginManager::loadPlugins() {
// first try to remove duplicit directories
// (I know, I know, this is bad as it does not take care of
// symlinks etc. but it is better than nothing)
QStringList::iterator dirEnd = pluginDirectories_.end();
for (QStringList::iterator dir = pluginDirectories_.begin(); dir != dirEnd; ++dir) {
if (!dir->endsWith("/")) {
dir->append("/");
}
}
pluginDirectories_.removeDuplicates();
dirEnd = pluginDirectories_.end();
for (QStringList::iterator dir = pluginDirectories_.begin(); dir != dirEnd; ++dir) {
QDir pluginDirectory(*dir);
QStringList pluginFiles = pluginDirectory.entryList(QStringList() << "lib*plugin*");
QStringList::iterator e = pluginFiles.end();
for (QStringList::iterator i = pluginFiles.begin(); i != e; ++i) {
loadPlugin(pluginDirectory.absoluteFilePath(*i));
}
}
}
示例4:
QStringList::iterator
CLArgsPrivate::findFileNameWithExtension(const QString& extension)
{
bool isPython = extension == QString::fromUtf8("py");
for (QStringList::iterator it = args.begin(); it != args.end(); ++it) {
if (isPython) {
//Check that we do not take the python script specified for the --onload argument as the file to execute
if ( it == args.begin() ) {
continue;
}
QStringList::iterator prev = it;
--prev;
if ( ( *prev == QString::fromUtf8("--onload") ) || ( *prev == QString::fromUtf8("-l") ) ) {
continue;
}
}
if ( it->endsWith(QChar::fromLatin1('.') + extension) ) {
return it;
}
}
return args.end();
}