Ticket #6437: setchanged1.patch

File setchanged1.patch, 6.7 KB (added by gigem, 11 years ago)
  • libs/libmythtv/videosource.h

     
    398398
    399399    void Save(void)
    400400    {
    401         changed = true;
     401        SetSaveRequired();
    402402        settingValue = "";
    403403        SimpleDBStorage::Save();
    404404    }
    405405    void Save(QString destination)
    406406    {
    407         changed = true;
     407        SetSaveRequired();
    408408        settingValue = "";
    409409        SimpleDBStorage::Save(destination);
    410410    }
     
    423423    };
    424424    void Save(void)
    425425    {
    426         changed = true;
     426        SetSaveRequired();
    427427        settingValue = "";
    428428        SimpleDBStorage::Save();
    429429    }
    430430    void Save(QString destination)
    431431    {
    432         changed = true;
     432        SetSaveRequired();
    433433        settingValue = "";
    434434        SimpleDBStorage::Save(destination);
    435435    }
  • libs/libmythtv/scheduledrecording.cpp

     
    130130                                      search->intValue() == kManualSearch);
    131131
    132132        type->setValue(tmpType);
    133         type->setUnchanged();
    134133
    135134        fetchChannelInfo();
    136135    }
     
    488487
    489488void ScheduledRecording::save(bool sendSig)
    490489{
    491     if (type->isChanged() && getRecordingType() == kNotRecording)
     490    if (type->IsSaveRequired() && getRecordingType() == kNotRecording)
    492491    {
    493492        remove();
    494493    }
     
    516515
    517516void ScheduledRecording::Save(QString destination)
    518517{
    519     if (type->isChanged() && getRecordingType() == kNotRecording)
     518    if (type->IsSaveRequired() && getRecordingType() == kNotRecording)
    520519    {
    521520        remove();
    522521    }
     
    971970    inactive->setValue(0);
    972971
    973972    if (search->intValue() == kManualSearch)
    974         search->setChanged();
     973        search->SetSaveRequired();
    975974    else
    976975        search->setValue(kNoSearch);
    977976
     
    979978
    980979    parentid->setValue(m_pginfo->recordid);
    981980
    982     profile->setChanged();
    983     dupin->setChanged();
    984     dupmethod->setChanged();
    985     autoexpire->setChanged();
    986     autotranscode->setChanged();
    987     autocommflag->setChanged();
    988     autouserjob1->setChanged();
    989     autouserjob2->setChanged();
    990     autouserjob3->setChanged();
    991     autouserjob4->setChanged();
    992     maxepisodes->setChanged();
    993     maxnewest->setChanged();
    994     startoffset->setChanged();
    995     endoffset->setChanged();
    996     recpriority->setChanged();
    997     recgroup->setChanged();
    998     storagegroup->setChanged();
    999     playgroup->setChanged();
     981    profile->SetSaveRequired();
     982    dupin->SetSaveRequired();
     983    dupmethod->SetSaveRequired();
     984    autoexpire->SetSaveRequired();
     985    autotranscode->SetSaveRequired();
     986    autocommflag->SetSaveRequired();
     987    autouserjob1->SetSaveRequired();
     988    autouserjob2->SetSaveRequired();
     989    autouserjob3->SetSaveRequired();
     990    autouserjob4->SetSaveRequired();
     991    maxepisodes->SetSaveRequired();
     992    maxnewest->SetSaveRequired();
     993    startoffset->SetSaveRequired();
     994    endoffset->SetSaveRequired();
     995    recpriority->SetSaveRequired();
     996    recgroup->SetSaveRequired();
     997    storagegroup->SetSaveRequired();
     998    playgroup->SetSaveRequired();
    1000999}
    10011000
    10021001void
  • libs/libmyth/settings.cpp

     
    9696void Setting::setValue(const QString &newValue)
    9797{
    9898    settingValue = newValue;
    99     SetChanged(true);
    10099    emit valueChanged(settingValue);
    101100}
    102101
  • libs/libmyth/settings.h

     
    9797
    9898  public:
    9999    // Gets
    100     bool isChanged(void) const { return changed; }
    101100    virtual QString getValue(void) const;
    102101
    103102    // non-const Gets
    104103    virtual Setting *byName(const QString &name)
    105104        { return (name == configName) ? this : NULL; }
    106105
    107     // Sets
    108     void SetChanged(bool c) { changed = c;       }
    109     void setUnchanged(void) { SetChanged(false); }
    110     void setChanged(void)   { SetChanged(true);  }
    111 
    112106    // StorageUser
    113107    void SetDBValue(const QString &val) { setValue(val); }
    114108    QString GetDBValue(void) const { return getValue(); }
     
    119113    void valueChanged(const QString&);
    120114
    121115  protected:
    122     Setting(Storage *_storage) : Configurable(_storage), changed(false) {};
     116    Setting(Storage *_storage) : Configurable(_storage) {};
    123117    virtual ~Setting() {};
    124118
    125119  protected:
    126120    QString settingValue;
    127     bool    changed;
    128121};
    129122
    130123///////////////////////////////////////////////////////////////////////////////
  • libs/libmythdb/mythstorage.h

     
    5151  public:
    5252    SimpleDBStorage(StorageUser *_user,
    5353                    QString _table, QString _column) :
    54         DBStorage(_user, _table, _column) { initval.clear(); }
     54        DBStorage(_user, _table, _column) { initval = QString(); }
    5555    virtual ~SimpleDBStorage() { }
    5656
    5757    virtual void Load(void);
    5858    virtual void Save(void);
    5959    virtual void Save(QString destination);
     60    virtual bool IsSaveRequired(void) const;
     61    virtual void SetSaveRequired(void);
    6062
    6163  protected:
    6264    virtual QString GetWhereClause(MSqlBindings &bindings) const = 0;
    6365    virtual QString GetSetClause(MSqlBindings &bindings) const;
    64     virtual bool    IsSaveRequired(void) const;
    6566
    6667  protected:
    6768    QString initval;
  • libs/libmythdb/mythversion.h

     
    88/// Update this whenever the plug-in API changes.
    99/// Including changes in the libmyth, libmythtv and libmythui class methods
    1010/// used by plug-ins.
    11 #define MYTH_BINARY_VERSION "0.22.20090312-1"
     11#define MYTH_BINARY_VERSION "0.22.20090409-1"
    1212
    1313/** \brief Increment this whenever the MythTV network protocol changes.
    1414 *
  • libs/libmythdb/mythstorage.cpp

     
    9999    return user->GetDBValue() != initval;
    100100}
    101101
     102void SimpleDBStorage::SetSaveRequired(void)
     103{
     104    initval = QString();
     105}
     106
    102107//////////////////////////////////////////////////////////////////////
    103108
    104109QString GenericDBStorage::GetWhereClause(MSqlBindings &bindings) const