diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 2ac67f6adce53..d6cabecde2040 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -650,6 +650,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos) 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); @@ -1117,6 +1118,7 @@ void AccountSettings::showConnectionLabel(const QString &message, QStringList er void AccountSettings::slotEnableCurrentFolder(bool terminate) { + qCWarning(lcAccountSettings) << "=> User!! resuming or pausing sync: terminate value is" << terminate; const auto alias = selectedFolderAlias(); if (!alias.isEmpty()) { @@ -1173,8 +1175,9 @@ void AccountSettings::slotScheduleCurrentFolder() void AccountSettings::slotScheduleCurrentFolderForceRemoteDiscovery() { - const auto folderMan = FolderMan::instance(); + const auto folderMan = FolderMan::instance(); if (auto folder = folderMan->folder(selectedFolderAlias())) { + qCWarning(lcAccountSettings) << "=> Schedule current folder" << selectedFolderAlias() << "RemoteDiscovery"; folder->slotWipeErrorBlacklist(); folder->journalDb()->forceRemoteDiscoveryNextSync(); folderMan->scheduleFolder(folder); @@ -1185,6 +1188,7 @@ void AccountSettings::slotForceSyncCurrentFolder() { FolderMan *folderMan = FolderMan::instance(); auto selectedFolder = folderMan->folder(selectedFolderAlias()); + qCWarning(lcAccountSettings) << "=> Force syncing for" << selectedFolderAlias(); folderMan->forceSyncForFolder(selectedFolder); } diff --git a/src/gui/application.cpp b/src/gui/application.cpp index ab866ba4ff099..c267e9cea4ee7 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -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(); diff --git a/src/gui/connectionvalidator.cpp b/src/gui/connectionvalidator.cpp index e39d523a48bd0..3a8f6fce0cc15 100644 --- a/src/gui/connectionvalidator.cpp +++ b/src/gui/connectionvalidator.cpp @@ -207,6 +207,8 @@ void ConnectionValidator::slotAuthFailed(QNetworkReply *reply) auto job = qobject_cast(sender()); Status stat = Timeout; + qCWarning(lcConnectionValidator) << "=> reply->error():" << reply->error() << "- job->errorString():" << job->errorString(); + if (reply->error() == QNetworkReply::SslHandshakeFailedError) { _errors << job->errorStringParsingBody(); stat = SslError; diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index d7c5fbac54bc9..59233cc1993f7 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -361,6 +361,8 @@ void Folder::etagRetrieved(const QByteArray &etag, const QDateTime &tp) { // 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"; diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index ffced3a51ccc0..46ee9e5cb9fcf 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -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); } @@ -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) @@ -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(); } @@ -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."; diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index 6749df8a6e91b..7b64b48da2ecc 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -592,6 +592,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()) diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index d4ca0bae94637..b3d5a77733377 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -447,11 +447,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); } diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index 7cb3b08e7afa7..e2f2311f81fd6 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -36,6 +36,8 @@ constexpr qint64 activityDefaultExpirationTimeMsecs = 1000 * 60 * 10; } namespace OCC { + +Q_LOGGING_CATEGORY(lcUserModel, "nextcloud.gui.usermodel", QtInfoMsg) TrayFolderInfo::TrayFolderInfo(const QString &name, const QString &parentPath, const QString &fullPath, FolderType folderType) : _name(name) @@ -1099,6 +1101,7 @@ void User::slotSendReplyMessage(const int activityIndex, const QString &token, c void User::forceSyncNow() const { + qCWarning(lcUserModel) << "=> Force sync now for" << getFolder()->path(); FolderMan::instance()->forceSyncForFolder(getFolder()); } diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index ccfb0c25f982e..a8af29ba452f6 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -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++; diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 33516635d9384..d74b31a33dda4 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -80,6 +80,7 @@ void DiscoveryPhase::checkFolderSizeLimit(const QString &path, const std::functi << "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) { @@ -228,8 +229,10 @@ void DiscoveryPhase::enqueueDirectoryToDelete(const QString &path, ProcessDirect 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) @@ -276,6 +279,10 @@ void DiscoveryPhase::scheduleMoreJobs() 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; } diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index 700afb41741f5..a57423068ee49 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -669,6 +669,7 @@ bool PropfindJob::finished() 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 { @@ -679,6 +680,7 @@ bool PropfindJob::finished() } 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()); } @@ -1270,8 +1272,8 @@ void fetchPrivateLinkUrl(AccountPtr account, const QString &remotePath, 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(); } diff --git a/src/libsync/propagateremotemkdir.cpp b/src/libsync/propagateremotemkdir.cpp index e301beed5a723..e03daf7a2171f 100644 --- a/src/libsync/propagateremotemkdir.cpp +++ b/src/libsync/propagateremotemkdir.cpp @@ -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)); }); diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 7026fd3ce3ec6..ec53dd779f5d0 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -679,6 +679,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);