From 3b251b8e3d4dc9a694ef76562b388ab07da54785 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 19:48:41 +0100 Subject: Replace some NSDictionaries with literals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [NSDictionary dictionary] → @{} * [NSDictionary dictionaryWithObject:forKey:] can safely be replaced. object==nil would have already thrown a NPE in the past. * Also replaced some (hopefully safe) NSArray initializers (ie. their objects should always exist). --- Source/SPFavoritesExporter.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/SPFavoritesExporter.m') diff --git a/Source/SPFavoritesExporter.m b/Source/SPFavoritesExporter.m index d9342fa8..a8b78a86 100644 --- a/Source/SPFavoritesExporter.m +++ b/Source/SPFavoritesExporter.m @@ -77,7 +77,7 @@ [favorites addObject:[node dictionaryRepresentation]]; } - NSDictionary *dictionary = [NSDictionary dictionaryWithObject:favorites forKey:SPFavoritesDataRootKey]; + NSDictionary *dictionary = @{SPFavoritesDataRootKey : favorites}; [favorites release]; -- cgit v1.2.3 From 11b8718ddfd44dc5786ac745f90fa390aaf57a06 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 11 May 2015 02:04:06 +0200 Subject: * Fully enable export of favorite groups * Favorites can now be imported, sorted even if "Quick Connect" is selected * Favorite files containing groups will now be imported correctly * If a favorite and the group containing said favorite are exported, the favorite will no longer be included twice --- Source/SPFavoritesExporter.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Source/SPFavoritesExporter.m') diff --git a/Source/SPFavoritesExporter.m b/Source/SPFavoritesExporter.m index a8b78a86..d37ce07d 100644 --- a/Source/SPFavoritesExporter.m +++ b/Source/SPFavoritesExporter.m @@ -74,7 +74,10 @@ // Get a dictionary representation of all favorites for (SPTreeNode *node in [self exportFavorites]) { - [favorites addObject:[node dictionaryRepresentation]]; + // The selection could contain a group as well as items in that group. + // So we skip those items, as their group will already export them. + if(![node isDescendantOfNodes:[self exportFavorites]]) + [favorites addObject:[node dictionaryRepresentation]]; } NSDictionary *dictionary = @{SPFavoritesDataRootKey : favorites}; -- cgit v1.2.3