Ticket #7091: videodlg.diff
File videodlg.diff, 1.8 KB (added by , 15 years ago) |
---|
-
mythvideo/mythvideo/videodlg.cpp
3088 3088 } 3089 3089 3090 3090 /** \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. 3092 3092 * \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. 3093 3097 */ 3094 3098 QString VideoDialog::GetFirstImage(MythGenericTree *node, QString type) 3095 3099 { … … 3098 3102 int list_count = node->visibleChildCount(); 3099 3103 if (list_count > 0) 3100 3104 { 3105 QList<MythGenericTree *> subDirs; 3106 3101 3107 for (int i = 0; i < list_count; i++) 3102 3108 { 3103 3109 MythGenericTree *subnode = node->getVisibleChildAt(i); 3104 3110 if (subnode) 3105 3111 { 3112 if (subnode->childCount() > 0) 3113 { 3114 subDirs << subnode; 3115 } 3116 3106 3117 Metadata *metadata = GetMetadataPtrFromNode(subnode); 3107 3118 if (metadata) 3108 3119 { … … 3199 3210 } 3200 3211 } 3201 3212 } 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 } 3202 3227 } 3203 3228 return icon_file; 3204 3229 }