Migrate legacy volumeSettings to Global.tmProperties

This commit is contained in:
Allan Odgaard
2016-10-11 10:32:03 +02:00
parent 377d84ec94
commit 97e9b8fd1d

View File

@@ -23,6 +23,7 @@
#import <document/OakDocumentController.h>
#import <bundles/query.h>
#import <io/path.h>
#import <regexp/glob.h>
#import <network/tbz.h>
#import <ns/ns.h>
#import <license/license.h>
@@ -224,6 +225,21 @@ BOOL HasDocumentWindow (NSArray* windows)
}];
RegisterDefaults();
// LEGACY format used prior to 2.0-beta.12.23
if(NSDictionary* volumeSettings = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"volumeSettings"])
{
for(NSString* pathPrefix in volumeSettings)
{
id setting = volumeSettings[pathPrefix][@"extendedAttributes"];
if(setting && [setting boolValue] == NO)
{
std::string const glob = path::glob_t::escape(to_s(pathPrefix)) + "**";
settings_t::set(kSettingsDisableExtendedAttributesKey, true, NULL_STR, glob);
}
}
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"volumeSettings"];
}
[[TMPlugInController sharedInstance] loadAllPlugIns:nil];
std::string dest = path::join(path::home(), "Library/Application Support/TextMate/Managed");