提交 41a42aeb 编写于 作者: B Benjamin Pasero

debt - make updating backupPath in environment more explicit

上级 9073a3cc
......@@ -86,11 +86,14 @@ export class SimpleNativeWorkbenchEnvironmentService implements INativeWorkbench
get userDataSyncLogResource(): URI { return joinPath(this.userRoamingDataHome, 'syncLog'); }
get userDataSyncHome(): URI { return joinPath(this.userRoamingDataHome, 'syncHome'); }
get tmpDir(): URI { return joinPath(this.userRoamingDataHome, 'tmp'); }
get backupWorkspaceHome(): URI { return joinPath(this.userRoamingDataHome, 'Backups', 'workspace'); }
get logsPath(): string { return joinPath(this.userRoamingDataHome, 'logs').path; }
get backupWorkspaceHome(): URI { return joinPath(this.userRoamingDataHome, 'Backups', 'workspace'); }
updateBackupPath(newPath: string | undefined): void { }
sessionId = this.configuration.sessionId;
machineId = this.configuration.machineId;
remoteAuthority = this.configuration.remoteAuthority;
filesToDiff = this.configuration.filesToDiff;
filesToOpenOrCreate = this.configuration.filesToOpenOrCreate;
......
......@@ -32,6 +32,7 @@ export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService
get userRoamingDataHome(): URI { return this.appSettingsHome.with({ scheme: Schemas.userData }); }
// Do NOT! memoize as `backupPath` can change in configuration
// via the `updateBackupPath` method below
get backupWorkspaceHome(): URI | undefined {
if (this.configuration.backupPath) {
return URI.file(this.configuration.backupPath).with({ scheme: this.userRoamingDataHome.scheme });
......@@ -40,6 +41,10 @@ export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService
return undefined;
}
updateBackupPath(newBackupPath: string | undefined): void {
this.configuration.backupPath = newBackupPath;
}
@memoize
get logFile(): URI { return URI.file(join(this.logsPath, `renderer${this.configuration.windowId}.log`)); }
......
......@@ -33,6 +33,9 @@ export interface INativeWorkbenchEnvironmentService extends IWorkbenchEnvironmen
readonly log?: string;
readonly extHostLogsPath: URI;
// TODO@sbatten this should be retrieved somehow differently
// TODO@sbatten TODO@ben this should be retrieved somehow differently
readonly windowMaximizedInitially?: boolean;
// TODO@ben this is a bit ugly
updateBackupPath(newPath: string | undefined): void;
}
......@@ -170,7 +170,7 @@ export class NativeWorkspaceEditingService extends AbstractWorkspaceEditingServi
await this.migrateStorage(result.workspace);
// Reinitialize backup service
this.environmentService.configuration.backupPath = result.backupPath;
this.environmentService.updateBackupPath(result.backupPath);
if (this.backupFileService instanceof BackupFileService) {
this.backupFileService.reinitialize();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册