remove unnecessary feed options

This commit is contained in:
Tobias Fella 2020-07-06 18:14:43 +02:00
parent 81a6b7ad90
commit 31ed1fe5c2
3 changed files with 2 additions and 38 deletions

View File

@ -57,7 +57,7 @@ bool Database::migrate()
bool Database::migrateTo1() bool Database::migrateTo1()
{ {
qDebug() << "Migrating database to version 1"; qDebug() << "Migrating database to version 1";
TRUE_OR_RETURN(execute(QStringLiteral("CREATE TABLE IF NOT EXISTS Feeds (name TEXT, url TEXT, image TEXT, link TEXT, description TEXT, deleteAfterCount INTEGER, deleteAfterType INTEGER, subscribed INTEGER, lastUpdated INTEGER, autoUpdateCount INTEGER, autoUpdateType INTEGER, notify BOOL);"))); TRUE_OR_RETURN(execute(QStringLiteral("CREATE TABLE IF NOT EXISTS Feeds (name TEXT, url TEXT, image TEXT, link TEXT, description TEXT, deleteAfterCount INTEGER, deleteAfterType INTEGER, subscribed INTEGER, lastUpdated INTEGER, notify BOOL);")));
TRUE_OR_RETURN(execute(QStringLiteral("CREATE TABLE IF NOT EXISTS Entries (feed TEXT, id TEXT UNIQUE, title TEXT, content TEXT, created INTEGER, updated INTEGER, link TEXT, read bool);"))); TRUE_OR_RETURN(execute(QStringLiteral("CREATE TABLE IF NOT EXISTS Entries (feed TEXT, id TEXT UNIQUE, title TEXT, content TEXT, created INTEGER, updated INTEGER, link TEXT, read bool);")));
TRUE_OR_RETURN(execute(QStringLiteral("CREATE TABLE IF NOT EXISTS Authors (feed TEXT, id TEXT, name TEXT, uri TEXT, email TEXT);"))); TRUE_OR_RETURN(execute(QStringLiteral("CREATE TABLE IF NOT EXISTS Authors (feed TEXT, id TEXT, name TEXT, uri TEXT, email TEXT);")));
TRUE_OR_RETURN(execute(QStringLiteral("CREATE TABLE IF NOT EXISTS Enclosures (feed TEXT, id TEXT, duration INTEGER, size INTEGER, title TEXT, type STRING, url STRING);"))); TRUE_OR_RETURN(execute(QStringLiteral("CREATE TABLE IF NOT EXISTS Enclosures (feed TEXT, id TEXT, duration INTEGER, size INTEGER, title TEXT, type STRING, url STRING);")));
@ -150,7 +150,7 @@ void Database::addFeed(QString url)
QUrl urlFromInput = QUrl::fromUserInput(url); QUrl urlFromInput = QUrl::fromUserInput(url);
QSqlQuery query; QSqlQuery query;
query.prepare(QStringLiteral("INSERT INTO Feeds VALUES (:name, :url, :image, :link, :description, :deleteAfterCount, :deleteAfterType, :subscribed, :lastUpdated, :autoUpdateCount, :autoUpdateType, :notify);")); query.prepare(QStringLiteral("INSERT INTO Feeds VALUES (:name, :url, :image, :link, :description, :deleteAfterCount, :deleteAfterType, :subscribed, :lastUpdated, :notify);"));
query.bindValue(QStringLiteral(":name"), urlFromInput.toString()); query.bindValue(QStringLiteral(":name"), urlFromInput.toString());
query.bindValue(QStringLiteral(":url"), urlFromInput.toString()); query.bindValue(QStringLiteral(":url"), urlFromInput.toString());
query.bindValue(QStringLiteral(":image"), QLatin1String("")); query.bindValue(QStringLiteral(":image"), QLatin1String(""));
@ -160,8 +160,6 @@ void Database::addFeed(QString url)
query.bindValue(QStringLiteral(":deleteAfterType"), 0); query.bindValue(QStringLiteral(":deleteAfterType"), 0);
query.bindValue(QStringLiteral(":subscribed"), QDateTime::currentDateTime().toSecsSinceEpoch()); query.bindValue(QStringLiteral(":subscribed"), QDateTime::currentDateTime().toSecsSinceEpoch());
query.bindValue(QStringLiteral(":lastUpdated"), 0); query.bindValue(QStringLiteral(":lastUpdated"), 0);
query.bindValue(QStringLiteral(":autoUpdateCount"), 0);
query.bindValue(QStringLiteral(":autoUpdateType"), 0);
query.bindValue(QStringLiteral(":notify"), false); query.bindValue(QStringLiteral(":notify"), false);
execute(query); execute(query);

View File

@ -54,8 +54,6 @@ Feed::Feed(int index)
m_description = query.value(QStringLiteral("description")).toString(); m_description = query.value(QStringLiteral("description")).toString();
m_deleteAfterCount = query.value(QStringLiteral("deleteAfterCount")).toInt(); m_deleteAfterCount = query.value(QStringLiteral("deleteAfterCount")).toInt();
m_deleteAfterType = query.value(QStringLiteral("deleteAfterType")).toInt(); m_deleteAfterType = query.value(QStringLiteral("deleteAfterType")).toInt();
m_autoUpdateCount = query.value(QStringLiteral("autoUpdateCount")).toInt();
m_autoUpdateType = query.value(QStringLiteral("autoUpdateType")).toInt();
m_notify = query.value(QStringLiteral("notify")).toBool(); m_notify = query.value(QStringLiteral("notify")).toBool();
m_errorId = 0; m_errorId = 0;
@ -142,16 +140,6 @@ QDateTime Feed::lastUpdated() const
return m_lastUpdated; return m_lastUpdated;
} }
int Feed::autoUpdateCount() const
{
return m_autoUpdateCount;
}
int Feed::autoUpdateType() const
{
return m_autoUpdateType;
}
bool Feed::notify() const bool Feed::notify() const
{ {
return m_notify; return m_notify;
@ -242,18 +230,6 @@ void Feed::setLastUpdated(QDateTime lastUpdated)
Q_EMIT lastUpdatedChanged(m_lastUpdated); Q_EMIT lastUpdatedChanged(m_lastUpdated);
} }
void Feed::setAutoUpdateCount(int count)
{
m_autoUpdateCount = count;
Q_EMIT autoUpdateCountChanged(m_autoUpdateCount);
}
void Feed::setAutoUpdateType(int type)
{
m_autoUpdateType = type;
Q_EMIT autoUpdateTypeChanged(m_autoUpdateType);
}
void Feed::setNotify(bool notify) void Feed::setNotify(bool notify)
{ {
m_notify = notify; m_notify = notify;

View File

@ -41,8 +41,6 @@ class Feed : public QObject
Q_PROPERTY(int deleteAfterType READ deleteAfterType WRITE setDeleteAfterType NOTIFY deleteAfterTypeChanged) Q_PROPERTY(int deleteAfterType READ deleteAfterType WRITE setDeleteAfterType NOTIFY deleteAfterTypeChanged)
Q_PROPERTY(QDateTime subscribed READ subscribed CONSTANT) Q_PROPERTY(QDateTime subscribed READ subscribed CONSTANT)
Q_PROPERTY(QDateTime lastUpdated READ lastUpdated WRITE setLastUpdated NOTIFY lastUpdatedChanged) Q_PROPERTY(QDateTime lastUpdated READ lastUpdated WRITE setLastUpdated NOTIFY lastUpdatedChanged)
Q_PROPERTY(int autoUpdateCount READ autoUpdateCount WRITE setAutoUpdateCount NOTIFY autoUpdateCountChanged)
Q_PROPERTY(int autoUpdateType READ autoUpdateType WRITE setAutoUpdateType NOTIFY autoUpdateCountChanged)
Q_PROPERTY(bool notify READ notify WRITE setNotify NOTIFY notifyChanged) Q_PROPERTY(bool notify READ notify WRITE setNotify NOTIFY notifyChanged)
Q_PROPERTY(int entryCount READ entryCount NOTIFY entryCountChanged) Q_PROPERTY(int entryCount READ entryCount NOTIFY entryCountChanged)
Q_PROPERTY(int unreadEntryCount READ unreadEntryCount NOTIFY unreadEntryCountChanged) Q_PROPERTY(int unreadEntryCount READ unreadEntryCount NOTIFY unreadEntryCountChanged)
@ -64,8 +62,6 @@ public:
int deleteAfterType() const; int deleteAfterType() const;
QDateTime subscribed() const; QDateTime subscribed() const;
QDateTime lastUpdated() const; QDateTime lastUpdated() const;
int autoUpdateCount() const;
int autoUpdateType() const;
bool notify() const; bool notify() const;
int entryCount() const; int entryCount() const;
int unreadEntryCount() const; int unreadEntryCount() const;
@ -83,8 +79,6 @@ public:
void setDeleteAfterCount(int count); void setDeleteAfterCount(int count);
void setDeleteAfterType(int type); void setDeleteAfterType(int type);
void setLastUpdated(QDateTime lastUpdated); void setLastUpdated(QDateTime lastUpdated);
void setAutoUpdateCount(int count);
void setAutoUpdateType(int type);
void setNotify(bool notify); void setNotify(bool notify);
void setRefreshing(bool refreshing); void setRefreshing(bool refreshing);
void setErrorId(int errorId); void setErrorId(int errorId);
@ -102,8 +96,6 @@ Q_SIGNALS:
void deleteAfterCountChanged(int count); void deleteAfterCountChanged(int count);
void deleteAfterTypeChanged(int type); void deleteAfterTypeChanged(int type);
void lastUpdatedChanged(QDateTime lastUpdated); void lastUpdatedChanged(QDateTime lastUpdated);
void autoUpdateCountChanged(int count);
void autoUpdateTypeChanged(int type);
void notifyChanged(bool notify); void notifyChanged(bool notify);
void entryCountChanged(); void entryCountChanged();
void unreadEntryCountChanged(); void unreadEntryCountChanged();
@ -123,8 +115,6 @@ private:
int m_deleteAfterType; int m_deleteAfterType;
QDateTime m_subscribed; QDateTime m_subscribed;
QDateTime m_lastUpdated; QDateTime m_lastUpdated;
int m_autoUpdateCount;
int m_autoUpdateType;
bool m_notify; bool m_notify;
int m_errorId; int m_errorId;
QString m_errorString; QString m_errorString;