Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/stable 3.13/cfapi #6820

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/gui/accountsettings.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/gui/accountsettings.cpp

File src/gui/accountsettings.cpp does not conform to Custom style guidelines. (lines 1200)
* Copyright (C) by Daniel Molkentin <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -672,6 +672,7 @@
if (!folderPaused) {
ac = menu->addAction(tr("Force sync now"));
if (folder && folder->isSyncRunning()) {
qCWarning(lcAccountSettings) << "=> Restart syncing for" << selectedFolderAlias();
ac->setText(tr("Restart sync"));
}
ac->setEnabled(folderConnected);
Expand Down Expand Up @@ -1139,6 +1140,7 @@

void AccountSettings::slotEnableCurrentFolder(bool terminate)
{
qCWarning(lcAccountSettings) << "=> User!! resuming or pausing sync: terminate value is" << terminate;
const auto alias = selectedFolderAlias();

if (!alias.isEmpty()) {
Expand Down Expand Up @@ -1195,8 +1197,9 @@

void AccountSettings::slotScheduleCurrentFolderForceRemoteDiscovery()
{
const auto folderMan = FolderMan::instance();
const auto folderMan = FolderMan::instance();

Check warning on line 1200 in src/gui/accountsettings.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/accountsettings.cpp:1200:5 [readability-qualified-auto]

'const auto folderMan' can be declared as 'auto *const folderMan'
if (auto folder = folderMan->folder(selectedFolderAlias())) {
qCWarning(lcAccountSettings) << "=> Schedule current folder" << selectedFolderAlias() << "RemoteDiscovery";
folder->slotWipeErrorBlacklist();
folder->journalDb()->forceRemoteDiscoveryNextSync();
folderMan->scheduleFolder(folder);
Expand All @@ -1207,6 +1210,7 @@
{
FolderMan *folderMan = FolderMan::instance();
auto selectedFolder = folderMan->folder(selectedFolderAlias());
qCWarning(lcAccountSettings) << "=> Force syncing for" << selectedFolderAlias();
folderMan->forceSyncForFolder(selectedFolder);
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ void Application::slotAccountStateAdded(AccountState *accountState)

void Application::slotCleanup()
{
qCWarning(lcApplication) << "=> User!! Application is about to quite/close!!";
AccountManager::instance()->save();
FolderMan::instance()->unloadAndDeleteAllFolders();

Expand Down
2 changes: 2 additions & 0 deletions src/gui/connectionvalidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* for more details.
*/

#include <QJsonDocument>

Check failure on line 15 in src/gui/connectionvalidator.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/connectionvalidator.cpp:15:10 [clang-diagnostic-error]

'QJsonDocument' file not found
#include <QJsonObject>
#include <QJsonArray>
#include <QLoggingCategory>
Expand Down Expand Up @@ -207,6 +207,8 @@
auto job = qobject_cast<PropfindJob *>(sender());
Status stat = Timeout;

qCWarning(lcConnectionValidator) << "=> reply->error():" << reply->error() << "- job->errorString():" << job->errorString();

if (reply->error() == QNetworkReply::SslHandshakeFailedError) {
_errors << job->errorStringParsingBody();
stat = SslError;
Expand Down
2 changes: 2 additions & 0 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "common/syncjournaldb.h"

Check failure on line 16 in src/gui/folder.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/folder.cpp:16:10 [clang-diagnostic-error]

'common/syncjournaldb.h' file not found
#include "config.h"

#include "account.h"
Expand Down Expand Up @@ -361,6 +361,8 @@
{
// re-enable sync if it was disabled because network was down
FolderMan::instance()->setSyncEnabled(true);
qCInfo(lcFolder) << "=> Etag retrieved: last:" << _lastEtag << ", received:" << etag;
qCInfo(lcFolder) << "=> For folder:" << _canonicalLocalPath;

if (_lastEtag != etag) {
qCInfo(lcFolder) << "Compare etag with previous etag: last:" << _lastEtag << ", received:" << etag << "-> CHANGED";
Expand Down
6 changes: 5 additions & 1 deletion src/gui/folderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ void FolderMan::forceSyncForFolder(Folder *folder)
// Terminate and reschedule any running sync
for (const auto folderInMap : map()) {
if (folderInMap->isSyncRunning()) {
qCWarning(lcFolderMan) << "=> User!! Terminating syncing for" << folderInMap->path();
folderInMap->slotTerminateSync();
scheduleFolder(folderInMap);
}
Expand All @@ -679,7 +680,7 @@ void FolderMan::removeE2eFiles(const AccountPtr &account) const
void FolderMan::slotScheduleAppRestart()
{
_appRestartRequired = true;
qCInfo(lcFolderMan) << "Application restart requested!";
qCInfo(lcFolderMan) << "=> Application restart requested!";
}

void FolderMan::slotSyncOnceFileUnlocks(const QString &path)
Expand Down Expand Up @@ -1339,6 +1340,7 @@ void FolderMan::removeFolder(Folder *f)
const bool currentlyRunning = f->isSyncRunning();
if (currentlyRunning) {
// abort the sync now
qCWarning(lcFolderMan) << "=> User?? Abort syncing for" << f->path();
f->slotTerminateSync();
}

Expand Down Expand Up @@ -1929,6 +1931,8 @@ Folder *FolderMan::currentSyncFolder() const

void FolderMan::restartApplication()
{
qCInfo(lcFolderMan) << "Restarting application NOW!!";

if (Utility::isLinux()) {
// restart:
qCInfo(lcFolderMan) << "Restarting application NOW, PID" << qApp->applicationPid() << "is ending.";
Expand Down
11 changes: 11 additions & 0 deletions src/gui/folderstatusdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,17 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
painter->setFont(progressFont);

painter->drawText(QStyle::visualRect(option.direction, option.rect, overallProgressRect), Qt::AlignLeft | Qt::AlignVCenter, overallString);

// More detailed sync progress
QRect itemStringRect;
itemStringRect.setTop(overallProgressRect.bottom());
itemStringRect.setHeight(fileNameTextHeight);
itemStringRect.setLeft(overallProgressRect.left());
itemStringRect.setWidth(overallProgressRect.width());
painter->setFont(progressFont);

painter->drawText(QStyle::visualRect(option.direction, option.rect, itemStringRect), Qt::AlignLeft | Qt::AlignVCenter, itemString);

painter->restore();
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ void ownCloudGui::slotShutdown()
{
// explicitly close windows. This is somewhat of a hack to ensure
// that saving the geometries happens ASAP during a OS shutdown
qCWarning(lcApplication) << "=> Shutting down!!";

// those do delete on close
if (!_settingsDialog.isNull())
Expand Down
2 changes: 2 additions & 0 deletions src/gui/systray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,13 @@ void Systray::slotUpdateSyncPausedState()

void Systray::slotUnpauseAllFolders()
{
qCWarning(lcSystray) << "=> User!! Resume/unpause syncing all folders!!";
setPauseOnAllFoldersHelper(false);
}

void Systray::slotPauseAllFolders()
{
qCWarning(lcSystray) << "=> User!! Pause syncing all folders!!";
setPauseOnAllFoldersHelper(true);
}

Expand Down
3 changes: 3 additions & 0 deletions src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "notificationhandler.h"

Check notice on line 1 in src/gui/tray/usermodel.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/gui/tray/usermodel.cpp

File src/gui/tray/usermodel.cpp does not conform to Custom style guidelines. (lines 40)
#include "usermodel.h"

#include "accountmanager.h"
Expand Down Expand Up @@ -36,6 +36,8 @@
}

namespace OCC {

Q_LOGGING_CATEGORY(lcUserModel, "nextcloud.gui.usermodel", QtInfoMsg)

Check warning on line 40 in src/gui/tray/usermodel.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/tray/usermodel.cpp:40:1 [cppcoreguidelines-avoid-non-const-global-variables]

variable 'Q_LOGGING_CATEGORY' is non-const and globally accessible, consider making it const

TrayFolderInfo::TrayFolderInfo(const QString &name, const QString &parentPath, const QString &fullPath, FolderType folderType)
: _name(name)
Expand Down Expand Up @@ -1099,6 +1101,7 @@

void User::forceSyncNow() const
{
qCWarning(lcUserModel) << "=> Force sync now for" << getFolder()->path();
FolderMan::instance()->forceSyncForFolder(getFolder());
}

Expand Down
2 changes: 2 additions & 0 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,8 @@ void ProcessDirectoryJob::startAsyncLocalQuery()
QString localPath = _discoveryData->_localDir + _currentFolder._local;
auto localJob = new DiscoverySingleLocalDirectoryJob(_discoveryData->_account, localPath, _discoveryData->_syncOptions._vfs.data());

qCWarning(lcDisco) << "=> ProcessDirectoryJob::startAsyncLocalQuery: localPath:" << localPath;

_discoveryData->_currentlyActiveJobs++;
_pendingAsyncJobs++;

Expand Down
7 changes: 7 additions & 0 deletions src/libsync/discoveryphase.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/libsync/discoveryphase.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/libsync/discoveryphase.cpp

File src/libsync/discoveryphase.cpp does not conform to Custom style guidelines. (lines 83, 283, 284)
* Copyright (C) by Olivier Goffart <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -80,6 +80,7 @@
<< "http://owncloud.org/ns:size");

connect(propfindJob, &PropfindJob::finishedWithError, this, [=] {
qCWarning(lcDiscovery) << "=> propfindJob->reply()->error():" << propfindJob->reply()->error() << "- propfindJob->reply()->errorString():" << propfindJob->reply()->errorString();
return completionCallback(false);
});
connect(propfindJob, &PropfindJob::result, this, [=](const QVariantMap &values) {
Expand Down Expand Up @@ -228,8 +229,10 @@
void DiscoveryPhase::startJob(ProcessDirectoryJob *job)
{
ENFORCE(!_currentRootJob);
qCWarning(lcDiscovery) << "=> DiscoveryPhase::startJob for:" << job->_dirItem;
connect(this, &DiscoveryPhase::itemDiscovered, this, &DiscoveryPhase::slotItemDiscovered, Qt::UniqueConnection);
connect(job, &ProcessDirectoryJob::finished, this, [this, job] {
qCWarning(lcDiscovery) << "=> ProcessDirectoryJob::finished for" << job->_dirItem;
ENFORCE(_currentRootJob == sender());
_currentRootJob = nullptr;
if (job->_dirItem)
Expand Down Expand Up @@ -276,6 +279,10 @@

void DiscoveryPhase::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
{
qCWarning(lcDiscovery) << "=> DiscoveryPhase::slotItemDiscovered:"
<< "| item->_file:" << item->_file
<< "| item->_direction:" << item->_direction
<< "| item->_instruction:" << item->_instruction;
if (item->_instruction == CSYNC_INSTRUCTION_ERROR && item->_direction == SyncFileItem::Up) {
_hasUploadErrorItems = true;
}
Expand Down
6 changes: 4 additions & 2 deletions src/libsync/networkjobs.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/libsync/networkjobs.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/libsync/networkjobs.cpp

File src/libsync/networkjobs.cpp does not conform to Custom style guidelines. (lines 1275)
* Copyright (C) by Klaas Freitag <[email protected]>
* Copyright (C) by Daniel Molkentin <[email protected]>
*
Expand All @@ -13,7 +13,7 @@
* for more details.
*/

#include <QJsonDocument>

Check failure on line 16 in src/libsync/networkjobs.cpp

View workflow job for this annotation

GitHub Actions / build

src/libsync/networkjobs.cpp:16:10 [clang-diagnostic-error]

'QJsonDocument' file not found
#include <QLoggingCategory>
#include <QNetworkRequest>
#include <QNetworkAccessManager>
Expand Down Expand Up @@ -669,6 +669,7 @@

if (!domDocument.setContent(reply(), true, &errorMsg, &errorLine, &errorColumn)) {
qCWarning(lcPropfindJob) << "XML parser error: " << errorMsg << errorLine << errorColumn;
qCWarning(lcPropfindJob) << "=> reply()->error():" << reply()->error() << "- reply()->errorString():" << reply()->errorString();
emit finishedWithError(reply());

} else {
Expand All @@ -679,6 +680,7 @@
} else {
qCWarning(lcPropfindJob) << "*not* successful, http result code is" << http_result_code
<< (http_result_code == 302 ? reply()->header(QNetworkRequest::LocationHeader).toString() : QLatin1String(""));
qCWarning(lcPropfindJob) << "=> reply()->error():" << reply()->error() << "- reply()->errorString():" << reply()->errorString();
emit finishedWithError(reply());
}

Expand Down Expand Up @@ -1270,8 +1272,8 @@
targetFun(oldUrl);
}
});
QObject::connect(job, &PropfindJob::finishedWithError, target, [=](QNetworkReply *) {
targetFun(oldUrl);
QObject::connect(job, &PropfindJob::finishedWithError, target, [=](QNetworkReply * reply) {
qCWarning(lcPropfindJob) << "=> reply->error():" << reply->error() << "- job->errorString():" << job->errorString();
});
job->start();
}
Expand Down
5 changes: 3 additions & 2 deletions src/libsync/propagatedownload.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/libsync/propagatedownload.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/libsync/propagatedownload.cpp

File src/libsync/propagatedownload.cpp does not conform to Custom style guidelines. (lines 332, 1135)
* Copyright (C) by Olivier Goffart <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -12,7 +12,7 @@
* for more details.
*/

#include "config.h"

Check failure on line 15 in src/libsync/propagatedownload.cpp

View workflow job for this annotation

GitHub Actions / build

src/libsync/propagatedownload.cpp:15:10 [clang-diagnostic-error]

'config.h' file not found
#include "owncloudpropagator_p.h"
#include "propagatedownload.h"
#include "networkjobs.h"
Expand Down Expand Up @@ -329,7 +329,7 @@
}

if (reply()->isFinished() && (reply()->bytesAvailable() == 0 || !_saveBodyToFile)) {
qCDebug(lcGetJob) << "Actually finished!";
qCDebug(lcGetJob) << "Get file job finished bytesAvailable/_saveBodyToFile:" << reply()->bytesAvailable() << "/" << _saveBodyToFile ;
if (_bandwidthManager) {
_bandwidthManager->unregisterDownloadJob(this);
}
Expand Down Expand Up @@ -1132,7 +1132,8 @@
SyncJournalFileRecord record;
if (_item->_instruction != CSYNC_INSTRUCTION_CONFLICT && FileSystem::fileExists(localFilePath)
&& (propagator()->_journal->getFileRecord(_item->_file, &record) && record.isValid())
&& (record._modtime == _item->_modtime && record._etag != _item->_etag)) {
&& (record._modtime == _item->_modtime && record._etag != _item->_etag)
&& _item->_type == ItemTypeFile) {
const auto computeChecksum = new ComputeChecksum(this);
computeChecksum->setChecksumType(checksumType);
connect(computeChecksum, &ComputeChecksum::done, this, &PropagateDownloadFile::localFileContentChecksumComputed);
Expand Down
1 change: 1 addition & 0 deletions src/libsync/propagateremotemkdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ void PropagateRemoteMkdir::finalizeMkColJob(QNetworkReply::NetworkError err, con
});
connect(propfindJob, &PropfindJob::finishedWithError, this, [this] (QNetworkReply *reply) {
const auto err = reply ? reply->error() : QNetworkReply::NetworkError::UnknownNetworkError;
qCWarning(lcPropagateRemoteMkdir) << "=> reply->error():" << reply->error() << "- propfindJob->errorString():" << reply->errorString();
propagator()->_activeJobList.removeOne(this);
done(SyncFileItem::NormalError, {}, errorCategoryFromNetworkError(err));
});
Expand Down
1 change: 1 addition & 0 deletions src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ void SyncEngine::startSync()
connect(_discoveryPhase.data(), &DiscoveryPhase::existingFolderNowBig, this, &SyncEngine::existingFolderNowBig);
connect(_discoveryPhase.data(), &DiscoveryPhase::fatalError, this, [this](const QString &errorString, ErrorCategory errorCategory) {
Q_EMIT syncError(errorString, errorCategory);
qCWarning(lcEngine) << "=> SyncEngine DiscoveryPhase::fatalError emitted:" << errorString;
finalize(false);
});
connect(_discoveryPhase.data(), &DiscoveryPhase::finished, this, &SyncEngine::slotDiscoveryFinished);
Expand Down
Loading
Loading