Skip to content

Commit

Permalink
Adopt StorageTarget. For microsoft#109967
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Nov 5, 2020
1 parent c486bbf commit 4f88f44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/services/themes/browser/fileIconThemeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ExtensionData, IThemeExtensionPoint, IWorkbenchFileIconTheme } from 'vs
import { IFileService } from 'vs/platform/files/common/files';
import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages';
import { asCSSUrl } from 'vs/base/browser/dom';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';

export class FileIconThemeData implements IWorkbenchFileIconTheme {

Expand Down Expand Up @@ -156,7 +156,7 @@ export class FileIconThemeData implements IWorkbenchFileIconTheme {
extensionData: ExtensionData.toJSONObject(this.extensionData),
watch: this.watch
});
storageService.store(FileIconThemeData.STORAGE_KEY, data, StorageScope.GLOBAL);
storageService.store2(FileIconThemeData.STORAGE_KEY, data, StorageScope.GLOBAL, StorageTarget.MACHINE);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ExtensionData, IThemeExtensionPoint, IWorkbenchProductIconTheme } from
import { IFileService } from 'vs/platform/files/common/files';
import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages';
import { asCSSUrl } from 'vs/base/browser/dom';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
import { DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE } from 'vs/workbench/services/themes/common/themeConfiguration';
import { fontIdRegex, fontWeightRegex, fontStyleRegex } from 'vs/workbench/services/themes/common/productIconThemeSchema';
import { isString } from 'vs/base/common/types';
Expand Down Expand Up @@ -146,7 +146,7 @@ export class ProductIconThemeData implements IWorkbenchProductIconTheme {
watch: this.watch,
extensionData: ExtensionData.toJSONObject(this.extensionData),
});
storageService.store(ProductIconThemeData.STORAGE_KEY, data, StorageScope.GLOBAL);
storageService.store2(ProductIconThemeData.STORAGE_KEY, data, StorageScope.GLOBAL, StorageTarget.MACHINE);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as nls from 'vs/nls';
import * as types from 'vs/base/common/types';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IWorkbenchThemeService, IWorkbenchColorTheme, IWorkbenchFileIconTheme, ExtensionData, VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME, ThemeSettings, IWorkbenchProductIconTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { Registry } from 'vs/platform/registry/common/platform';
import * as errors from 'vs/base/common/errors';
Expand Down Expand Up @@ -192,7 +192,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
const preferredColorScheme = this.getPreferredColorScheme();
const prevScheme = this.storageService.get(PERSISTED_OS_COLOR_SCHEME, StorageScope.GLOBAL);
if (preferredColorScheme !== prevScheme) {
this.storageService.store(PERSISTED_OS_COLOR_SCHEME, preferredColorScheme, StorageScope.GLOBAL);
this.storageService.store2(PERSISTED_OS_COLOR_SCHEME, preferredColorScheme, StorageScope.GLOBAL, StorageTarget.USER);
if (preferredColorScheme && theme?.type !== preferredColorScheme) {
return this.applyPreferredColorTheme(preferredColorScheme);
}
Expand Down Expand Up @@ -344,7 +344,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
const scheme = this.getPreferredColorScheme();
const prevScheme = this.storageService.get(PERSISTED_OS_COLOR_SCHEME, StorageScope.GLOBAL);
if (scheme !== prevScheme) {
this.storageService.store(PERSISTED_OS_COLOR_SCHEME, scheme, StorageScope.GLOBAL);
this.storageService.store2(PERSISTED_OS_COLOR_SCHEME, scheme, StorageScope.GLOBAL, StorageTarget.MACHINE);
if (scheme) {
if (!prevScheme) {
// remember the theme before scheme switching
Expand Down

0 comments on commit 4f88f44

Please sign in to comment.