cgeo/c-geo-opensource — Issue #984: List doesn't refresh for cache dropped from detail view
Author: campbeb
Created: 2012-01-14 14:43:32+00:00
State: open

Steps:
- Create a new list and store some caches in it
- View the list and then select a cache to view its details
- From the Details screen, Drop the cache (remove from offline list)
- Hit back to return to the list and the cache is still there and the number at the top of the screen hasn't changed.

Do the same for the built-in list ("Stored") and when you go back to the list, it will update to remove the cache that was dropped.

The problem is in this code from cgeocaches.java

``` ruby
// refresh standard list if it has changed (new caches downloaded)
if (type == CacheListType.OFFLINE && listId == StoredList.STANDARD_LIST_ID && search != null) {
SearchResult newSearch = cgBase.searchByOffline(coords, cacheType, listId);
if (newSearch != null && newSearch.totalCnt != search.totalCnt) {
refreshCurrentList();
}
}
```

Removing `&& listId == StoredList.STANDARD_LIST_ID` solves the bug.
But, I am not sure why the code was being restricted to the standard list. Anyone know why this code is here?