Ticket #6589: mythtv-6589-backend_status-move_total_disk_space_to_top.patch

File mythtv-6589-backend_status-move_total_disk_space_to_top.patch, 1.2 KB (added by sphery <mtdean@…>, 3 years ago)

Moves "Total Disk Space" to top

  • programs/mythbackend/httpstatus.cpp

    old new  
    339339    BackendQueryDiskSpace(strlist, m_pEncoders, true, m_bIsMaster); 
    340340    QDomElement total; 
    341341 
     342    // Make a temporary list to hold the per-filesystem elements so that the 
     343    // total is always the first element. 
     344    QList<QDomElement> fsXML; 
    342345    QStringList::const_iterator sit = strlist.begin(); 
    343346    while (sit != strlist.end()) 
    344347    { 
     
    362365        group.setAttribute("free" , (int)(iAvail>>10) ); 
    363366        group.setAttribute("dir"  , directory ); 
    364367 
    365         // Make sure that the total is always the last element. 
    366368        if (fsID == "total") 
    367369            total = group; 
    368370        else 
    369             storage.appendChild(group); 
     371            fsXML << group; 
    370372    } 
    371373 
    372374    storage.appendChild(total); 
     375    int num_elements = fsXML.size(); 
     376    for (int fs_index = 0; fs_index < num_elements; fs_index++) 
     377    { 
     378            storage.appendChild(fsXML[fs_index]); 
     379    } 
    373380 
    374381    // load average --------------------- 
    375382