Ticket #6149: mythgallery_filter_19740.diff
File mythgallery_filter_19740.diff, 2.3 KB (added by , 15 years ago) |
---|
-
mythplugins/mythgallery/mythgallery/gallerysettings.cpp
11 11 12 12 // General Settings 13 13 14 static HostLineEdit *MythGalleryFilter() 15 { 16 HostLineEdit *gc = new HostLineEdit("GalleryFilter"); 17 gc->setLabel(QObject::tr("Directory filter")); 18 gc->setValue(""); 19 gc->setHelpText(QObject::tr("Enter direcory names to be excluded in browser. " 20 "(multiple entries delimited with ':')")); 21 return gc; 22 }; 23 14 24 static HostLineEdit *MythGalleryDir() 15 25 { 16 26 HostLineEdit *gc = new HostLineEdit("GalleryDir"); … … 218 228 general->addChild(MythGallerySortOrder()); 219 229 general->addChild(MythGalleryImportDirs()); 220 230 general->addChild(MythGalleryMoviePlayerCmd()); 231 general->addChild(MythGalleryFilter()); 221 232 addChild(general); 222 233 223 234 GalleryConfigurationGroup* config = new GalleryConfigurationGroup(); -
mythplugins/mythgallery/mythgallery/galleryutil.cpp
213 213 QString blah = dir; 214 214 QDir d(blah); 215 215 QString currDir = d.absolutePath(); 216 216 QString filterDir = gContext->GetSetting("GalleryFilter"); 217 217 218 bool isGallery; 218 219 QFileInfoList gList = d.entryInfoList(QStringList("serial*.dat"), 219 220 QDir::Files); … … 253 254 (fi->fileName().indexOf(".highlight.") > 0))) 254 255 continue; 255 256 257 // skip filtered directory 258 if (fi->isDir() && !filterDir.isEmpty()) 259 { 260 bool match = false; 261 262 QStringList splitFD = filterDir.split(":"); 263 for (QStringList::Iterator itFD = splitFD.begin(); itFD != splitFD.end(); itFD++) { 264 if ( *itFD == fi->fileName()) 265 { 266 match = true; 267 break; 268 } 269 } 270 if (match) 271 continue; 272 } 273 256 274 if (fi->isDir() && recurse) 257 275 { 258 276 GalleryUtil::LoadDirectory(