core/com.nokia.carbide.cpp.news.reader/src/com/nokia/carbide/cpp/internal/news/reader/feed/FeedManager.java
branchRCL_2_0
changeset 99 3604ec4c983e
parent 83 6c6d4b0c9171
child 104 4ca9a303c257
equal deleted inserted replaced
93:4f14af134d0e 99:3604ec4c983e
    42 import com.nokia.carbide.cpp.internal.news.reader.ui.NewsPreferenceConstants;
    42 import com.nokia.carbide.cpp.internal.news.reader.ui.NewsPreferenceConstants;
    43 import com.sun.syndication.feed.synd.SyndFeed;
    43 import com.sun.syndication.feed.synd.SyndFeed;
    44 import com.sun.syndication.fetcher.FeedFetcher;
    44 import com.sun.syndication.fetcher.FeedFetcher;
    45 import com.sun.syndication.fetcher.impl.FeedFetcherCache;
    45 import com.sun.syndication.fetcher.impl.FeedFetcherCache;
    46 import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
    46 import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
    47 import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
       
    48 
    47 
    49 /**
    48 /**
    50  * A class to manage feeds for the Carbide.c++ news reader.
    49  * A class to manage feeds for the Carbide.c++ news reader.
    51  *
    50  *
    52  */
    51  */
   189 		}
   188 		}
   190 		return count;
   189 		return count;
   191 	}
   190 	}
   192 
   191 
   193 	/**
   192 	/**
   194 	 * Remove an entry from a feed.
   193 	 * Search for a feed entry by name and then mark it as read.
   195 	 * @param feed - feed object in question
   194 	 * @param entries - feed entries to be checked
   196 	 * @param entryTitle - title of the entry to be removed
   195 	 * @param entryTitle - title of the entry to be marked as read
   197 	 */
   196 	 */
   198 	public void removeNewsFeedEntry(List<CarbideSyndEntry> entries, String entryTitle) {
   197 	public void markEntryAsRead(List<CarbideSyndEntry> entries, String entryTitle) {
   199 		if (entries == null || entryTitle == null) {
   198 		if (entries == null || entryTitle == null) {
   200 			return;
   199 			return;
   201 		}
   200 		}
   202 
   201 
   203 		for (Iterator<CarbideSyndEntry> iterator = entries.iterator(); iterator.hasNext();) {
   202 		for (Iterator<CarbideSyndEntry> iterator = entries.iterator(); iterator.hasNext();) {
   204 			CarbideSyndEntry entry = iterator.next();
   203 			CarbideSyndEntry entry = iterator.next();
   205 			String title = entry.getTitle();
   204 			String title = entry.getTitle();
   206 			title = title.replaceAll("\n", "");
   205 			title = title.replaceAll("\n", "");
   207 			if (title.equals(entryTitle)) {
   206 			if (title.equals(entryTitle) && !entry.isRead()) {
   208 				entry.setRead(true);
   207 				entry.setRead(true);
   209 				break;
   208 				break;
   210 			}
   209 			}
   211 		}
   210 		}
   212 		
   211