bdrister/AquaticPrime

Licence utility on 10.6 - product rename causes template data loss

Closed this issue · 1 comments

Renaming a product causes template data loss if the rename causes the producer data to be sorted.

This occurs because the template data is not saved when the rename occurs.
This works okay if the product data order does not change. Fails otherwise.
Only tested on 10.6

The following patch saves the template data along with the product data on rename.

--- /Users/Jonathan/Documents/Download/bdrister-AquaticPrime-1a93412/License Utility/Classes/ProductController.m 2010-02-10 06:03:04.000000000 +0000
+++ /Users/Jonathan/Documents/Computing/Aquatic Prime/bdrister-AquaticPrime-1a93412/License Utility/Classes/ProductController.m 2010-02-14 13:20:17.000000000 +0000
@@ -272,13 +272,24 @@

NSString *newProductPath = [[@"~/Library/Application Support/Aquatic/Product Keys" stringByExpandingTildeInPath] 
                        stringByAppendingString:[NSString stringWithFormat:@"/%@.plist", object]];
  • NSString *oldTemplateProductPath = [[@"~/Library/Application Support/Aquatic/License Templates" stringByExpandingTildeInPath]
  •                           stringByAppendingString:[NSString stringWithFormat:@"/%@.plist", [productArray objectAtIndex:row]]];
    
  • NSString *newTemplateProductPath = [[@"~/Library/Application Support/Aquatic/License Templates" stringByExpandingTildeInPath]
  •                           stringByAppendingString:[NSString stringWithFormat:@"/%@.plist", object]];
    
  • [fm movePath:oldProductPath toPath:newProductPath handler:nil];
  • [fm movePath:oldTemplateProductPath toPath:newTemplateProductPath handler:nil];

// Change the name
[productArray replaceObjectAtIndex:row withObject:object];
[productArray sortUsingSelector:@selector(caseInsensitiveCompare:)];
[productTable reloadData];

  • // Select the renamed item

  • [productTable selectRowIndexes:[NSIndexSet indexSetWithIndex:[productArray indexOfObject:object]]

  •         byExtendingSelection:NO];
    

    }

    @EnD

Good catch! Thank you, I've applied your patch in ab10f3e.