From ad3eb2dfd986bbf7f05cb48c0275b56246806225 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 6 Feb 2009 01:21:43 -0500 Subject: [PATCH] Add the actual path replacement procedure and flip/rename the columns in the preferences * English.lproj/Preferences.xib: Flip and rename the path columns * Source/Breakpoint.m+h: (transformedPath): New method --- English.lproj/Preferences.xib | 282 +++++++++++++++++----------------- Source/Breakpoint.h | 2 + Source/Breakpoint.m | 22 +++ 3 files changed, 165 insertions(+), 141 deletions(-) diff --git a/English.lproj/Preferences.xib b/English.lproj/Preferences.xib index 05dc21e..bda237b 100644 --- a/English.lproj/Preferences.xib +++ b/English.lproj/Preferences.xib @@ -8,7 +8,7 @@ 353.00 YES - + YES @@ -77,7 +77,7 @@ YES 0 - + 7E7339A3-79C3-4087-B2F7-2479CFD10818 @@ -166,12 +166,12 @@ - + YES - + @@ -224,7 +224,7 @@ 6 System controlColor - + 3 MC42NjY2NjY2OQA @@ -258,7 +258,7 @@ 6 System textBackgroundColor - + 3 MQA @@ -333,115 +333,115 @@ NSView - + 268 YES - - + + 268 YES - - + + 2304 YES - - + + 256 {427, 175} - + YES - - + + 256 {427, 17} - - + + - - + + -2147483392 {{-26, 0}, {16, 17}} - + YES - - 2.050000e+02 + + 2.160000e+02 4.000000e+01 1.000000e+03 75628032 0 - Remote Path Fragment + Local LucidaGrande 1.100000e+01 3100 - + 3 MC4zMzMzMzI5OQA - + 6 System headerTextColor - + 337772096 2048 Text Cell - - + + 6 System controlBackgroundColor - + 3 YES YES - + - - 2.160000e+02 + + 2.050000e+02 4.000000e+01 1.000000e+03 75628032 0 - Replacement + Remote - - + + - + 337772096 2048 Text Cell - - + + 3 YES YES - + 3.000000e+00 2.000000e+00 - + 6 System @@ -460,71 +460,71 @@ {{1, 17}, {427, 175}} - - - - + + + + 4 - - + + -2147483392 {{411, 17}, {15, 160}} - - + + _doScroller: 9.142857e-01 - - + + -2147483392 {{1, 177}, {411, 15}} - + 1 - + _doScroller: 1.000000e+00 9.976526e-01 - - + + 2304 YES - + {{1, 0}, {427, 17}} - - - - + + + + 4 - + {{-1, 20}, {429, 193}} - - + + 562 - - - - - + + + + + QSAAAEEgAABBmAAAQZgAAA - - + + 268 {{-1, -1}, {26, 23}} - + YES - + -2080244224 134217728 - + -2033434369 162 @@ -537,18 +537,18 @@ 75 - - + + 268 {{24, -1}, {26, 23}} - + YES - + -2080244224 134217728 - + -2033434369 162 @@ -566,7 +566,7 @@ NSView - + YES local @@ -669,7 +669,7 @@ showPaths: - + 51 @@ -677,7 +677,7 @@ pathsPreferencesItem - + 52 @@ -685,17 +685,17 @@ pathsPreferencesView - + 54 contentArray: values.PathReplacements - + - + contentArray: values.PathReplacements contentArray @@ -712,11 +712,11 @@ value: arrangedObjects.local - - + + - - + + value: arrangedObjects.local value arrangedObjects.local @@ -728,11 +728,11 @@ value: arrangedObjects.remote - - + + - - + + value: arrangedObjects.remote value arrangedObjects.remote @@ -744,24 +744,24 @@ remove: - - + + 86 add: - - + + 89 content - - + + 90 @@ -826,7 +826,7 @@ - + @@ -931,117 +931,117 @@ 50 - + 53 - + YES - - - + + + PathsPreferences 55 - + YES - - - - + + + + - + 56 - - + + 57 - - + + 58 - + YES - - + + - + 59 - - + + 60 - + YES - + - + 61 - + YES - + - + 62 - - + + 63 - - + + 64 - + YES - + - + 65 - - + + 66 - + YES - + - + 67 - - + + 78 - + Paths Controller diff --git a/Source/Breakpoint.h b/Source/Breakpoint.h index 3304e26..4d00739 100644 --- a/Source/Breakpoint.h +++ b/Source/Breakpoint.h @@ -31,6 +31,8 @@ - (id)initWithLine:(int)l inFile:(NSString *)f; - (id)initWithDictionary:(NSDictionary *)dict; +- (NSString *)transformedPath; + - (NSDictionary *)dictionary; @end diff --git a/Source/Breakpoint.m b/Source/Breakpoint.m index a44d743..3730306 100644 --- a/Source/Breakpoint.m +++ b/Source/Breakpoint.m @@ -56,6 +56,28 @@ return self; } +/** + * Returns the transformed path for the breakpoint, as Xdebug needs it + */ +- (NSString *)transformedPath +{ + NSString *path = self.file; + + NSMutableArray *transforms = [[NSUserDefaults standardUserDefaults] mutableArrayValueForKey:@"PathReplacements"]; + if (!transforms || [transforms count] < 1) + return path; + + for (NSDictionary *replacement in transforms) + { + path = [path + stringByReplacingOccurrencesOfString:[replacement valueForKey:@"local"] + withString:[replacement valueForKey:@"remote"] + ]; + } + + return path; +} + /** * Determines if two breakpoints are equal */ -- 2.43.5