Tell NSWorkspace to note the proper file path changed in PcsxrPluginHandler.

Store the full path in PcsxrPlugin to check against in verifyOK function.

git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@73440 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
SND\MaddTheSane_cp 2011-12-17 21:44:51 +00:00
parent a603862e8d
commit 7264f33c12
3 changed files with 6 additions and 4 deletions

View File

@ -15,6 +15,7 @@
NSString *path;
NSDate *modDate;
NSString *name;
NSString *fullPlugPath;
long version;
int type;
int active;

View File

@ -154,6 +154,7 @@
// save the current modification date
NSDictionary *fattrs = [[NSFileManager defaultManager] attributesOfItemAtPath:[goodPath stringByResolvingSymlinksInPath] error:NULL];
modDate = [[fattrs fileModificationDate] retain];
fullPlugPath = [goodPath retain];
active = 0;
@ -176,6 +177,7 @@
[modDate release];
[path release];
[name release];
[fullPlugPath release];
[super dealloc];
}
@ -328,11 +330,10 @@
{
// check that the file is still there with the same modification date
NSFileManager *dfm = [NSFileManager defaultManager];
NSString *fullPath = [[dfm stringWithFileSystemRepresentation:Config.PluginsDir length:strlen(Config.PluginsDir)] stringByAppendingPathComponent:path];
if (![dfm fileExistsAtPath:fullPath])
if (![dfm fileExistsAtPath:fullPlugPath])
return NO;
NSDictionary *fattrs = [dfm attributesOfItemAtPath:[fullPath stringByResolvingSymlinksInPath] error:NULL];
NSDictionary *fattrs = [dfm attributesOfItemAtPath:[fullPlugPath stringByResolvingSymlinksInPath] error:NULL];
return [[fattrs fileModificationDate] isEqualToDate:modDate];
}

View File

@ -67,7 +67,7 @@
[url path],
[wrapper filename]];
if ([wrapper writeToFile:dst atomically:NO updateFilenames:NO]) {
[[NSWorkspace sharedWorkspace] noteFileSystemChanged:[[NSBundle mainBundle] builtInPlugInsPath]];
[[NSWorkspace sharedWorkspace] noteFileSystemChanged:[url path]];
NSRunInformationalAlertPanel(NSLocalizedString(@"Installation Succesfull", nil),
NSLocalizedString(@"The installation of the specified plugin was succesfull. In order to use it, please restart the application.", nil),
nil, nil, nil);