Ticket #2169: make_dvd_backup_dirs_visible_in_listing_mode.diff

File make_dvd_backup_dirs_visible_in_listing_mode.diff, 2.4 KB (added by Pekka Jääskeläinen <pekka.jaaskelainen@…>, 19 years ago)
  • mythvideo/mythvideo/videolist.cpp

    old new  
    409409}
    410410
    411411GenericTree *VideoList::addDirNode(GenericTree *where_to_add,
    412                                                         const QString& dname)
     412                                   const QString& dname)
    413413{
    414414    GenericTree *sub_node, *up_node;
    415415
     
    426426}
    427427
    428428GenericTree *VideoList::addFileNode(GenericTree *where_to_add,
    429                                                 const QString& fname, int index)
     429                                    const QString& fname, int index)
    430430{
    431431    int a_counter = 0;
    432432    GenericTree *sub_node;
    433 
    434433    QStringList list(QStringList::split("/", fname));
    435434    QStringList::Iterator an_it = list.begin();
    436435    for( ; an_it != list.end(); ++an_it)
     
    438437        if(a_counter + 1 >= (int) list.count()) // video
    439438        {
    440439            QString title = (*an_it);
    441             sub_node = where_to_add->addNode(title.section(".",0,-2),
    442                     index, true);
     440
     441            // this results in (DVD backup) directories having a title in
     442            // the file list and video files having a title with only their
     443            // file basename (suffix stripped)
     444            if (title.find(".") > 0) {
     445                title = title.section(".", 0, -2);
     446            }
     447            sub_node = where_to_add->addNode(title, index, true);
    443448            sub_node->setAttribute(0, ORDER_ITEM);
    444449            sub_node->setOrderingIndex(0);
    445450            nitems++;
  • mythvideo/mythvideo/videotree.cpp

    old new  
    241241    int file_browser = gContext->GetNumSetting("VideoTreeNoDB", 0);
    242242
    243243    video_tree_root = video_list->buildVideoList(file_browser, false,
    244                                                 current_parental_level);
     244                                                 current_parental_level);
    245245    if (video_tree_root->childCount() > 0)
    246246        video_tree_data = video_tree_root->getChildAt(0,0);
    247247    else video_tree_data = video_tree_root;