RSSFeed feed = pluginInterface.getUtilities().getRSSFeed(new URL(rss_url));
RSSChannel[] channels = feed.getChannels();
for (int i = 0 ; i < channels.length ; i++)
{
final RSSChannel channel = channels[i];
View.display.asyncExec(new Runnable (){
public void run () {
if(View.rss_info != null && !View.rss_info.isDisposed()){
TreeItem items[] = View.rss_info.getItems();
for (int j = 0 ; j < items.length ; j++)
{
if(items[j].getText().startsWith(channel.getTitle()))
{
System.out.println("Duplicate!");
return;
}
}
item_server = new TreeItem(View.rss_info,SWT.NULL);
if (View.rss_info.getItemCount()%2==0) {
item_server.setBackground(View.gray_color);
}
item_server.setText(channel.getTitle() +
" (" + rss_url + ") ");
}
RSSItem[] items = channel.getItems();
if(items.length == 0)
{
item_rssitem = new TreeItem(item_server,SWT.NULL);
item_rssitem.setText("RSS Feed active but no torrents present");
item_rssitem.setBackground(item_server.getBackground());