for (int x = getUploadManager().getModel().getItemCount()-1; x >= 0; x--) {
final Object obj = getUploadManager().getModel().getItemAt(x);
if( !(obj instanceof FrostSharedFileItem) ) {
continue;
}
final FrostSharedFileItem suf = (FrostSharedFileItem)obj;
if( suf.getOwner().equals(li.getUniqueName()) ) {
// FIXME: why do we have a FrostSharedFileItem and try to remove a FrostUploadItem?
FrostUploadItem frostSharedFileItem = (FrostUploadItem) (Object) suf;
getUploadManager().getModel().removeItem(frostSharedFileItem);
}
}
// remove from sharedfiles table
for (int x = 0; x < getSharedFilesManager().getModel().getItemCount(); x++) {
final FrostSharedFileItem item = (FrostSharedFileItem) getSharedFilesManager().getModel().getItemAt(x);
if( item.getOwner().equals( li.getUniqueName()) ) {
getSharedFilesManager().getModel().removeItem(item);
}
}
}