Skip to content

Commit

Permalink
Directly bundle macOS vfs logs within standard debug archive
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Nov 5, 2024
1 parent a255c1f commit 9a6b167
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

#include "generalsettings.h"
#include "macOS/fileprovider.h"
#include "ui_generalsettings.h"

#include "theme.h"
Expand All @@ -31,6 +32,10 @@
#endif
#endif

#ifdef BUILD_FILE_PROVIDER_MODULE
#include "macOS/fileprovidersettingscontroller.h"
#endif

#include "ignorelisteditor.h"
#include "common/utility.h"
#include "logger.h"
Expand Down Expand Up @@ -113,6 +118,23 @@ QVector<ZipEntry> createDebugArchiveFileList()
std::copy(std::cbegin(newEntries), std::cend(newEntries), std::back_inserter(list));
});

#ifdef BUILD_FILE_PROVIDER_MODULE

const auto fileProvider = OCC::Mac::FileProvider::instance();
if (fileProvider && fileProvider->fileProviderAvailable()) {
const auto tempDir = QTemporaryDir();
const auto xpc = fileProvider->xpc();
const auto vfsAccounts = OCC::Mac::FileProviderSettingsController::instance()->vfsEnabledAccounts();
for (const auto &accountUserIdAtHost : vfsAccounts) {
const auto vfsLogFilename = QStringLiteral("macOS_vfs_%1.log").arg(accountUserIdAtHost);
const auto vfsLogPath = tempDir.filePath(vfsLogFilename);
xpc->createDebugArchiveForExtension(accountUserIdAtHost, vfsLogPath);
list.append(fileInfoToZipEntry(QFileInfo(vfsLogPath)));
}
}

#endif

return list;
}

Expand Down

0 comments on commit 9a6b167

Please sign in to comment.