1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2025-05-10 17:34:09 +02:00

Merge pull request from nextcloud/bugfix/popup-empty-folder

Uses configuraion to determine if it should show empty folder popup.
This commit is contained in:
Camila Ayres 2019-04-12 16:38:51 +02:00 committed by GitHub
commit ac6ef500cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -750,7 +750,7 @@ void ConfigFile::setMoveToTrash(bool isChecked)
bool ConfigFile::promptDeleteFiles() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(promptDeleteC), true).toBool();
return settings.value(QLatin1String(promptDeleteC), false).toBool();
}
void ConfigFile::setPromptDeleteFiles(bool promptDeleteFiles)

View File

@ -26,6 +26,8 @@
#include "propagateremotedelete.h"
#include "propagatedownload.h"
#include "common/asserts.h"
#include "configfile.h"
#ifdef Q_OS_WIN
#include <windows.h>
@ -1035,7 +1037,8 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult)
}
}
if (!_hasNoneFiles && _hasRemoveFile) {
ConfigFile cfgFile;
if (!_hasNoneFiles && _hasRemoveFile && cfgFile.promptDeleteFiles()) {
qCInfo(lcEngine) << "All the files are going to be changed, asking the user";
bool cancel = false;
emit aboutToRemoveAllFiles(syncItems.first()->_direction, &cancel);

View File

@ -8,6 +8,7 @@
#include <QtTest>
#include "syncenginetestutils.h"
#include <syncengine.h>
#include <configfile.h>
using namespace OCC;
@ -48,6 +49,8 @@ private slots:
{
QFETCH(bool, deleteOnRemote);
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
ConfigFile config;
config.setPromptDeleteFiles(true);
//Just set a blacklist so we can check it is still there. This directory does not exists but
// that does not matter for our purposes.