|
|
@@ -27,28 +27,25 @@ class Preferences {
|
|
|
this._prefs.recentProjects.splice(index, 1);
|
|
|
}
|
|
|
this._prefs.recentProjects.unshift(path);
|
|
|
- this.updateRecentProjects();
|
|
|
+ this.updateRecentProjects(true);
|
|
|
}
|
|
|
|
|
|
- unRegisterRecentProject(path: string): void {
|
|
|
- var index = this._prefs.recentProjects.indexOf(path);
|
|
|
- if (index >= 0) {
|
|
|
- this._prefs.recentProjects.splice(index, 1);
|
|
|
- }
|
|
|
- this.updateRecentProjects();
|
|
|
- }
|
|
|
+ updateRecentProjects(write:boolean = false): void {
|
|
|
|
|
|
- updateRecentProjects(): void {
|
|
|
for (var i in this._prefs.recentProjects) {
|
|
|
var path = this._prefs.recentProjects[i];
|
|
|
if (!this.fileSystem.exists(path)) {
|
|
|
this._prefs.recentProjects.splice(i, 1);
|
|
|
+ write = true;
|
|
|
}
|
|
|
}
|
|
|
+ if (write)
|
|
|
+ this.write();
|
|
|
}
|
|
|
|
|
|
deleteRecentProjects(): void {
|
|
|
this._prefs.recentProjects.length = 0;
|
|
|
+ this.write();
|
|
|
}
|
|
|
|
|
|
getPreferencesFullPath(): string {
|