void SyncFileStatusTracker::slotAboutToPropagate(SyncFileItemVector& items) { std::map<QString, SyncFileStatus::SyncFileStatusTag> oldProblems; std::swap(_syncProblems, oldProblems); foreach (const SyncFileItemPtr &item, items) { // qDebug() << Q_FUNC_INFO << "Investigating" << item->destination() << item->_status; if (showErrorInSocketApi(*item)) { _syncProblems[item->_file] = SyncFileStatus::StatusError; } else if (showWarningInSocketApi(*item)) { _syncProblems[item->_file] = SyncFileStatus::StatusWarning; } emit fileStatusChanged(getSystemDestination(item->destination()), syncFileItemStatus(*item)); } // Make sure to push any status that might have been resolved indirectly since the last sync // (like an error file being deleted from disk) for (auto it = _syncProblems.begin(); it != _syncProblems.end(); ++it) oldProblems.erase(it->first); for (auto it = oldProblems.begin(); it != oldProblems.end(); ++it) { const QString &path = it->first; SyncFileStatus::SyncFileStatusTag severity = it->second; if (severity == SyncFileStatus::StatusError) invalidateParentPaths(path); emit fileStatusChanged(getSystemDestination(path), fileStatus(path)); } }
void SyncFileStatusTracker::invalidateParentPaths(const QString& path) { QStringList splitPath = path.split('/', QString::SkipEmptyParts); for (int i = 0; i < splitPath.size(); ++i) { QString parentPath = QStringList(splitPath.mid(0, i)).join(QLatin1String("/")); emit fileStatusChanged(getSystemDestination(parentPath), fileStatus(parentPath)); } }
void SyncFileStatusTracker::slotPathTouched(const QString& fileName) { QString folderPath = _syncEngine->localPath(); Q_ASSERT(fileName.startsWith(folderPath)); QString localPath = fileName.mid(folderPath.size()); _dirtyPaths.insert(localPath); emit fileStatusChanged(fileName, SyncFileStatus::StatusSync); }
/** * @brief slot to move item in commandViewer up */ void CommandViewer::MoveUp_clicked() { int currentRow = list->currentRow(); if (currentRow == 0){ return; } QListWidgetItem *currentItem = list->takeItem(currentRow); list->insertItem(currentRow - 1, currentItem); list->setCurrentRow(currentRow - 1); emit fileStatusChanged(); }
void SoundEngine::connectSoundEngine() { connect(m_backingTrack,SIGNAL(fileStatusChanged()), this,SLOT(fileStatusChanged())); connect(m_recorderTrack,SIGNAL(audioDurationChanged()), this,SLOT(updateAudioDuration())); connect(m_backingTrack,SIGNAL(audioDurationChanged()), this,SLOT(updateAudioDuration())); connect(m_recorderTrack,SIGNAL(audioTimePositionChanged()), this,SLOT(updateTimeLinePosition())); connect(m_backingTrack,SIGNAL(audioTimePositionChanged()), this,SLOT(updateTimeLinePosition())); connect(m_backingTrack,SIGNAL(newBackingTrack(qint64,QAudioFormat)), m_recorderTrack,SLOT(fillRecordingFile(qint64,QAudioFormat))); connect(m_backingTrack,SIGNAL(newBackingTrack(qint64,QAudioFormat)), this,SLOT(sweepInputFile(qint64,QAudioFormat))); }
/** * @brief slot to move item in commandViewer down */ void CommandViewer::MoveDown_clicked() { int currentRow = list->currentRow(); int listSize = list->model()->rowCount(); if (currentRow >= (listSize - 1)){ return; } QListWidgetItem *currentItem = list->takeItem(currentRow); list->insertItem(currentRow + 1, currentItem); list->setCurrentRow(currentRow + 1); emit fileStatusChanged(); }
void SyncFileStatusTracker::slotItemCompleted(const SyncFileItem &item) { // qDebug() << Q_FUNC_INFO << item.destination() << item._status; if (showErrorInSocketApi(item)) { _syncProblems[item._file] = SyncFileStatus::StatusError; invalidateParentPaths(item.destination()); } else if (showWarningInSocketApi(item)) { _syncProblems[item._file] = SyncFileStatus::StatusWarning; } else { _syncProblems.erase(item._file); } emit fileStatusChanged(getSystemDestination(item.destination()), syncFileItemStatus(item)); }
void Line::Add_Command_Clicked(QString projectLocation, QListWidget* list) { QList<QLineEdit *> lineEdits = this->CommandEditorWidget->findChildren<QLineEdit *>(); QString projectName = projectLocation.split('/').last(); projectName.chop(4); //very bad if we let the user overwrite the index file. In fact, if this occurs, it will load non-existant commands. //these commands then crash the program. if(lineEdits.at(0)->text().toLower() == "index"){ QMessageBox alert; alert.setText("Alert"); alert.setInformativeText("index is protected"); if(alert.exec()){ return; } } //make sure everything else is acceptable. if(projectName.isEmpty() || projectName.isNull()){ //creates a "Temp" folder to put things into until saved. if(!QDir("ProjectFiles/Temp").exists()){ QDir().mkdir("ProjectFiles/Temp"); } projectName = "Temp"; } lineEdits.at(0)->setDisabled(true); Line::removeExcessLines(); GuiLoadSave::writeCommandToFolder(projectLocation,this->CommandEditorWidget,list,commandAdded, "Line"); commandAdded = true; //sets the name and changes the tabname Line::setName(lineEdits.at(0)->text()); emit fileStatusChanged(); emit tell_Command_Added(-10); Line::removeExcessLines(); this->Add_Command->setText("Save"); this->close(); }
void SyncFileStatusTracker::slotSyncEngineRunningChanged() { emit fileStatusChanged(_syncEngine->localPath(), syncFileItemStatus(rootSyncFileItem())); }
void DocumentFile::setProposedFilename(QString filename) { Q_ASSERT(fileStatus() == FileStatus_NotCreated); d->filename = filename; emit fileStatusChanged(); }
/** * @brief slot to delete item from commandViewer */ void CommandViewer::DeleteCommand_clicked() { list->takeItem(list->currentRow()); emit fileStatusChanged(); }