Some const/pointers.

This commit is contained in:
Martin Rotter 2016-01-05 12:11:03 +01:00
parent f64d6d1694
commit 1489365d32
8 changed files with 8 additions and 9 deletions

View File

@ -726,7 +726,7 @@ bool FeedsModel::emptyAllBins() {
void FeedsModel::loadActivatedServiceAccounts() {
// Iterate all globally available feed "service plugins".
foreach (ServiceEntryPoint *entry_point, qApp->feedServices()) {
foreach (const ServiceEntryPoint *entry_point, qApp->feedServices()) {
// Load all stored root nodes from the entry point and add those to the model.
QList<ServiceRoot*> roots = entry_point->initializeSubtree();

View File

@ -29,7 +29,7 @@
#include <QTextStream>
FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout) {
FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout()) {
m_ui->setupUi(this);
// Set flags and attributes.
@ -54,7 +54,6 @@ FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout)
FormAbout::~FormAbout() {
qDebug("Destroying FormAbout instance.");
delete m_ui;
}
void FormAbout::loadSettingsAndPaths() {

2
src/gui/dialogs/formabout.h Normal file → Executable file
View File

@ -41,7 +41,7 @@ class FormAbout : public QDialog {
void loadLicenseAndInformation();
void loadSettingsAndPaths();
Ui::FormAbout *m_ui;
QScopedPointer<Ui::FormAbout> m_ui;
};
#endif // FORMABOUT_H

View File

@ -47,7 +47,7 @@ class ServiceEntryPoint {
// point from persistent DB.
// Returns list of root nodes which will be afterwards added
// to the global feed model.
virtual QList<ServiceRoot*> initializeSubtree() = 0;
virtual QList<ServiceRoot*> initializeSubtree() const = 0;
// Can this service account be added just once?
// NOTE: This is true particularly for "standard" service

View File

@ -85,7 +85,7 @@ ServiceRoot *StandardServiceEntryPoint::createNewRoot() {
}
}
QList<ServiceRoot*> StandardServiceEntryPoint::initializeSubtree() {
QList<ServiceRoot*> StandardServiceEntryPoint::initializeSubtree() const {
// Check DB if standard account is enabled.
QSqlDatabase database = qApp->database()->connection(QSL("StandardServiceEntryPoint"), DatabaseFactory::FromSettings);
QSqlQuery query(database);

View File

@ -35,7 +35,7 @@ class StandardServiceEntryPoint : public ServiceEntryPoint {
QString code();
ServiceRoot *createNewRoot();
QList<ServiceRoot*> initializeSubtree();
QList<ServiceRoot*> initializeSubtree() const;
};
#endif // STANDARDSERVICEENTRYPOINT_H

View File

@ -79,7 +79,7 @@ ServiceRoot *TtRssServiceEntryPoint::createNewRoot() {
return new_root;
}
QList<ServiceRoot*> TtRssServiceEntryPoint::initializeSubtree() {
QList<ServiceRoot*> TtRssServiceEntryPoint::initializeSubtree() const {
// Check DB if standard account is enabled.
QSqlDatabase database = qApp->database()->connection(QSL("TtRssServiceEntryPoint"), DatabaseFactory::FromSettings);
QSqlQuery query(database);

View File

@ -36,7 +36,7 @@ class TtRssServiceEntryPoint : public ServiceEntryPoint {
QString code();
ServiceRoot *createNewRoot();
QList<ServiceRoot*> initializeSubtree();
QList<ServiceRoot*> initializeSubtree() const;
};
#endif // TTRSSSERVICEENTRYPOINT_H