mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Let recursive removal also remove the top dir.
This commit is contained in:
parent
599451d250
commit
c5e435f9bd
@ -381,19 +381,21 @@ bool SyncJournalDb::deleteFileRecord(const QString& filename, bool recursively)
|
||||
QMutexLocker locker(&_mutex);
|
||||
|
||||
if( checkConnect() ) {
|
||||
if (!recursively) {
|
||||
qlonglong phash = getPHash(filename);
|
||||
_deleteFileRecordPhash->bindValue( 0, QString::number(phash) );
|
||||
// if (!recursively) {
|
||||
// always delete the actual file.
|
||||
|
||||
if( !_deleteFileRecordPhash->exec() ) {
|
||||
qWarning() << "Exec error of SQL statement: "
|
||||
<< _deleteFileRecordPhash->lastQuery()
|
||||
<< " : " << _deleteFileRecordPhash->lastError().text();
|
||||
return false;
|
||||
}
|
||||
qDebug() << _deleteFileRecordPhash->executedQuery() << phash << filename;
|
||||
_deleteFileRecordPhash->finish();
|
||||
} else {
|
||||
qlonglong phash = getPHash(filename);
|
||||
_deleteFileRecordPhash->bindValue( 0, QString::number(phash) );
|
||||
|
||||
if( !_deleteFileRecordPhash->exec() ) {
|
||||
qWarning() << "Exec error of SQL statement: "
|
||||
<< _deleteFileRecordPhash->lastQuery()
|
||||
<< " : " << _deleteFileRecordPhash->lastError().text();
|
||||
return false;
|
||||
}
|
||||
qDebug() << _deleteFileRecordPhash->executedQuery() << phash << filename;
|
||||
_deleteFileRecordPhash->finish();
|
||||
if( recursively) {
|
||||
_deleteFileRecordRecursively->bindValue(0, filename);
|
||||
if( !_deleteFileRecordRecursively->exec() ) {
|
||||
qWarning() << "Exec error of SQL statement: "
|
||||
|
||||
Loading…
Reference in New Issue
Block a user