Ticket #5345: mythvideo_file_assoc_patch.diff

File mythvideo_file_assoc_patch.diff, 2.2 KB (added by joant@…, 13 years ago)

Patch as promised

  • dbcheck.cpp

     
    108108        {
    109109            const QString updates2[] = {
    110110    "INSERT INTO videotypes (extension, playcommand, f_ignore, use_default)"
    111     "    VALUES ('txt', '', 1, 0);",
     111    "    VALUES ('txt', '/bin/false', 1, 0);",
    112112    "INSERT INTO videotypes (extension, playcommand, f_ignore, use_default)"
    113     "    VALUES ('log', '', 1, 0);",
     113    "    VALUES ('log', '/bin/false', 1, 0);",
    114114    "INSERT INTO videotypes (extension, playcommand, f_ignore, use_default)"
    115115    "    VALUES ('mpg', 'Internal', 0, 0);",
    116116    "INSERT INTO videotypes (extension, playcommand, f_ignore, use_default)"
    117     "    VALUES ('avi', '', 0, 1);",
     117    "    VALUES ('avi', 'Internal', 0, 1);",
    118118    "INSERT INTO videotypes (extension, playcommand, f_ignore, use_default)"
    119119    "    VALUES ('vob', 'Internal', 0, 0);",
    120120    "INSERT INTO videotypes (extension, playcommand, f_ignore, use_default)"
  • fileassoc.cpp

     
    2424    //
    2525
    2626  public:
    27     FileAssociation(const QString &new_extension) :
    28         id(-1), extension(new_extension), ignore(false), use_default(true),
    29         changed(true), loaded_from_db(false) {}
     27    FileAssociation(const QString &new_extension, const QString &cmd) :
     28        id(-1), extension(new_extension), player_command(cmd), ignore(false),
     29        use_default(true), changed(true), loaded_from_db(false) {}
    3030    FileAssociation(int i, const QString &e, const QString &p, bool g, bool u) :
    3131        id(i), extension(e), player_command(p), ignore(g), use_default(u),
    3232        changed(false), loaded_from_db(true) {}
     
    393393    QString new_extension = new_extension_editor->text();
    394394    if (new_extension.length() > 0)
    395395    {
    396         FileAssociation *new_fa = new FileAssociation(new_extension);
     396        FileAssociation *new_fa = new FileAssociation(new_extension,
     397                                                      "Internal");
    397398        file_associations.append(new_fa);
    398399        current_fa = new_fa;
    399400    }