Browser::FlatCategoryModel::FlatCategoryModel( const DB::CategoryPtr& category, const DB::ImageSearchInfo& info )
    : AbstractCategoryModel( category, info )
{
    if ( hasNoneEntry() )
        m_items.append( DB::ImageDB::NONE() );

    QStringList items = m_category->itemsInclCategories();
    items.sort();

    Q_FOREACH( const QString &name, items ) {
        const int imageCount = m_images.contains(name) ? m_images[name] : 0;
        const int videoCount = m_videos.contains(name) ? m_videos[name] : 0;

        if ( imageCount + videoCount > 0 )
            m_items.append( name );
    }
}
Browser::FlatCategoryModel::FlatCategoryModel( const DB::CategoryPtr& category, const DB::ImageSearchInfo& info )
    : AbstractCategoryModel( category, info )
{
    if ( hasNoneEntry() )
        _items.append( DB::ImageDB::NONE() );

    QStringList items = _category->itemsInclCategories();
    items.sort();

    for( QStringList::Iterator itemIt = items.begin(); itemIt != items.end(); ++itemIt ) {
        const QString name = *itemIt;
        const int imageCount = _images.contains(name) ? _images[name] : 0;
        const int videoCount = _videos.contains(name) ? _videos[name] : 0;

        if ( imageCount + videoCount > 0 )
            _items.append( name );
    }
}