mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-16 15:41:13 +02:00
2023-04-12 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDReplicator::roundDownToDow()' methods. * Added a 'Westwood One Wegener Portal' replicator. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -205,6 +205,10 @@ QString RDReplicator::typeString(RDReplicator::Type type)
|
||||
ret="Citadel X-Digital Portal";
|
||||
break;
|
||||
|
||||
case RDReplicator::TypeWw1Ipump:
|
||||
ret="Westwood One Wegener Portal";
|
||||
break;
|
||||
|
||||
case RDReplicator::TypeLast:
|
||||
break;
|
||||
}
|
||||
@@ -212,6 +216,22 @@ QString RDReplicator::typeString(RDReplicator::Type type)
|
||||
}
|
||||
|
||||
|
||||
QDate RDReplicator::roundDownToDow(const QDate &date,int dow)
|
||||
{
|
||||
return date.addDays(-(date.dayOfWeek()-dow));
|
||||
}
|
||||
|
||||
|
||||
QDateTime RDReplicator::roundDownToDow(const QDateTime &dt,int dow)
|
||||
{
|
||||
QDateTime ret=dt;
|
||||
|
||||
ret.setDate(RDReplicator::roundDownToDow(dt.date(),dow));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
QVariant RDReplicator::GetValue(const QString &field) const
|
||||
{
|
||||
QVariant ret;
|
||||
|
@@ -28,7 +28,7 @@
|
||||
class RDReplicator
|
||||
{
|
||||
public:
|
||||
enum Type {TypeCitadelXds=0,TypeLast=1};
|
||||
enum Type {TypeCitadelXds=0,TypeWw1Ipump=1,TypeLast=2};
|
||||
RDReplicator(const QString &name);
|
||||
QString name() const;
|
||||
RDReplicator::Type type() const;
|
||||
@@ -58,6 +58,8 @@ class RDReplicator
|
||||
int normalizeLevel() const;
|
||||
void setNormalizeLevel(int lvl) const;
|
||||
QString typeString() const;
|
||||
static QDate roundDownToDow(const QDate &date,int dow);
|
||||
static QDateTime roundDownToDow(const QDateTime &dt,int dow);
|
||||
static QString typeString(RDReplicator::Type type);
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user