Ticket #12021: mythtv-dependsexec.patch

File mythtv-dependsexec.patch, 1.8 KB (added by slackerlinux85@…, 11 years ago)

adds dependsexec to themecode

  • mythtv/libs/libmythui/myththemedmenu.cpp

    diff --git a/mythtv/libs/libmythui/myththemedmenu.cpp b/mythtv/libs/libmythui/myththemedmenu.cpp
    index a0f20ad..a0c17c6 100644
    a b  
    77#include <QKeyEvent>
    88#include <QDomDocument>
    99#include <QFile>
     10#include <QFileInfo>
    1011#include <QTextStream>
    1112
    1213// libmythui headers
    void MythThemedMenu::parseThemeButton(QDomElement &element) 
    483484            {
    484485                addit = findDepends(getFirstText(info));
    485486            }
     487            else if (info.tagName() == "dependsexec")
     488            {
     489                addit = findDependsExec(getFirstText(info));
     490            }
    486491            else if (info.tagName() == "dependssetting")
    487492            {
    488493                addit = GetMythDB()->GetNumSetting(getFirstText(info));
    bool MythThemedMenu::findDepends(const QString &fileList) 
    859864    return false;
    860865}
    861866
     867bool MythThemedMenu::findDependsExec(const QString &filename)
     868{
     869    QFileInfo filename_info(filename);
     870    if (filename_info.exists() && filename_info.isFile() && filename_info.isExecutable())
     871        return true;
     872    return false;
     873}
     874
    862875/** \brief Queries the user for a password to enter a part of MythTV
    863876 *         restricted by a password.
    864877 *
  • mythtv/libs/libmythui/myththemedmenu.h

    diff --git a/mythtv/libs/libmythui/myththemedmenu.h b/mythtv/libs/libmythui/myththemedmenu.h
    index 5ecf6c7..e4028d7 100644
    a b class MUI_PUBLIC MythThemedMenu : public MythThemedMenuState 
    102102
    103103    bool handleAction(const QString &action, const QString &password = QString());
    104104    bool findDepends(const QString &fileList);
     105    bool findDependsExec(const QString &filename);
    105106    QString findMenuFile(const QString &menuname);
    106107
    107108    bool checkPinCode(const QString &password_setting);