| 209 | } |
| 210 | |
| 211 | bool SyncthingModels::loadIgnorePatterns(const QString &dirId, QObject *textArea) |
| 212 | { |
| 213 | auto res = m_connection.ignores(dirId, [this, textArea](Data::SyncthingIgnores &&ignores, QString &&error) { |
| 214 | if (!error.isEmpty()) { |
| 215 | emit this->error(tr("Unable to load ignore patterns: ") + error); |
| 216 | } |
| 217 | textArea->setProperty("text", ignores.ignore.join(QChar('\n'))); |
| 218 | textArea->setProperty("enabled", true); |
| 219 | }); |
| 220 | connect(textArea, &QObject::destroyed, res.reply, &QNetworkReply::deleteLater); |
| 221 | connect(this, &QObject::destroyed, [connection = res.connection] { disconnect(connection); }); |
| 222 | return true; |
| 223 | } |
| 224 | |
| 225 | bool SyncthingModels::saveIgnorePatterns(const QString &dirId, QObject *textArea) |
| 226 | { |