Ticket #7091: videodlg.diff

File videodlg.diff, 1.8 KB (added by andycarr@…, 15 years ago)

MythVideo? videodlg.cpp diff

  • mythvideo/mythvideo/videodlg.cpp

     
    30883088}
    30893089
    30903090/** \fn VideoDialog::GetFirstImage(MythGenericTree *node, QString type)
    3091  *  \brief Find the first image of "type" within a folder.
     3091 *  \brief Find the first image of "type" within a folder structure.
    30923092 *  \return QString local or myth:// for the image.
     3093 *
     3094 *  Will try immediate children (files) first, if no hits, will continue
     3095 *  through subfolders recursively until an image of the specified type
     3096 *  is found.
    30933097 */
    30943098QString VideoDialog::GetFirstImage(MythGenericTree *node, QString type)
    30953099{
     
    30983102    int list_count = node->visibleChildCount();
    30993103    if (list_count > 0)
    31003104    {
     3105        QList<MythGenericTree *> subDirs;
     3106       
    31013107        for (int i = 0; i < list_count; i++)
    31023108        {
    31033109            MythGenericTree *subnode = node->getVisibleChildAt(i);
    31043110            if (subnode)
    31053111            {
     3112                if (subnode->childCount() > 0)
     3113                {
     3114                    subDirs << subnode;
     3115                }
     3116               
    31063117                Metadata *metadata = GetMetadataPtrFromNode(subnode);
    31073118                if (metadata)
    31083119                {
     
    31993210                }
    32003211            }
    32013212        }
     3213        if (icon_file.isEmpty() && !subDirs.isEmpty())
     3214        {
     3215            QString test_file;
     3216            int subDirCount = subDirs.count();
     3217            for (int i = 0; i < subDirCount; i ++)
     3218            {
     3219                test_file = GetFirstImage(subDirs[i], type);
     3220                if (!test_file.isEmpty())
     3221                {
     3222                    icon_file = test_file;
     3223                    break;
     3224                }
     3225            }
     3226        }
    32023227    }
    32033228    return icon_file;
    32043229}