diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m index b3d175e9..fdcdcb16 100644 --- a/MacPass/MPDocumentWindowController.m +++ b/MacPass/MPDocumentWindowController.m @@ -190,6 +190,8 @@ typedef NS_ENUM(NSUInteger, MPAlertContext) { - (void)exportDatabase:(id)sender { NSSavePanel *savePanel = [NSSavePanel savePanel]; [savePanel setAllowsOtherFileTypes:YES]; + [savePanel setAllowedFileTypes:@[(id)kUTTypeXML]]; + [savePanel setCanSelectHiddenExtension:YES]; [savePanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) { if(result == NSFileHandlingPanelOKButton) { [[self document] writeXMLToURL:savePanel.URL]; diff --git a/MacPass/MPOutlineDataSource.m b/MacPass/MPOutlineDataSource.m index b7ffb889..0d75c8a3 100644 --- a/MacPass/MPOutlineDataSource.m +++ b/MacPass/MPOutlineDataSource.m @@ -131,7 +131,9 @@ if(copyItem || (nil == self.localDraggedGroup) ) { /* Add Copy to title */ NSString *copyTemplate = NSLocalizedString(@"%@_COPY", ""); + /* If we copy, we need to update the uuid */ draggedGroup.name = [NSString stringWithFormat:copyTemplate, draggedGroup.name]; + draggedGroup.uuid = [NSUUID UUID]; [targetGroup addGroup:draggedGroup atIndex:index]; [targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_GROUP", "")]; return YES; @@ -147,8 +149,10 @@ } else if(draggedEntry) { if(copyItem || (nil == self.localDraggedEntry)) { + /* if we copy, we need to update the uuid */ NSString *copyTemplate = NSLocalizedString(@"%@_COPY", ""); draggedEntry.title = [NSString stringWithFormat:copyTemplate, draggedEntry.title]; + draggedEntry.uuid = [NSUUID UUID]; [targetGroup addEntry:draggedEntry atIndex:index]; [targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_ENTRY", "")]; return YES;