Add std acc when no account is active.

This commit is contained in:
Martin Rotter 2017-09-09 09:21:30 +02:00
parent a01023629c
commit c4fec28e56
5 changed files with 2153 additions and 70 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,9 @@
3.4.3
—————
Added:
▪ Standard account is now automatically added if RSS Guard is started with empty database.
Fixed:
▪ Fixed build on some Unit-like operating systems.

View File

@ -187,6 +187,7 @@ win32 {
}
DISTFILES += resources/scripts/astyle/.astylerc \
resources/scripts/uncrustify/uncrustify.cfg \
resources/scripts/uncrustify/uncrustify.cfg
MOC_DIR = $$OUT_PWD/moc

View File

@ -23,6 +23,7 @@
#include "services/abstract/serviceroot.h"
#include "services/abstract/recyclebin.h"
#include "services/abstract/serviceentrypoint.h"
#include "services/standard/standardserviceentrypoint.h"
#include "services/standard/standardserviceroot.h"
#include "miscellaneous/textfactory.h"
#include "miscellaneous/databasefactory.h"
@ -34,6 +35,7 @@
#include <QPair>
#include <QStack>
#include <QMimeData>
#include <QTimer>
#include <algorithm>
@ -49,8 +51,8 @@ FeedsModel::FeedsModel(QObject* parent) : QAbstractItemModel(parent) {
m_countsIcon = qApp->icons()->fromTheme(QSL("mail-mark-unread"));
// : Title text in the feed list header.
m_headerData << tr("Title");
m_tooltipData << /*: Feed list header "titles" column tooltip.*/ tr("Titles of feeds/categories.") <<
/*: Feed list header "counts" column tooltip.*/ tr("Counts of unread/all mesages.");
m_tooltipData << /*: Feed list header "titles" column tooltip.*/ tr("Titles of feeds/categories.")
<< /*: Feed list header "counts" column tooltip.*/ tr("Counts of unread/all mesages.");
}
FeedsModel::~FeedsModel() {
@ -513,6 +515,12 @@ void FeedsModel::loadActivatedServiceAccounts() {
addServiceAccount(root, false);
}
}
if (serviceRoots().isEmpty()) {
QTimer::singleShot(2000, [this]() {
addServiceAccount(StandardServiceEntryPoint().createNewRoot(), true);
});
}
}
void FeedsModel::stopServiceAccounts() {

View File

@ -59,7 +59,7 @@ StandardServiceRoot::~StandardServiceRoot() {
void StandardServiceRoot::start(bool freshly_activated) {
loadFromDatabase();
if (freshly_activated) {
if (freshly_activated && getSubTree(RootItemKind::Feed).isEmpty()) {
// In other words, if there are no feeds or categories added.
if (MessageBox::show(qApp->mainFormWidget(), QMessageBox::Question, QObject::tr("Load initial set of feeds"),
tr("This new account does not include any feeds. You can now add default set of feeds."),