diff options
author | rowanbeentje <rowan@beent.je> | 2012-05-28 00:59:47 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-05-28 00:59:47 +0000 |
commit | 93005290f2ceee7a573d69379a4d1f1875d5aa95 (patch) | |
tree | 2c515a4420a36368ca9da2fc35ed8c886bb268da /Source/SPConnectionController.m | |
parent | 733e7c89c5f092bc11a06d754bde149a5423c928 (diff) | |
download | sequelpro-93005290f2ceee7a573d69379a4d1f1875d5aa95.tar.gz sequelpro-93005290f2ceee7a573d69379a4d1f1875d5aa95.tar.bz2 sequelpro-93005290f2ceee7a573d69379a4d1f1875d5aa95.zip |
- Fix issues where removing favorites could cause crashes in other tabs/windows where the favorite was selected (Issue #1351)
- Keep multiple windows and tabs in sync when editing favorites
- Fix a new KVO observation not being removed on object teardown
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r-- | Source/SPConnectionController.m | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 68d7bb16..6de0c9c3 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -971,6 +971,10 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [favoritesController saveFavorites]; [self _reloadFavoritesViewData]; + + if ([keyPath isEqualToString:SPFavoriteNameKey]) { + [[NSNotificationCenter defaultCenter] postNotificationName:SPConnectionFavoritesChangedNotification object:self]; + } } } @@ -1126,6 +1130,8 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [favoritesController saveFavorites]; [self _reloadFavoritesViewData]; + + [[NSNotificationCenter defaultCenter] postNotificationName:SPConnectionFavoritesChangedNotification object:self]; } /** @@ -1524,6 +1530,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [NSObject cancelPreviousPerformRequestsWithTarget:self]; // Unregister observers + [self removeObserver:self forKeyPath:SPFavoriteTypeKey]; [self removeObserver:self forKeyPath:SPFavoriteNameKey]; [self removeObserver:self forKeyPath:SPFavoriteHostKey]; [self removeObserver:self forKeyPath:SPFavoriteUserKey]; |