Skip to content

Commit 103ace6

Browse files
committed
Finally fix copying!
1 parent 567e0ed commit 103ace6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Manage Conky/SaveWidgetSheetController.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ - (void)awakeFromNib
1717
static BOOL beenHereAgain = NO;
1818
if (beenHereAgain) { return; }
1919
beenHereAgain = YES;
20-
20+
2121
resourcesLocations = [NSMutableArray array];
2222
[_scriptView setSyntaxDefinitionName:@"lua"];
2323
}
@@ -38,7 +38,7 @@ - (IBAction)addPreview:(id)sender
3838
[op setPrompt:@"Add"];
3939
[op setAllowedFileTypes:@[@"png", @"jpg", @"jpeg", @"tiff"]];
4040
NSModalResponse res = [op runModal];
41-
41+
4242
if (res == NSModalResponseOK)
4343
{
4444
self->previewLocation = op.URL;
@@ -80,7 +80,7 @@ - (IBAction)saveButton:(id)sender
8080

8181
/* delete any previous versions */
8282
[fm removeItemAtPath:widgetDirectory error:nil];
83-
83+
8484
/* create widget directory */
8585
[fm createDirectoryAtPath:widgetDirectory withIntermediateDirectories:NO attributes:nil error:&error];
8686
if (error)
@@ -101,9 +101,9 @@ - (IBAction)saveButton:(id)sender
101101
[fm createFileAtPath:widgetCreator
102102
contents:[_widgetCreatorField.stringValue dataUsingEncoding:NSUTF8StringEncoding]
103103
attributes:nil];
104-
104+
105105
/* copy preview */
106-
[fm copyItemAtPath:previewLocation.path toPath:widgetDirectory error:&error];
106+
[fm copyItemAtPath:previewLocation.path toPath:[widgetDirectory stringByAppendingPathComponent:[previewLocation.path lastPathComponent]] error:&error];
107107
if (error)
108108
{
109109
NSLog(@"%@", error);
@@ -112,7 +112,7 @@ - (IBAction)saveButton:(id)sender
112112
/* copy resources */
113113
for (NSURL *resource in resourcesLocations)
114114
{
115-
[fm copyItemAtPath:resource.path toPath:widgetDirectory error:&error];
115+
[fm copyItemAtPath:resource.path toPath:[widgetDirectory stringByAppendingPathComponent:[resource.path lastPathComponent]] error:&error];
116116
if (error)
117117
{
118118
NSLog(@"%@", error);

0 commit comments

Comments
 (0)