bool FileBackend::setArgumentsFromQml(const QVariantList& arguments) { QStringList list; for (auto &item : arguments) { QUrl url(item.toString()); if (url.isLocalFile()) { list.append(url.toLocalFile()); } } if (!list.empty()) { this->setArguments(list); return true; } return false; }
void MainWindow::dropEvent(QDropEvent *event) { const QMimeData *mimeData = event->mimeData(); if (mimeData->hasUrls()) { QList<QUrl> urlList(mimeData->urls()); QStringList fileList; for(int size = urlList.size(), i=0; i < size; ++i) fileList.append(urlList.at(i).toLocalFile()); fileList = ToolKit::getFilesExist(fileList); /// if(!fileList.empty()) viewer->openFiles(fileList); } event->acceptProposedAction(); }
QDomNode SOAPClient::FindNode( QStringList &sParts, QDomNode &curNode ) { if (sParts.empty()) return curNode; QString sName = sParts.front(); sParts.pop_front(); QDomNode child = curNode.namedItem( sName ); if (child.isNull() ) sParts.clear(); return FindNode( sParts, child ); }
void Database::initializeDatabase() throw (TimesheetProcessorException ) { try { QStringList tables = m_storage.database().tables(); if ( !tables.empty() ) { throw TimesheetProcessorException( "The database is not empty. Only " "empty databases can be automatically initialized." ); } if ( !m_storage.createDatabaseTables() ) { throw TimesheetProcessorException( "Cannot create database contents, please double-check permissions." ); } } catch ( UnsupportedDatabaseVersionException& e ) { throw TimesheetProcessorException( e.what() ); } }
/** \fn DBUtil::CheckTables(const bool repair, const QString options) * \brief Checks database tables * * This function will check database tables. * * \param repair Repair any tables whose status is not OK * \param options Options to be passed to CHECK TABLE; defaults to QUICK * \return false if any tables have status other than OK; if repair is true, * returns true if those tables were repaired successfully * \sa DBUtil::RepairTables(const QStringList) */ bool DBUtil::CheckTables(const bool repair, const QString options) { MSqlQuery query(MSqlQuery::InitCon()); if (!query.isConnected()) return false; const QStringList all_tables = GetTables(QStringList("MyISAM")); if (all_tables.empty()) return true; QString sql = QString("CHECK TABLE %1 %2;").arg(all_tables.join(", ")) .arg(options); LOG(VB_GENERAL, LOG_CRIT, "Checking database tables."); if (!query.exec(sql)) { MythDB::DBError("DBUtil Checking Tables", query); return false; } QStringList tables = CheckRepairStatus(query); bool result = true; if (!tables.empty()) { LOG(VB_GENERAL, LOG_CRIT, QString("Found crashed database table(s): %1") .arg(tables.join(", "))); if (repair == true) // If RepairTables() repairs the crashed tables, return true result = RepairTables(tables); else result = false; } return result; }
void CModListView::installFiles(QStringList files) { QStringList mods; // TODO: some better way to separate zip's with mods and downloaded repository files for (QString filename : files) { if (filename.contains(".zip")) mods.push_back(filename); if (filename.contains(".json")) manager->loadRepository(filename); } if (!mods.empty()) installMods(mods); }
void ApplicationSettings::parse(QStringList cargs, int& argc, char** argv) { QCommandLineParser parser; parser.setApplicationDescription(QObject::tr( "score - An interactive sequencer for the intermedia arts.")); parser.addHelpOption(); parser.addVersionOption(); parser.addPositionalArgument( "file", QCoreApplication::translate("main", "Scenario to load.")); QCommandLineOption noGUI( "no-gui", QCoreApplication::translate("main", "Disable GUI")); parser.addOption(noGUI); QCommandLineOption noRestore( "no-restore", QCoreApplication::translate("main", "Disable auto-restore")); parser.addOption(noRestore); QCommandLineOption autoplayOpt( "autoplay", QCoreApplication::translate("main", "Auto-play the loaded scenario")); parser.addOption(autoplayOpt); if (cargs.contains("--help") || cargs.contains("--version")) { QCoreApplication app(argc, argv); setQApplicationMetadata(); parser.process(cargs); exit(0); } else { parser.process(cargs); } const QStringList args = parser.positionalArguments(); tryToRestore = !parser.isSet(noRestore); gui = !parser.isSet(noGUI); if (!gui) tryToRestore = false; autoplay = parser.isSet(autoplayOpt) && args.size() == 1; if (!args.empty() && QFile::exists(args[0])) { loadList.push_back(args[0]); } }
uint64_t MythDVDPlayer::GetBookmark(void) { if (gCoreContext->IsDatabaseIgnored() || !player_ctx->buffer->IsDVD()) return 0; QStringList dvdbookmark = QStringList(); QString name; QString serialid; uint64_t frames = 0; player_ctx->LockPlayingInfo(__FILE__, __LINE__); if (player_ctx->playingInfo) { if (!player_ctx->buffer->DVD()->GetNameAndSerialNum(name, serialid)) { player_ctx->UnlockPlayingInfo(__FILE__, __LINE__); return 0; } dvdbookmark = player_ctx->playingInfo->QueryDVDBookmark(serialid); if (!dvdbookmark.empty()) { QStringList::Iterator it = dvdbookmark.begin(); if (dvdbookmark.count() == 1) { m_initial_dvdstate = *it; frames = ~0x0ULL; LOG(VB_PLAYBACK, LOG_INFO, LOC + "Get Bookmark: bookmark found"); } else { // Legacy bookmarks m_initial_title = (*it).toInt(); frames = (uint64_t)((*++it).toLongLong() & 0xffffffffLL); m_initial_audio_track = (*++it).toInt(); m_initial_subtitle_track = (*++it).toInt(); LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Get Bookmark: title %1 audiotrack %2 subtrack %3 " "frame %4") .arg(m_initial_title).arg(m_initial_audio_track) .arg(m_initial_subtitle_track).arg(frames)); } } } player_ctx->UnlockPlayingInfo(__FILE__, __LINE__); return frames;; }
void AbstractTableTab::displayMenu(QPoint pos) { QMenu menu(getTable()); QList<QDockWidget*> dockWindows = this->getDockWindows(); QModelIndexList selection = getTable()->selectionModel()->selectedRows(); if (selection.count() > 0) { QModelIndex index = selection.at(0); AlterSettingsEntry entry = settingEntries.at(index.row()); QStringList selected = entry.targetList; bool all = false; if(selected.contains(WINDOW_SELECT_ALL) || selected.empty()) all = true; QAction* allAction = menu.addAction(WINDOW_SELECT_ALL); allAction->setCheckable(true); allAction->setChecked(all); QAction* mainAction = menu.addAction(WINDOW_TITLE_MAIN); mainAction->setCheckable(true); mainAction->setChecked(!all && selected.contains(WINDOW_TITLE_MAIN)); for(QDockWidget* dock : dockWindows) { QAction *action = menu.addAction(dock->objectName()); action->setCheckable(true); action->setChecked(!all && selected.contains(dock->objectName())); } menu.addSeparator(); QAction* enabled = menu.addAction("Enabled"); enabled->setCheckable(true); enabled->setChecked(entry.enabled); pos.rx()--; pos.ry()--; QAction *a = menu.exec(getTable()->viewport()->mapToGlobal(pos)); if(a != NULL) { if(a->text() == "Enabled") { entry.enabled = a->isChecked(); } else if(a->isChecked()) { entry.targetList.append(a->text()); } else { entry.targetList.removeAll(a->text()); } settingEntries.replace(index.row(), entry); this->registerChange(index.row(), TableChangeEvent::Update); } } }
static QGpgMEKeyListJob::result_type list_keys(Context *ctx, QStringList pats, bool secretOnly) { if (pats.size() < 2) { std::vector<Key> keys; const KeyListResult r = do_list_keys(ctx, pats, keys, secretOnly); return std::make_tuple(r, keys, QString(), Error()); } // The communication channel between gpgme and gpgsm is limited in // the number of patterns that can be transported, but they won't // say to how much, so we need to find out ourselves if we get a // LINE_TOO_LONG error back... // We could of course just feed them single patterns, and that would // probably be easier, but the performance penalty would currently // be noticeable. unsigned int chunkSize = pats.size(); retry: std::vector<Key> keys; keys.reserve(pats.size()); KeyListResult result; do { const KeyListResult this_result = do_list_keys(ctx, pats.mid(0, chunkSize), keys, secretOnly); if (this_result.error().code() == GPG_ERR_LINE_TOO_LONG) { // got LINE_TOO_LONG, try a smaller chunksize: chunkSize /= 2; if (chunkSize < 1) // chunks smaller than one can't be -> return the error. { return std::make_tuple(this_result, keys, QString(), Error()); } else { goto retry; } } else if (this_result.error().code() == GPG_ERR_EOF) { // early end of keylisting (can happen when ~/.gnupg doesn't // exist). Fakeing an empty result: return std::make_tuple(KeyListResult(), std::vector<Key>(), QString(), Error()); } // ok, that seemed to work... result.mergeWith(this_result); if (result.error().code()) { break; } pats = pats.mid(chunkSize); } while (!pats.empty()); return std::make_tuple(result, keys, QString(), Error()); }
void ContactWidgetItem::setContactIcon() { if (m_addressee->photo().isEmpty()) { m_icon->setIcon(KIcon("user-identity")); } else { QPixmap pixmap; pixmap.convertFromImage(m_addressee->photo().data()); m_icon->setIcon(KIcon(QIcon(pixmap))); } if (m_addressee->formattedName().isEmpty() && m_addressee->name().isEmpty()) { QStringList emails = m_addressee->emails(); if (!emails.empty()) { m_icon->setText(emails.first()); } else { m_icon->setText(i18n("Contact without name")); } } else { if (!m_addressee->formattedName().isEmpty()) { m_icon->setText(m_addressee->formattedName()); } else { m_icon->setText(m_addressee->name()); } } }
void SearchJobWidget::copyTorrentURLs() { const QModelIndexList rows {m_ui->resultsBrowser->selectionModel()->selectedRows()}; QStringList urls; for (const QModelIndex &rowIndex : rows) { const QString descrLink = m_proxyModel->data( m_proxyModel->index(rowIndex.row(), SearchSortModel::DESC_LINK)).toString(); if (!descrLink.isEmpty()) urls << descrLink; } if (!urls.empty()) { QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(urls.join('\n')); } }
QFont FontHelper::fontFromFile(const QString &fontFile) { QFont font; int fontId; QStringList loadedFontFamilies; fontId = QFontDatabase::addApplicationFont(fontFile); loadedFontFamilies = QFontDatabase::applicationFontFamilies(fontId); if(!loadedFontFamilies.empty()) { font = loadedFontFamilies.at(0); } font.setStyleStrategy(QFont::PreferAntialias); return font; }
void FileBackend::setArguments(const QStringList& arguments) { status = Status::Loading; emit statusChanged(); this->files.clear(); if (!arguments.empty()) { QFileInfo info(arguments.at(0)); reader.setFileName(info.absoluteFilePath()); if (info.exists() && info.isFile() && reader.canRead()) { this->initFromSingleFile(info); } } status = (this->getCurrentFile() != nullptr) ? Status::Ready : Status::Empty; emit statusChanged(); emit currentFileChanged(); }
void MainWindow::choose_save_file(){ QStringList filenames; QFileDialog dialog(this); dialog.setDirectory(ui->line_outputFile->text()); dialog.setFileMode(QFileDialog::AnyFile); dialog.setViewMode(QFileDialog::Detail); dialog.setNameFilter(tr("ROOT Files (*.root)")); if(dialog.exec()){ filenames = dialog.selectedFiles(); } if(!filenames.empty()){ ui->line_outputFile->setText(filenames.first()); outputFilename = filenames.first(); } }
void BakaEngine::BakaUpdate(QStringList &args) { if(args.empty()) UpdateDialog::CheckForUpdates(this, window); else { #if defined(Q_OS_WIN) QString arg = args.front(); args.pop_front(); if(arg == "youtube-dl") QProcess::startDetached("youtube-dl.exe", {"--update"}); else #endif InvalidParameter(args.join(' ')); } }
MythCCExtractorPlayer::MythCCExtractorPlayer( PlayerFlags flags, bool showProgress, const QString &fileName) : MythPlayer(flags), m_curTime(0), m_curTimeShift(-1), m_myFramesPlayed(0), m_showProgress(showProgress), m_fileName(fileName) { // Determine where we will put extracted info. QStringList comps = QFileInfo(m_fileName).fileName().split("."); if (!comps.empty()) comps.removeLast(); m_workingDir = QDir(QFileInfo(m_fileName).path()); m_baseName = comps.join("."); }
void PiqslMainWindow::saveLibraryAs() { QFileDialog fileDialog(this, tr("Save Library As"), m_currentDirectory, tr("Piqsl book files (*.bks)")); fileDialog.setFileMode(QFileDialog::AnyFile); fileDialog.setViewMode(QFileDialog::Detail); fileDialog.setAcceptMode(QFileDialog::AcceptSave); if(!fileDialog.exec()) return; m_currentDirectory = fileDialog.directory().absolutePath(); QStringList selected = fileDialog.selectedFiles(); if(selected.empty()) return; if(m_imageList->saveImageLibrary(selected[0])) m_currentLibraryName = selected[0]; }
void MainWindowStandalone::initializePluginFinder(){ MainWindow::initializePluginFinder(); QStringList vstPaths = mainController->getSettings().getVstPluginsPaths(); if(vstPaths.empty()){//no vsts in database cache, try scan if(mainController->getSettings().getVstScanFolders().isEmpty()){ (dynamic_cast<Controller::StandaloneMainController*>(mainController))->addDefaultPluginsScanPath(); } mainController->saveLastUserSettings(getInputsSettings());//save config file before scan (dynamic_cast<Controller::StandaloneMainController*>(mainController))->scanPlugins(); } else{//use vsts stored in settings file (dynamic_cast<Controller::StandaloneMainController*>(mainController))->initializePluginsList(vstPaths); onScanPluginsFinished(true); } }
static QStringList get_file_name( QWidget * parent ) { const QString certificateFilter = i18n("Certificates") + " (*.asc *.cer *.cert *.crt *.der *.pem *.gpg *.p7c *.p12 *.pfx *.pgp)"; const QString anyFilesFilter = i18n("Any files") + " (*)"; QString previousDir; if ( const KSharedConfig::Ptr config = KGlobal::config() ) { const KConfigGroup group( config, "Import Certificate" ); previousDir = group.readPathEntry( "last-open-file-directory", QDir::homePath() ); } const QStringList files = QFileDialog::getOpenFileNames( parent, i18n( "Select Certificate File" ), previousDir, certificateFilter + ";;" + anyFilesFilter ); if ( !files.empty() ) if ( const KSharedConfig::Ptr config = KGlobal::config() ) { KConfigGroup group( config, "Import Certificate" ); group.writePathEntry( "last-open-file-directory", QFileInfo( files.front() ).path() ); } return files; }
void AntistringConfiguration::readConditions() { Conditions.clear(); QString conditionsString = config_file.readEntry("PowerKadu", "antistring conditions"); QStringList conditionsList = conditionsString.split("\t\t"); if (conditionsList.empty()) { readDefaultConditions(); return; } foreach (const QString &conditionItem, conditionsList) addCondition(conditionItem); }
bool DatabaseDialog::tablesDoNext() { m_databaseStatus->setText( i18n("Retrieving meta data of tables...") ); QStringList tables; { Q3ListViewItem * item = (Q3CheckListItem *) m_tableView->firstChild(); for (; item; item = item->nextSibling()) { if (((Q3CheckListItem * ) item)->isOn()) { tables.append(((Q3CheckListItem * ) item)->text()); } } } if (tables.empty()) { KMessageBox::error( this, i18n("You have to select at least one table.") ); return false; } m_columnView->clear(); QSqlRecord info; for (int i = 0; i < (int) tables.size(); ++i) { info = m_dbConnection.record( tables[i] ); for (int j = 0; j < (int) info.count(); ++j) { QString name = info.fieldName(j); Q3CheckListItem * checkItem = new Q3CheckListItem( m_columnView, name, Q3CheckListItem::CheckBox ); checkItem->setOn(false); m_columnView->insertItem( checkItem ); checkItem->setText( 1, tables[i] ); QSqlField field = info.field(name); checkItem->setText( 2, QVariant::typeToName(field.type()) ); } } m_columnView->setSorting(1, true); m_columnView->sort(); m_columnView->setSorting( -1 ); setValid(m_columns, true); return true; }
/* * Wird ausgelößt wenn checkbox getätigt wird */ void QvkWebcamController::setWebcamOnOff( bool value ) { if ( value == false ) { captureThread->stop(); webcamWindow->close(); return; } QString index = comboBox->currentText().left( 2 ).right( 1 ); QProcess Process; Process.start( "lsof /dev/video" + index ); Process.waitForFinished(); QString standardOutput = Process.readAllStandardOutput(); Process.close(); if ( captureThread->busy( "/dev/video" + index ) == true ) { QString usedBy = ""; if ( standardOutput > "" ) { QStringList list = standardOutput.split( "\n" ); if ( not list.empty() ) { list = list[ 1 ].split( " " ); usedBy = list[ 0 ]; } } QvkWebcamBusyDialog *WebcamBusyDialog = new QvkWebcamBusyDialog( comboBox->currentText().remove( 0, 4 ), "/dev/video" + index, usedBy ); (void) WebcamBusyDialog; qDebug() << "[vokoscreen] webcam device /dev/video" + index + " " + comboBox->currentText().remove( 0, 4 ) + " is busy by " + usedBy; checkBox->setChecked( Qt::Unchecked ); return; } if ( value == true ) { comboBox->setEnabled( false ); mirrorCheckBox->setEnabled( true ); rotateFrame->setEnabled( true ); webcamWindow->show(); webcamWindow->currentDevice = "/dev/video" + index; captureThread->start( "/dev/video" + index ); } }
/** ***********************************************************************/ vector<shared_ptr<IIndexable>> search(const QString &req) const override { // Split the query into words W QStringList words = req.split(QRegularExpression(SEPARATOR_REGEX), QString::SkipEmptyParts); // Skip if there arent any // CONSTRAINT (2): |W| > 0 if (words.empty()) return vector<shared_ptr<IIndexable>>(); set<shared_ptr<IIndexable>> resultsSet; QStringList::iterator wordIterator = words.begin(); // Make lower for case insensitivity QString word = wordIterator++->toLower(); // Get a word mapping once before goint to handle intersections for (InvertedIndex::const_iterator lb = invertedIndex_.lower_bound(word); lb != invertedIndex_.cend() && lb->first.startsWith(word); ++lb) resultsSet.insert(lb->second.begin(), lb->second.end()); for (;wordIterator != words.end(); ++wordIterator) { // Make lower for case insensitivity word = wordIterator->toLower(); // Unite the sets that are mapped by words that begin with word // w ∈ W. This set is called U_w set<shared_ptr<IIndexable>> wordMappingsUnion; for (InvertedIndex::const_iterator lb = invertedIndex_.lower_bound(word); lb != invertedIndex_.cend() && lb->first.startsWith(word); ++lb) wordMappingsUnion.insert(lb->second.begin(), lb->second.end()); // Intersect all sets U_w with the results set<shared_ptr<IIndexable>> intersection; std::set_intersection(resultsSet.begin(), resultsSet.end(), wordMappingsUnion.begin(), wordMappingsUnion.end(), std::inserter(intersection, intersection.begin())); resultsSet = std::move(intersection); } // Convert to a std::vector vector<shared_ptr<IIndexable>> resultsVector(resultsSet.begin(), resultsSet.end()); return resultsVector; }
void PythonScriptModule::LoadStartupScripts() { QStringList pluginsToLoad; QString configFile = GetFramework()->Plugins()->ConfigurationFile(); QDomDocument doc("plugins"); QFile file(configFile); if (!file.open(QIODevice::ReadOnly)) { LogError("PythonScriptModule::LoadStartupScripts: Failed to open file \"" + configFile + "\"!"); return; } if (!doc.setContent(&file)) { LogError("PythonScriptModule::LoadStartupScripts: Failed to parse XML file \"" + configFile + "\"!"); file.close(); return; } file.close(); QDomElement docElem = doc.documentElement(); QDomNode n = docElem.firstChild(); while(!n.isNull()) { QDomElement e = n.toElement(); // try to convert the node to an element. if (!e.isNull() && e.tagName() == "pyplugin" && e.hasAttribute("path")) pluginsToLoad.push_back(e.attribute("path")); n = n.nextSibling(); } LogInfo(Name() + ": Loading startup scripts"); QDir pythonPlugins(Application::InstallationDirectory() + "pyplugins"); foreach(QString pluginPath, pluginsToLoad) { const QString pluginFile = pythonPlugins.absoluteFilePath(pluginPath); if (QFile::exists(pluginFile)) { LogInfo(Name() + ": ** " + pluginPath.toStdString()); RunScript(pluginFile); } else LogWarning(Name() + ": ** Could not locate startup pyplugin '" + pluginPath.toStdString() +"'. Make sure your path is relative to /pyplugins folder."); } if (pluginsToLoad.empty()) LogInfo(Name() + ": ** No python scripts in startup config"); }
QStringList DialogGui::getOpenImageFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options ) { #ifdef IMAGE_PREVIEW QFileDialog fileDialog(parent, caption, dir, filter); initializeImageFileDialog(fileDialog, options, QFileDialog::ExistingFiles); if (fileDialog.exec() != QDialog::Accepted) return QStringList(); const QStringList selectedFiles = fileDialog.selectedFiles(); if (!selectedFiles.empty() && selectedFilter) *selectedFilter = fileDialog.selectedFilter(); return selectedFiles; #else return getOpenFileNames(parent, caption, dir, filter, selectedFilter, options); #endif }
void V4LConfigurationEngine::configRequest(QStringList sConfig) { if ( sConfig.empty()) { #ifdef _DEBUG_CONFIGURATION_OBJECTS qWarning() << "[V4L_CONFIGURATION_ENGINE] - configRequest() - Empty Configuration "; #endif //_DEBUG_CONFIGURATION_OBJECTS if (_deviceName.isEmpty()) _settingsDialog->show(); } else { struct v4l2_format config_format; #ifdef _DEBUG_CONFIGURATION_OBJECTS qDebug() << "[V4L_CONFIGURATION_ENGINE] - configRequest() - Configuration received: " << sConfig; #endif //_DEBUG_CONFIGURATION_OBJECTS _deviceName = sConfig.at(0); config_format = encodeConfigurationStringList(sConfig, _stored_configuration); configurationQuery(config_format); } }
QStringList DecoderRegistry::getSupportedTypes(void) { QStringList types; types << GET_FILETYPES(WaveDecoder); types << GET_FILETYPES(MP3Decoder); types << GET_FILETYPES(VorbisDecoder); types << GET_FILETYPES(AACDecoder); types << GET_FILETYPES(AC3Decoder); types << GET_FILETYPES(FLACDecoder); types << GET_FILETYPES(WavPackDecoder); types << GET_FILETYPES(MusepackDecoder); types << GET_FILETYPES(ShortenDecoder); types << GET_FILETYPES(MACDecoder); types << GET_FILETYPES(TTADecoder); types << GET_FILETYPES(SpeexDecoder); types << GET_FILETYPES(ALACDecoder); types << GET_FILETYPES(WMADecoder); types << GET_FILETYPES(ADPCMDecoder); types << GET_FILETYPES(OpusDecoder); types << GET_FILETYPES(AvisynthDecoder); QStringList extensions; extensions << QString(PlaylistImporter::supportedExtensions).split(" ", QString::SkipEmptyParts); QRegExp regExp("\\((.+)\\)", Qt::CaseInsensitive); for(int i = 0; i < types.count(); i++) { if(regExp.lastIndexIn(types.at(i)) >= 0) { extensions << regExp.cap(1).split(" ", QString::SkipEmptyParts); } } if(!extensions.empty()) { extensions.removeDuplicates(); extensions.sort(); types.prepend(QString("%1 (%2)").arg(tr("All supported types"), extensions.join(" "))); } types << QString("%1 (%2)").arg(tr("Playlists"), PlaylistImporter::supportedExtensions); types << QString("%1 (*.*)").arg(tr("All files")); return types; }
// Return a list of widget classes from which new forms can be generated. // Suitable for 'New form' wizards in integrations. QStringList WidgetDataBase::formWidgetClasses(const QDesignerFormEditorInterface *core) { static QStringList rc; if (rc.empty()) { const QDesignerWidgetDataBaseInterface *wdb = core->widgetDataBase(); const int widgetCount = wdb->count(); for (int i = 0; i < widgetCount; i++) { const QDesignerWidgetDataBaseItemInterface *item = wdb->item(i); if (item->isContainer() && !item->isCustom() && !item->isPromoted()) { const QString name = item->name(); // Standard Widgets: no existing templates if (!isExistingTemplate(name) && suitableForNewForm(name)) rc += name; } } } return rc; }
void WebPage::on_file_repository_selected(const QString& policy, const QString& display_xslt, const QString& verbosity) { QStringList dirname = file_selector.value("checkerRepository_directory", QStringList()); if (dirname.empty()) return; QDir dir(dirname.last()); QFileInfoList list; add_sub_directory_files_to_list(dir, list); if (!list.count()) return; for (int i = 0; i < list.size(); ++i) mainwindow->add_file_to_list(list[i].fileName(), list[i].absolutePath(), policy, display_xslt, verbosity); file_selector.clear(); clean_forms(); }