Skip to content

Commit 24153c8

Browse files
committed
Merge pull request #161 from ebertech/master
fix for stash ordering
2 parents 7e21c52 + 12ca779 commit 24153c8

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

Model/PBGitStash.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ - (NSString *) description {
3737
#pragma mark Presentable
3838

3939
- (NSString *) displayDescription {
40-
return [NSString stringWithFormat:@"%@ (%@)", self.message, self.name];
40+
return [NSString stringWithFormat:@"%@: %@", self.name, self.message];
4141
}
4242

4343
- (NSString *) popupDescription {

PBGitSidebarController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(
128128
PBGitMenuItem *lastItem = nil;
129129
for (PBGitStash *stash in newStashes) {
130130
PBGitMenuItem *item = [[PBGitMenuItem alloc] initWithSourceObject:stash];
131-
[stashes addChild:item];
131+
[stashes addChildWithoutSort:item];
132132
lastItem = item;
133133
}
134134
if (lastItem) {

PBSourceViewItem.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- (NSString *)helpText;
2828

2929
- (void)addChild:(PBSourceViewItem *)child;
30+
- (void)addChildWithoutSort:(PBSourceViewItem *)child;
3031
- (void)removeChild:(PBSourceViewItem *)child;
3132

3233
// This adds the ref to the path, which should match the item's title,

PBSourceViewItem.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ - (void)addChild:(PBSourceViewItem *)child
6262
[self.children sortUsingDescriptors:[NSArray arrayWithObject:[[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)]]];
6363
}
6464

65+
- (void)addChildWithoutSort:(PBSourceViewItem *)child
66+
{
67+
if (!child)
68+
return;
69+
70+
[self.children addObject:child];
71+
child.parent = self;
72+
}
73+
6574
- (void)removeChild:(PBSourceViewItem *)child
6675
{
6776
if (!child)

0 commit comments

Comments
 (0)