Skip to content

Commit

Permalink
Finally fix copying!
Browse files Browse the repository at this point in the history
  • Loading branch information
npyl committed Oct 9, 2018
1 parent 567e0ed commit 103ace6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Manage Conky/SaveWidgetSheetController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ - (void)awakeFromNib
static BOOL beenHereAgain = NO;
if (beenHereAgain) { return; }
beenHereAgain = YES;

resourcesLocations = [NSMutableArray array];
[_scriptView setSyntaxDefinitionName:@"lua"];
}
Expand All @@ -38,7 +38,7 @@ - (IBAction)addPreview:(id)sender
[op setPrompt:@"Add"];
[op setAllowedFileTypes:@[@"png", @"jpg", @"jpeg", @"tiff"]];
NSModalResponse res = [op runModal];

if (res == NSModalResponseOK)
{
self->previewLocation = op.URL;
Expand Down Expand Up @@ -80,7 +80,7 @@ - (IBAction)saveButton:(id)sender

/* delete any previous versions */
[fm removeItemAtPath:widgetDirectory error:nil];

/* create widget directory */
[fm createDirectoryAtPath:widgetDirectory withIntermediateDirectories:NO attributes:nil error:&error];
if (error)
Expand All @@ -101,9 +101,9 @@ - (IBAction)saveButton:(id)sender
[fm createFileAtPath:widgetCreator
contents:[_widgetCreatorField.stringValue dataUsingEncoding:NSUTF8StringEncoding]
attributes:nil];

/* copy preview */
[fm copyItemAtPath:previewLocation.path toPath:widgetDirectory error:&error];
[fm copyItemAtPath:previewLocation.path toPath:[widgetDirectory stringByAppendingPathComponent:[previewLocation.path lastPathComponent]] error:&error];
if (error)
{
NSLog(@"%@", error);
Expand All @@ -112,7 +112,7 @@ - (IBAction)saveButton:(id)sender
/* copy resources */
for (NSURL *resource in resourcesLocations)
{
[fm copyItemAtPath:resource.path toPath:widgetDirectory error:&error];
[fm copyItemAtPath:resource.path toPath:[widgetDirectory stringByAppendingPathComponent:[resource.path lastPathComponent]] error:&error];
if (error)
{
NSLog(@"%@", error);
Expand Down

0 comments on commit 103ace6

Please sign in to comment.