Ticket #6582: mythtv-6582-skip_special_storage_groups_in_status_page.patch

File mythtv-6582-skip_special_storage_groups_in_status_page.patch, 1.4 KB (added by sphery <mtdean@…>, 17 years ago)
  • programs/mythbackend/backendutil.cpp

    old new  
    2020#include "util.h"
    2121#include "decodeencode.h"
    2222#include "compat.h"
     23#include "storagegroup.h"
    2324
    2425static QMap<QString, int> fsID_cache;
    2526static QMutex cache_lock;
     
    7273    QString driveKey;
    7374    QString localStr = "1";
    7475    struct statfs statbuf;
     76    QString specialGroups = StorageGroup::kSpecialGroups.join("', '");
     77    QString sql = QString("SELECT MIN(id),dirname "
     78                          "FROM storagegroup "
     79                          "WHERE hostname = :HOSTNAME "
     80                            "AND groupname NOT IN ( '%1' ) "
     81                          "GROUP BY dirname;").arg(specialGroups);
    7582    MSqlQuery query(MSqlQuery::InitCon());
    76     query.prepare("SELECT MIN(id),dirname "
    77                   "FROM storagegroup "
    78                   "WHERE hostname = :HOSTNAME "
    79                     "AND groupname <> :BACKUPGRP "
    80                   "GROUP BY dirname;");
     83    query.prepare(sql);
    8184    query.bindValue(":HOSTNAME", gContext->GetHostName());
    82     query.bindValue(":BACKUPGRP", "DB Backups");
    8385
    8486    if (query.exec() && query.isActive())
    8587    {