/* Called to save data to the configuration file. */ void SettingsPagePointDataLoading::slot_save() { QStringList files; if( m_fileTable->item( 0, 0 )->checkState() == Qt::Checked ) { // All files are selected. files << "All"; } else { // Store only checked file items. for( int i = 1; i < m_fileTable->rowCount(); i++ ) { QTableWidgetItem* item = m_fileTable->item( i, 0 ); if( item->checkState() == Qt::Checked ) { files << item->text(); } } } QStringList oldFiles = GeneralConfig::instance()->getOpenAipPoiFileList(); // save the new file list GeneralConfig::instance()->setOpenAipPoiFileList( files ); // Check, if file list has been modified if( oldFiles.size() != files.size() ) { // List size is different, emit signal. emit fileListChanged(); } else { // The list size is equal, we have to check every single list element. // Note that the lists are always sorted. for( int i = 0; i < files.size(); i++ ) { if( files.at(i) != oldFiles.at(i) ) { // File names are different, emit signal. emit fileListChanged(); break; } } } close(); }
void DeleteItem::setFileList(QStringList arg) { if (m_fileList != arg) { m_fileList = arg; emit fileListChanged(arg); } }
/*! * \brief Class constructor. * \param dir path to monitoring directory. * \param parent pointer to parent object. */ FileSystemMonitor::FileSystemMonitor(const QString &dir, QObject *parent) : QObject(parent) , m_DirName(dir) , m_ProcessFlag(false) { if (!m_DirName.isEmpty()) emit fileListChanged(files()); }
void TodoItemsProvider::setupStartupProjectBinding() { ProjectExplorer::ProjectExplorerPlugin *projectExplorerPlugin = ProjectExplorer::ProjectExplorerPlugin::instance(); m_startupProject = projectExplorerPlugin->startupProject(); connect(projectExplorerPlugin->session(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), SLOT(startupProjectChanged(ProjectExplorer::Project*))); connect(projectExplorerPlugin, SIGNAL(fileListChanged()), SLOT(projectsFilesChanged())); }
void QmlProject::parseProject(RefreshOptions options) { Core::MessageManager *messageManager = Core::ICore::messageManager(); if (options & Files) { if (options & ProjectFile) delete m_projectItem.data(); if (!m_projectItem) { Utils::FileReader reader; if (reader.fetch(m_fileName)) { QDeclarativeComponent *component = new QDeclarativeComponent(&m_engine, this); component->setData(reader.data(), QUrl::fromLocalFile(m_fileName)); if (component->isReady() && qobject_cast<QmlProjectItem*>(component->create())) { m_projectItem = qobject_cast<QmlProjectItem*>(component->create()); connect(m_projectItem.data(), SIGNAL(qmlFilesChanged(QSet<QString>,QSet<QString>)), this, SLOT(refreshFiles(QSet<QString>,QSet<QString>))); } else { messageManager->printToOutputPane(tr("Error while loading project file %1.").arg(m_fileName), Core::MessageManager::NoModeSwitch); messageManager->printToOutputPane(component->errorString(), Core::MessageManager::NoModeSwitch); } } else { messageManager->printToOutputPane(tr("QML project: %1").arg(reader.errorString()), Core::MessageManager::NoModeSwitch); } } if (m_projectItem) { m_projectItem.data()->setSourceDirectory(projectDir().path()); m_modelManager->updateSourceFiles(m_projectItem.data()->files(), true); QString mainFilePath = m_projectItem.data()->mainFile(); if (!mainFilePath.isEmpty()) { mainFilePath = projectDir().absoluteFilePath(mainFilePath); Utils::FileReader reader; QString errorMessage; if (!reader.fetch(mainFilePath, &errorMessage)) { messageManager->printToOutputPane( tr("Warning while loading project file %1.").arg(m_fileName), Core::MessageManager::NoModeSwitch); messageManager->printToOutputPane(errorMessage, Core::MessageManager::NoModeSwitch); } else { m_defaultImport = detectImport(QString::fromUtf8(reader.data())); } } } m_rootNode->refresh(); } if (options & Configuration) { // update configuration } if (options & Files) emit fileListChanged(); }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void QRecentFileList::addFile(const QString &file) { //std::cout << "QRecentFileList::addFile()" << std::endl; //std::cout << "recentFiles.count: " << recentFiles.count() << std::endl; if (QFile::exists(file) == true) { if (this->recentFiles.contains(file) == false) { this->recentFiles.append(file); emit fileListChanged(file); // Emit the signal so all the menus can update thier contents } } }
void XCodeProject::parsingFinished() { PBProjectModel::Ptr replacement = d->m_modelReloadWatcher.result(); if (replacement.isNull()) return; d->m_model = replacement; d->m_rootNode->refresh(d->m_model); updateCodeModel(); // TODO: can we (and is is important to) detect when the list really changed? emit fileListChanged(); }
void GoProject::parseProject(RefreshOptions options) { if (options & Files) { if (options & ProjectFile) delete m_projectItem.data(); if (!m_projectItem) { QString errorMessage; m_projectItem = GoProjectFileFormat::parseProjectFile(m_fileName, &errorMessage); if (m_projectItem) { connect(m_projectItem.data(), SIGNAL(filesChanged(QSet<QString>,QSet<QString>)), this, SLOT(refreshFiles(QSet<QString>,QSet<QString>))); } else { MessageManager::write(tr("Error while loading project file %1.").arg(m_fileName), MessageManager::NoModeSwitch); MessageManager::write(errorMessage); } } if (m_projectItem) { m_projectItem.data()->setSourceDirectory(projectDir().path()); m_modelManager->updateSourceFiles(m_projectItem.data()->files(), true); /* QString mainFilePath = m_projectItem.data()->mainFile(); if (!mainFilePath.isEmpty()) { mainFilePath = projectDir().absoluteFilePath(mainFilePath); Utils::FileReader reader; QString errorMessage; if (!reader.fetch(mainFilePath, &errorMessage)) { MessageManager::write(tr("Warning while loading project file %1.").arg(m_fileName)); MessageManager::write(errorMessage); } else { m_defaultImport = detectImport(QString::fromUtf8(reader.data())); } } */ } m_rootNode->refresh(); updateConfigurations(); } if (options & Configuration) { // update configuration } if (options & Files) emit fileListChanged(); }
void DeleteItem::addFiles(QStringList list) { m_fileList.append(list); emit fileListChanged(m_fileList); }
void DeleteItem::addFile(QString path) { m_fileList.append(path); emit fileListChanged(m_fileList); }
void DeleteItem::removeFile(int index) { m_fileList.removeAt(index); emit fileListChanged(m_fileList); }
/*! * \brief Directory name setter. * \param dirName directory name. */ void FileSystemMonitor::setDirName(const QString &dirName) { if (m_ProcessFlag) m_ProcessFlag = false; m_DirName = dirName; if (!m_DirName.isEmpty()) emit fileListChanged(files()); }