Fix compilation after merge of the confirm and the new-ui branch

This commit is contained in:
Olivier Goffart 2015-06-10 16:22:14 +02:00
parent 139b28b471
commit e9e11d251f
7 changed files with 12 additions and 12 deletions

View File

@ -188,11 +188,12 @@ void AccountSettings::slotFolderWizardAccepted()
definition.alias = folderWizard->field(QLatin1String("alias")).toString();
definition.localPath = folderWizard->field(QLatin1String("sourceFolder")).toString();
definition.targetPath = folderWizard->property("targetPath").toString();
definition.selectiveSyncBlackList = folderWizard->property("selectiveSyncBlackList").toStringList();
auto selectiveSyncBlackList = folderWizard->property("selectiveSyncBlackList").toStringList();
Folder *f = folderMan->addFolder(_accountState, definition);
folderMan->setSyncEnabled(true);
if( f ) {
f->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, selectiveSyncBlackList);
folderMan->setSyncEnabled(true);
folderMan->slotScheduleAllFolders();
emit folderChanged();
}

View File

@ -1026,7 +1026,6 @@ void FolderDefinition::save(QSettings& settings, const FolderDefinition& folder)
settings.beginGroup(folder.alias);
settings.setValue(QLatin1String("localPath"), folder.localPath);
settings.setValue(QLatin1String("targetPath"), folder.targetPath);
settings.setValue(QLatin1String("blackList"), folder.selectiveSyncBlackList);
settings.setValue(QLatin1String("paused"), folder.paused);
settings.endGroup();
}
@ -1038,7 +1037,6 @@ bool FolderDefinition::load(QSettings& settings, const QString& alias,
folder->alias = alias;
folder->localPath = settings.value(QLatin1String("localPath")).toString();
folder->targetPath = settings.value(QLatin1String("targetPath")).toString();
folder->selectiveSyncBlackList = settings.value(QLatin1String("blackList")).toStringList();
folder->paused = settings.value(QLatin1String("paused")).toBool();
settings.endGroup();
return true;

View File

@ -57,8 +57,6 @@ public:
QString localPath;
/// path on remote
QString targetPath;
/// Which folders not to sync
QStringList selectiveSyncBlackList;
/// whether the folder is paused
bool paused;

View File

@ -387,7 +387,6 @@ Folder* FolderMan::setupFolderFromOldConfigFile(const QString &file, AccountStat
folderDefinition.alias = alias;
folderDefinition.localPath = path;
folderDefinition.targetPath = targetPath;
folderDefinition.selectiveSyncBlackList = blackList;
folder = new Folder( accountState, folderDefinition, this );
qDebug() << "Adding folder to Folder Map " << folder;
_folderMap[alias] = folder;

View File

@ -417,7 +417,7 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list_)
newInfo._checked = Qt::Unchecked;
} else {
auto *f = _folders.at(parentInfo->_pathIdx.first())._folder;
foreach(const QString &str , f->selectiveSyncBlackList()) {
foreach(const QString &str , f->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList)) {
if (str == path || str == QLatin1String("/")) {
newInfo._checked = Qt::Unchecked;
break;
@ -507,9 +507,9 @@ void FolderStatusModel::slotApplySelectiveSync()
if (!_folders[i]._fetched) continue;
auto folder = _folders.at(i)._folder;
auto oldBlackList = folder->selectiveSyncBlackList();
auto oldBlackList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList);
QStringList blackList = createBlackList(&_folders[i], oldBlackList);
folder->setSelectiveSyncBlackList(blackList);
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blackList);
FolderMan *folderMan = FolderMan::instance();
auto blackListSet = blackList.toSet();

View File

@ -486,8 +486,11 @@ void OwncloudSetupWizard::slotAssistantFinished( int result )
}
folderDefinition.localPath = localFolder;
folderDefinition.targetPath = _remoteFolder;
folderDefinition.selectiveSyncBlackList = _ocWizard->selectiveSyncBlacklist();
folderMan->addFolder(account, folderDefinition);
auto f = folderMan->addFolder(account, folderDefinition);
if (f) {
f->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList,
_ocWizard->selectiveSyncBlacklist());
}
_ocWizard->appendToConfigurationLog(tr("<font color=\"green\"><b>Local sync folder %1 successfully created!</b></font>").arg(localFolder));
}
}

View File

@ -1300,6 +1300,7 @@ void SyncJournalDb::setSelectiveSyncList(SyncJournalDb::SelectiveSyncListType ty
SqlQuery insQuery("INSERT INTO selectivesync VALUES (?1, ?2)" , _db);
foreach(const auto &path, list) {
insQuery.reset();
insQuery.bindValue(1, path);
insQuery.bindValue(2, int(type));
if (!insQuery.exec()) {