Const refactoring.
This commit is contained in:
parent
112d5dcc28
commit
d7470c7465
30 changed files with 115 additions and 183 deletions
|
@ -495,9 +495,9 @@ QList<ServiceRoot*> FeedsModel::serviceRoots() const {
|
||||||
return roots;
|
return roots;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeedsModel::containsServiceRootFromEntryPoint(ServiceEntryPoint *point) const {
|
bool FeedsModel::containsServiceRootFromEntryPoint(const ServiceEntryPoint *point) const {
|
||||||
foreach (RootItem *root, serviceRoots()) {
|
foreach (const ServiceRoot *root, serviceRoots()) {
|
||||||
if (root->toServiceRoot()->code() == point->code()) {
|
if (root->code() == point->code()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -506,7 +506,7 @@ bool FeedsModel::containsServiceRootFromEntryPoint(ServiceEntryPoint *point) con
|
||||||
}
|
}
|
||||||
|
|
||||||
StandardServiceRoot *FeedsModel::standardServiceRoot() const {
|
StandardServiceRoot *FeedsModel::standardServiceRoot() const {
|
||||||
foreach (RootItem *root, serviceRoots()) {
|
foreach (ServiceRoot *root, serviceRoots()) {
|
||||||
StandardServiceRoot *std_service_root;
|
StandardServiceRoot *std_service_root;
|
||||||
|
|
||||||
if ((std_service_root = dynamic_cast<StandardServiceRoot*>(root)) != NULL) {
|
if ((std_service_root = dynamic_cast<StandardServiceRoot*>(root)) != NULL) {
|
||||||
|
|
|
@ -84,7 +84,7 @@ class FeedsModel : public QAbstractItemModel {
|
||||||
QList<ServiceRoot*> serviceRoots() const;
|
QList<ServiceRoot*> serviceRoots() const;
|
||||||
|
|
||||||
// Determines if there is any account activated from given entry point.
|
// Determines if there is any account activated from given entry point.
|
||||||
bool containsServiceRootFromEntryPoint(ServiceEntryPoint *point) const;
|
bool containsServiceRootFromEntryPoint(const ServiceEntryPoint *point) const;
|
||||||
|
|
||||||
// Direct and the only global accessor to standard service root.
|
// Direct and the only global accessor to standard service root.
|
||||||
// NOTE: Standard service root is always activated.
|
// NOTE: Standard service root is always activated.
|
||||||
|
|
20
src/exceptions/ioexception.h
Normal file → Executable file
20
src/exceptions/ioexception.h
Normal file → Executable file
|
@ -1,11 +1,27 @@
|
||||||
|
// This file is part of RSS Guard.
|
||||||
|
//
|
||||||
|
// Copyright (C) 2011-2015 by Martin Rotter <rotter.martinos@gmail.com>
|
||||||
|
//
|
||||||
|
// RSS Guard is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// RSS Guard is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#ifndef IOEXCEPTION_H
|
#ifndef IOEXCEPTION_H
|
||||||
#define IOEXCEPTION_H
|
#define IOEXCEPTION_H
|
||||||
|
|
||||||
#include "exceptions/applicationexception.h"
|
#include "exceptions/applicationexception.h"
|
||||||
|
|
||||||
|
|
||||||
class IOException : public ApplicationException
|
class IOException : public ApplicationException {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
explicit IOException(const QString &message = QString());
|
explicit IOException(const QString &message = QString());
|
||||||
virtual ~IOException();
|
virtual ~IOException();
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
#include "miscellaneous/textfactory.h"
|
#include "miscellaneous/textfactory.h"
|
||||||
#include "miscellaneous/settingsproperties.h"
|
#include "miscellaneous/settingsproperties.h"
|
||||||
|
|
||||||
#if !defined(Q_OS_WIN)
|
|
||||||
#include "gui/messagebox.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
|
@ -39,10 +35,6 @@ FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout(
|
||||||
//: About RSS Guard dialog title.
|
//: About RSS Guard dialog title.
|
||||||
setWindowTitle(tr("About %1").arg(APP_NAME));
|
setWindowTitle(tr("About %1").arg(APP_NAME));
|
||||||
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
MessageBox::iconify(m_ui->m_buttonBox);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_ui->m_lblIcon->setPixmap(QPixmap(APP_ICON_PATH));
|
m_ui->m_lblIcon->setPixmap(QPixmap(APP_ICON_PATH));
|
||||||
|
|
||||||
// Load information from embedded text files.
|
// Load information from embedded text files.
|
||||||
|
|
|
@ -22,10 +22,6 @@
|
||||||
#include "core/feedsmodel.h"
|
#include "core/feedsmodel.h"
|
||||||
#include "services/standard/standardserviceentrypoint.h"
|
#include "services/standard/standardserviceentrypoint.h"
|
||||||
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
#include "gui/messagebox.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
FormAddAccount::FormAddAccount(const QList<ServiceEntryPoint*> &entry_points, FeedsModel *model, QWidget *parent)
|
FormAddAccount::FormAddAccount(const QList<ServiceEntryPoint*> &entry_points, FeedsModel *model, QWidget *parent)
|
||||||
: QDialog(parent), m_ui(new Ui::FormAddAccount), m_model(model), m_entryPoints(entry_points) {
|
: QDialog(parent), m_ui(new Ui::FormAddAccount), m_model(model), m_entryPoints(entry_points) {
|
||||||
|
@ -35,10 +31,6 @@ FormAddAccount::FormAddAccount(const QList<ServiceEntryPoint*> &entry_points, Fe
|
||||||
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint);
|
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint);
|
||||||
setWindowIcon(qApp->icons()->fromTheme(QSL("item-new")));
|
setWindowIcon(qApp->icons()->fromTheme(QSL("item-new")));
|
||||||
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
MessageBox::iconify(m_ui->m_buttonBox);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
connect(m_ui->m_listEntryPoints, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(addSelectedAccount()));
|
connect(m_ui->m_listEntryPoints, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(addSelectedAccount()));
|
||||||
connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(addSelectedAccount()));
|
connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(addSelectedAccount()));
|
||||||
connect(m_ui->m_listEntryPoints, SIGNAL(itemSelectionChanged()), this, SLOT(displayActiveEntryPointDetails()));
|
connect(m_ui->m_listEntryPoints, SIGNAL(itemSelectionChanged()), this, SLOT(displayActiveEntryPointDetails()));
|
||||||
|
@ -46,7 +38,7 @@ FormAddAccount::FormAddAccount(const QList<ServiceEntryPoint*> &entry_points, Fe
|
||||||
}
|
}
|
||||||
|
|
||||||
FormAddAccount::~FormAddAccount() {
|
FormAddAccount::~FormAddAccount() {
|
||||||
delete m_ui;
|
qDebug("Destroying FormAddAccount instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormAddAccount::addSelectedAccount() {
|
void FormAddAccount::addSelectedAccount() {
|
||||||
|
@ -64,7 +56,7 @@ void FormAddAccount::addSelectedAccount() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormAddAccount::displayActiveEntryPointDetails() {
|
void FormAddAccount::displayActiveEntryPointDetails() {
|
||||||
ServiceEntryPoint *point = selectedEntryPoint();
|
const ServiceEntryPoint *point = selectedEntryPoint();
|
||||||
|
|
||||||
m_ui->m_txtAuthor->setText(point->author());
|
m_ui->m_txtAuthor->setText(point->author());
|
||||||
m_ui->m_txtDescription->setText(point->description());
|
m_ui->m_txtDescription->setText(point->description());
|
||||||
|
@ -72,12 +64,12 @@ void FormAddAccount::displayActiveEntryPointDetails() {
|
||||||
m_ui->m_txtVersion->setText(point->version());
|
m_ui->m_txtVersion->setText(point->version());
|
||||||
}
|
}
|
||||||
|
|
||||||
ServiceEntryPoint *FormAddAccount::selectedEntryPoint() {
|
ServiceEntryPoint *FormAddAccount::selectedEntryPoint() const {
|
||||||
return m_entryPoints.at(m_ui->m_listEntryPoints->currentRow());
|
return m_entryPoints.at(m_ui->m_listEntryPoints->currentRow());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormAddAccount::loadEntryPoints() {
|
void FormAddAccount::loadEntryPoints() {
|
||||||
foreach (ServiceEntryPoint *entry_point, m_entryPoints) {
|
foreach (const ServiceEntryPoint *entry_point, m_entryPoints) {
|
||||||
QListWidgetItem *item = new QListWidgetItem(entry_point->icon(), entry_point->name(), m_ui->m_listEntryPoints);
|
QListWidgetItem *item = new QListWidgetItem(entry_point->icon(), entry_point->name(), m_ui->m_listEntryPoints);
|
||||||
|
|
||||||
if (entry_point->isSingleInstanceService() && m_model->containsServiceRootFromEntryPoint(entry_point)) {
|
if (entry_point->isSingleInstanceService() && m_model->containsServiceRootFromEntryPoint(entry_point)) {
|
||||||
|
|
|
@ -42,10 +42,10 @@ class FormAddAccount : public QDialog {
|
||||||
void displayActiveEntryPointDetails();
|
void displayActiveEntryPointDetails();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ServiceEntryPoint *selectedEntryPoint();
|
ServiceEntryPoint *selectedEntryPoint() const;
|
||||||
void loadEntryPoints();
|
void loadEntryPoints();
|
||||||
|
|
||||||
Ui::FormAddAccount *m_ui;
|
QScopedPointer<Ui::FormAddAccount> m_ui;
|
||||||
FeedsModel *m_model;
|
FeedsModel *m_model;
|
||||||
QList<ServiceEntryPoint*> m_entryPoints;
|
QList<ServiceEntryPoint*> m_entryPoints;
|
||||||
};
|
};
|
||||||
|
|
|
@ -53,7 +53,7 @@ FormBackupDatabaseSettings::FormBackupDatabaseSettings(QWidget *parent) : QDialo
|
||||||
}
|
}
|
||||||
|
|
||||||
FormBackupDatabaseSettings::~FormBackupDatabaseSettings() {
|
FormBackupDatabaseSettings::~FormBackupDatabaseSettings() {
|
||||||
delete m_ui;
|
qDebug("Destroying FormBackupDatabaseSettings instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormBackupDatabaseSettings::performBackup() {
|
void FormBackupDatabaseSettings::performBackup() {
|
||||||
|
@ -64,7 +64,7 @@ void FormBackupDatabaseSettings::performBackup() {
|
||||||
tr("Backup was created successfully and stored in target directory."),
|
tr("Backup was created successfully and stored in target directory."),
|
||||||
tr("Backup was created successfully."));
|
tr("Backup was created successfully."));
|
||||||
}
|
}
|
||||||
catch (ApplicationException &ex) {
|
catch (const ApplicationException &ex) {
|
||||||
m_ui->m_lblResult->setStatus(WidgetWithStatus::Error, ex.message(), tr("Backup failed."));
|
m_ui->m_lblResult->setStatus(WidgetWithStatus::Error, ex.message(), tr("Backup failed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
src/gui/dialogs/formbackupdatabasesettings.h
Normal file → Executable file
2
src/gui/dialogs/formbackupdatabasesettings.h
Normal file → Executable file
|
@ -43,7 +43,7 @@ class FormBackupDatabaseSettings : public QDialog {
|
||||||
void checkOkButton();
|
void checkOkButton();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::FormBackupDatabaseSettings *m_ui;
|
QScopedPointer<Ui::FormBackupDatabaseSettings> m_ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FORMBACKUPDATABASECONFIG_H
|
#endif // FORMBACKUPDATABASECONFIG_H
|
||||||
|
|
|
@ -38,7 +38,7 @@ FormDatabaseCleanup::FormDatabaseCleanup(QWidget *parent) : QDialog(parent), m_u
|
||||||
}
|
}
|
||||||
|
|
||||||
FormDatabaseCleanup::~FormDatabaseCleanup() {
|
FormDatabaseCleanup::~FormDatabaseCleanup() {
|
||||||
delete m_ui;
|
qDebug("Destroying FormDatabaseCleanup instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormDatabaseCleanup::setCleaner(DatabaseCleaner *cleaner) {
|
void FormDatabaseCleanup::setCleaner(DatabaseCleaner *cleaner) {
|
||||||
|
|
3
src/gui/dialogs/formdatabasecleanup.h
Normal file → Executable file
3
src/gui/dialogs/formdatabasecleanup.h
Normal file → Executable file
|
@ -45,7 +45,6 @@ class FormDatabaseCleanup : public QDialog {
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateDaysSuffix(int number);
|
void updateDaysSuffix(int number);
|
||||||
|
|
||||||
void startPurging();
|
void startPurging();
|
||||||
void onPurgeStarted();
|
void onPurgeStarted();
|
||||||
void onPurgeProgress(int progress, const QString &description);
|
void onPurgeProgress(int progress, const QString &description);
|
||||||
|
@ -58,7 +57,7 @@ class FormDatabaseCleanup : public QDialog {
|
||||||
void loadDatabaseInfo();
|
void loadDatabaseInfo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::FormDatabaseCleanup *m_ui;
|
QScopedPointer<Ui::FormDatabaseCleanup> m_ui;
|
||||||
DatabaseCleaner *m_cleaner;
|
DatabaseCleaner *m_cleaner;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QSessionManager>
|
#include <QSessionManager>
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
|
#include <QScopedPointer>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QReadWriteLock>
|
#include <QReadWriteLock>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
@ -85,10 +86,10 @@ FormMain::FormMain(QWidget *parent, Qt::WindowFlags f)
|
||||||
}
|
}
|
||||||
|
|
||||||
FormMain::~FormMain() {
|
FormMain::~FormMain() {
|
||||||
delete m_ui;
|
qDebug("Destroying FormDatabaseCleanup instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> FormMain::allActions() {
|
QList<QAction*> FormMain::allActions() const {
|
||||||
QList<QAction*> actions;
|
QList<QAction*> actions;
|
||||||
|
|
||||||
// Add basic actions.
|
// Add basic actions.
|
||||||
|
@ -172,7 +173,8 @@ void FormMain::prepareMenus() {
|
||||||
void FormMain::switchFullscreenMode() {
|
void FormMain::switchFullscreenMode() {
|
||||||
if (!isFullScreen()) {
|
if (!isFullScreen()) {
|
||||||
showFullScreen();
|
showFullScreen();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
showNormal();
|
showNormal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -225,7 +227,7 @@ void FormMain::updateAddItemMenu() {
|
||||||
void FormMain::updateRecycleBinMenu() {
|
void FormMain::updateRecycleBinMenu() {
|
||||||
m_ui->m_menuRecycleBin->clear();
|
m_ui->m_menuRecycleBin->clear();
|
||||||
|
|
||||||
foreach (ServiceRoot *activated_root, tabWidget()->feedMessageViewer()->feedsView()->sourceModel()->serviceRoots()) {
|
foreach (const ServiceRoot *activated_root, tabWidget()->feedMessageViewer()->feedsView()->sourceModel()->serviceRoots()) {
|
||||||
QMenu *root_menu = new QMenu(activated_root->title(), m_ui->m_menuRecycleBin);
|
QMenu *root_menu = new QMenu(activated_root->title(), m_ui->m_menuRecycleBin);
|
||||||
root_menu->setIcon(activated_root->icon());
|
root_menu->setIcon(activated_root->icon());
|
||||||
root_menu->setToolTip(activated_root->description());
|
root_menu->setToolTip(activated_root->description());
|
||||||
|
@ -414,8 +416,8 @@ void FormMain::setupIcons() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::loadSize() {
|
void FormMain::loadSize() {
|
||||||
QRect screen = qApp->desktop()->screenGeometry();
|
const QRect screen = qApp->desktop()->screenGeometry();
|
||||||
Settings *settings = qApp->settings();
|
const Settings *settings = qApp->settings();
|
||||||
|
|
||||||
// Reload main window size & position.
|
// Reload main window size & position.
|
||||||
resize(settings->value(GROUP(GUI), GUI::MainWindowInitialSize, size()).toSize());
|
resize(settings->value(GROUP(GUI), GUI::MainWindowInitialSize, size()).toSize());
|
||||||
|
@ -446,8 +448,8 @@ void FormMain::loadSize() {
|
||||||
|
|
||||||
void FormMain::saveSize() {
|
void FormMain::saveSize() {
|
||||||
Settings *settings = qApp->settings();
|
Settings *settings = qApp->settings();
|
||||||
bool is_fullscreen = isFullScreen();
|
const bool is_fullscreen = isFullScreen();
|
||||||
bool is_maximized = isMaximized();
|
const bool is_maximized = isMaximized();
|
||||||
|
|
||||||
if (is_fullscreen) {
|
if (is_fullscreen) {
|
||||||
m_ui->m_actionFullscreen->setChecked(false);
|
m_ui->m_actionFullscreen->setChecked(false);
|
||||||
|
@ -519,7 +521,7 @@ void FormMain::createConnections() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::loadWebBrowserMenu(int index) {
|
void FormMain::loadWebBrowserMenu(int index) {
|
||||||
WebBrowser *active_browser = m_ui->m_tabWidget->widget(index)->webBrowser();
|
const WebBrowser *active_browser = m_ui->m_tabWidget->widget(index)->webBrowser();
|
||||||
|
|
||||||
m_ui->m_menuCurrentTab->clear();
|
m_ui->m_menuCurrentTab->clear();
|
||||||
|
|
||||||
|
@ -539,21 +541,19 @@ void FormMain::loadWebBrowserMenu(int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::backupDatabaseSettings() {
|
void FormMain::backupDatabaseSettings() {
|
||||||
QPointer<FormBackupDatabaseSettings> form = new FormBackupDatabaseSettings(this);
|
QScopedPointer<FormBackupDatabaseSettings> form(new FormBackupDatabaseSettings(this));
|
||||||
form.data()->exec();
|
form->exec();
|
||||||
delete form.data();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::restoreDatabaseSettings() {
|
void FormMain::restoreDatabaseSettings() {
|
||||||
QPointer<FormRestoreDatabaseSettings> form = new FormRestoreDatabaseSettings(this);
|
QScopedPointer<FormRestoreDatabaseSettings> form(new FormRestoreDatabaseSettings(this));
|
||||||
form.data()->exec();
|
form->exec();
|
||||||
delete form.data();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::changeEvent(QEvent *event) {
|
void FormMain::changeEvent(QEvent *event) {
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::WindowStateChange: {
|
case QEvent::WindowStateChange: {
|
||||||
if (this->windowState() & Qt::WindowMinimized &&
|
if (windowState() & Qt::WindowMinimized &&
|
||||||
SystemTrayIcon::isSystemTrayActivated() &&
|
SystemTrayIcon::isSystemTrayActivated() &&
|
||||||
qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideMainWindowWhenMinimized)).toBool()) {
|
qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideMainWindowWhenMinimized)).toBool()) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
|
@ -571,15 +571,13 @@ void FormMain::changeEvent(QEvent *event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::showAbout() {
|
void FormMain::showAbout() {
|
||||||
QPointer<FormAbout> form_pointer = new FormAbout(this);
|
QScopedPointer<FormAbout> form_pointer(new FormAbout(this));
|
||||||
form_pointer.data()->exec();
|
form_pointer->exec();
|
||||||
delete form_pointer.data();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::showUpdates() {
|
void FormMain::showUpdates() {
|
||||||
QPointer<FormUpdate> form_update = new FormUpdate(this);
|
QScopedPointer<FormUpdate> form_update(new FormUpdate(this));
|
||||||
form_update.data()->exec();
|
form_update->exec();
|
||||||
delete form_update.data();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::showWiki() {
|
void FormMain::showWiki() {
|
||||||
|
@ -591,11 +589,10 @@ void FormMain::showWiki() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::showAddAccountDialog() {
|
void FormMain::showAddAccountDialog() {
|
||||||
QPointer<FormAddAccount> form_update = new FormAddAccount(qApp->feedServices(),
|
QScopedPointer<FormAddAccount> form_update(new FormAddAccount(qApp->feedServices(),
|
||||||
tabWidget()->feedMessageViewer()->feedsView()->sourceModel(),
|
tabWidget()->feedMessageViewer()->feedsView()->sourceModel(),
|
||||||
this);
|
this));
|
||||||
form_update.data()->exec();
|
form_update->exec();
|
||||||
delete form_update.data();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::reportABugOnGitHub() {
|
void FormMain::reportABugOnGitHub() {
|
||||||
|
@ -623,7 +620,6 @@ void FormMain::donate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::showSettings() {
|
void FormMain::showSettings() {
|
||||||
QPointer<FormSettings> form_pointer = new FormSettings(this);
|
QScopedPointer<FormSettings> form_pointer(new FormSettings(this));
|
||||||
form_pointer.data()->exec();
|
form_pointer->exec();
|
||||||
delete form_pointer.data();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,24 +40,24 @@ class FormMain : public QMainWindow {
|
||||||
virtual ~FormMain();
|
virtual ~FormMain();
|
||||||
|
|
||||||
// Returns menu for the tray icon.
|
// Returns menu for the tray icon.
|
||||||
inline QMenu *trayMenu() {
|
inline QMenu *trayMenu() const {
|
||||||
return m_trayMenu;
|
return m_trayMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns global tab widget.
|
// Returns global tab widget.
|
||||||
inline TabWidget *tabWidget() {
|
inline TabWidget *tabWidget() const {
|
||||||
return m_ui->m_tabWidget;
|
return m_ui->m_tabWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Access to statusbar.
|
// Access to statusbar.
|
||||||
inline StatusBar *statusBar() {
|
inline StatusBar *statusBar() const {
|
||||||
return m_statusBar;
|
return m_statusBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns list of all globally available actions.
|
// Returns list of all globally available actions.
|
||||||
// NOTE: This is used for setting dynamic shortcuts
|
// NOTE: This is used for setting dynamic shortcuts
|
||||||
// for given actions.
|
// for given actions.
|
||||||
QList<QAction*> allActions();
|
QList<QAction*> allActions() const;
|
||||||
|
|
||||||
// Loads/saves visual state of the application.
|
// Loads/saves visual state of the application.
|
||||||
void loadSize();
|
void loadSize();
|
||||||
|
@ -106,7 +106,7 @@ class FormMain : public QMainWindow {
|
||||||
// Sets up proper icons for this widget.
|
// Sets up proper icons for this widget.
|
||||||
void setupIcons();
|
void setupIcons();
|
||||||
|
|
||||||
Ui::FormMain *m_ui;
|
QScopedPointer<Ui::FormMain> m_ui;
|
||||||
QMenu *m_trayMenu;
|
QMenu *m_trayMenu;
|
||||||
StatusBar *m_statusBar;
|
StatusBar *m_statusBar;
|
||||||
};
|
};
|
||||||
|
|
|
@ -64,10 +64,6 @@ FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::Form
|
||||||
m_ui->m_editorMessagesToolbar->availableItemsWidget()->viewport()->installEventFilter(this);
|
m_ui->m_editorMessagesToolbar->availableItemsWidget()->viewport()->installEventFilter(this);
|
||||||
m_ui->m_editorFeedsToolbar->availableItemsWidget()->viewport()->installEventFilter(this);
|
m_ui->m_editorFeedsToolbar->availableItemsWidget()->viewport()->installEventFilter(this);
|
||||||
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
MessageBox::iconify(m_ui->m_buttonBox);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Setup behavior.
|
// Setup behavior.
|
||||||
m_ui->m_listSettings->setCurrentRow(0);
|
m_ui->m_listSettings->setCurrentRow(0);
|
||||||
m_ui->m_treeLanguages->setColumnCount(5);
|
m_ui->m_treeLanguages->setColumnCount(5);
|
||||||
|
|
|
@ -42,10 +42,6 @@ FormUpdate::FormUpdate(QWidget *parent)
|
||||||
m_btnUpdate->setToolTip(tr("Download new installation files."));
|
m_btnUpdate->setToolTip(tr("Download new installation files."));
|
||||||
m_ui->m_lblCurrentRelease->setText(APP_VERSION);
|
m_ui->m_lblCurrentRelease->setText(APP_VERSION);
|
||||||
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
MessageBox::iconify(m_ui->m_buttonBox);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set flags and attributes.
|
// Set flags and attributes.
|
||||||
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint);
|
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint);
|
||||||
setWindowIcon(qApp->icons()->fromTheme(QSL("application-about")));
|
setWindowIcon(qApp->icons()->fromTheme(QSL("application-about")));
|
||||||
|
|
|
@ -42,39 +42,6 @@ void MessageBox::setIcon(QMessageBox::Icon icon) {
|
||||||
setIconPixmap(iconForStatus(icon).pixmap(icon_size, icon_size));
|
setIconPixmap(iconForStatus(icon).pixmap(icon_size, icon_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
void MessageBox::iconify(QDialogButtonBox *button_box) {
|
|
||||||
foreach (QAbstractButton *button, button_box->buttons()) {
|
|
||||||
button->setIcon(iconForRole(button_box->standardButton(button)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QIcon MessageBox::iconForRole(QDialogButtonBox::StandardButton button) {
|
|
||||||
switch (button) {
|
|
||||||
case QMessageBox::Ok:
|
|
||||||
return qApp->icons()->fromTheme(QSL("dialog-ok"));
|
|
||||||
|
|
||||||
case QMessageBox::Cancel:
|
|
||||||
case QMessageBox::Close:
|
|
||||||
return qApp->icons()->fromTheme(QSL("dialog-cancel"));
|
|
||||||
|
|
||||||
case QMessageBox::Yes:
|
|
||||||
case QMessageBox::YesToAll:
|
|
||||||
return qApp->icons()->fromTheme(QSL("dialog-yes"));
|
|
||||||
|
|
||||||
case QMessageBox::No:
|
|
||||||
case QMessageBox::NoToAll:
|
|
||||||
return qApp->icons()->fromTheme(QSL("dialog-no"));
|
|
||||||
|
|
||||||
case QMessageBox::Help:
|
|
||||||
return qApp->icons()->fromTheme(QSL("dialog-question"));
|
|
||||||
|
|
||||||
default:
|
|
||||||
return QIcon();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QIcon MessageBox::iconForStatus(QMessageBox::Icon status) {
|
QIcon MessageBox::iconForStatus(QMessageBox::Icon status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case QMessageBox::Information:
|
case QMessageBox::Information:
|
||||||
|
@ -115,12 +82,6 @@ QMessageBox::StandardButton MessageBox::show(QWidget *parent,
|
||||||
msg_box.setStandardButtons(buttons);
|
msg_box.setStandardButtons(buttons);
|
||||||
msg_box.setDefaultButton(default_button);
|
msg_box.setDefaultButton(default_button);
|
||||||
|
|
||||||
// Setup button box icons.
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
QDialogButtonBox *button_box = msg_box.findChild<QDialogButtonBox*>();
|
|
||||||
iconify(button_box);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Display it.
|
// Display it.
|
||||||
if (msg_box.exec() == -1) {
|
if (msg_box.exec() == -1) {
|
||||||
return QMessageBox::Cancel;
|
return QMessageBox::Cancel;
|
||||||
|
|
8
src/gui/messagebox.h
Normal file → Executable file
8
src/gui/messagebox.h
Normal file → Executable file
|
@ -44,14 +44,6 @@ class MessageBox : public QMessageBox {
|
||||||
QMessageBox::StandardButton default_button = QMessageBox::Ok);
|
QMessageBox::StandardButton default_button = QMessageBox::Ok);
|
||||||
|
|
||||||
static QIcon iconForStatus(QMessageBox::Icon status);
|
static QIcon iconForStatus(QMessageBox::Icon status);
|
||||||
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
// Performs icon replacements for given button box.
|
|
||||||
static void iconify(QDialogButtonBox *button_box);
|
|
||||||
|
|
||||||
// Returns icons for standard roles/statuses.
|
|
||||||
static QIcon iconForRole(QDialogButtonBox::StandardButton button);
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MESSAGEBOX_H
|
#endif // MESSAGEBOX_H
|
||||||
|
|
|
@ -339,7 +339,7 @@ class Settings : public QSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters/setters for settings values.
|
// Getters/setters for settings values.
|
||||||
inline QVariant value(const QString §ion, const QString &key, const QVariant &default_value = QVariant()) {
|
inline QVariant value(const QString §ion, const QString &key, const QVariant &default_value = QVariant()) const {
|
||||||
return QSettings::value(QString("%1/%2").arg(section, key), default_value);
|
return QSettings::value(QString("%1/%2").arg(section, key), default_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ class Settings : public QSettings {
|
||||||
QSettings::setValue(key, value);
|
QSettings::setValue(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool contains(const QString §ion, const QString &key) {
|
inline bool contains(const QString §ion, const QString &key) const {
|
||||||
return QSettings::contains(QString("%1/%2").arg(section, key));
|
return QSettings::contains(QString("%1/%2").arg(section, key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ class WebBrowser : public TabContent {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns global menu for this web browser.
|
// Returns global menu for this web browser.
|
||||||
inline virtual QList<QAction*> globalMenu() {
|
inline virtual QList<QAction*> globalMenu() const {
|
||||||
QList<QAction*> browser_menu;
|
QList<QAction*> browser_menu;
|
||||||
|
|
||||||
// Add needed actions into the menu.
|
// Add needed actions into the menu.
|
||||||
|
|
|
@ -52,26 +52,26 @@ class ServiceEntryPoint {
|
||||||
// Can this service account be added just once?
|
// Can this service account be added just once?
|
||||||
// NOTE: This is true particularly for "standard" service
|
// NOTE: This is true particularly for "standard" service
|
||||||
// which operates with normal RSS/ATOM feeds.
|
// which operates with normal RSS/ATOM feeds.
|
||||||
virtual bool isSingleInstanceService() = 0;
|
virtual bool isSingleInstanceService() const = 0;
|
||||||
|
|
||||||
// Human readable service name, for example "TT-RSS".
|
// Human readable service name, for example "TT-RSS".
|
||||||
virtual QString name() = 0;
|
virtual QString name() const = 0;
|
||||||
|
|
||||||
// Some arbitrary string.
|
// Some arbitrary string.
|
||||||
// NOTE: Keep in sync with ServiceRoot::code().
|
// NOTE: Keep in sync with ServiceRoot::code().
|
||||||
virtual QString code() = 0;
|
virtual QString code() const = 0;
|
||||||
|
|
||||||
// Human readable service description, for example "Services which offers TT-RSS integration.".
|
// Human readable service description, for example "Services which offers TT-RSS integration.".
|
||||||
virtual QString description() = 0;
|
virtual QString description() const = 0;
|
||||||
|
|
||||||
// Version of the service, using of semantic versioning is recommended.
|
// Version of the service, using of semantic versioning is recommended.
|
||||||
virtual QString version() = 0;
|
virtual QString version() const = 0;
|
||||||
|
|
||||||
// Author of the service.
|
// Author of the service.
|
||||||
virtual QString author() = 0;
|
virtual QString author() const = 0;
|
||||||
|
|
||||||
// Icon of the service.
|
// Icon of the service.
|
||||||
virtual QIcon icon() = 0;
|
virtual QIcon icon() const = 0;
|
||||||
|
|
||||||
/////////////////////////////////////////
|
/////////////////////////////////////////
|
||||||
// Members to override. */
|
// Members to override. */
|
||||||
|
|
|
@ -68,7 +68,7 @@ class ServiceRoot : public RootItem {
|
||||||
virtual QList<QAction*> serviceMenu() = 0;
|
virtual QList<QAction*> serviceMenu() = 0;
|
||||||
|
|
||||||
// Access to recycle bin of this account if there is any.
|
// Access to recycle bin of this account if there is any.
|
||||||
virtual RecycleBin *recycleBin() = 0;
|
virtual RecycleBin *recycleBin() const = 0;
|
||||||
|
|
||||||
QList<Message> undeletedMessages() const;
|
QList<Message> undeletedMessages() const;
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ class ServiceRoot : public RootItem {
|
||||||
|
|
||||||
// Returns the UNIQUE code of the given service.
|
// Returns the UNIQUE code of the given service.
|
||||||
// NOTE: Keep in sync with ServiceEntryRoot::code().
|
// NOTE: Keep in sync with ServiceEntryRoot::code().
|
||||||
virtual QString code() = 0;
|
virtual QString code() const = 0;
|
||||||
|
|
||||||
// This method should prepare messages for given "item" (download them maybe?)
|
// This method should prepare messages for given "item" (download them maybe?)
|
||||||
// into predefined "Messages" table
|
// into predefined "Messages" table
|
||||||
|
|
|
@ -218,10 +218,6 @@ void FormStandardCategoryDetails::initialize() {
|
||||||
// Setup button box.
|
// Setup button box.
|
||||||
m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||||
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
MessageBox::iconify(m_ui->m_buttonBox);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Setup menu & actions for icon selection.
|
// Setup menu & actions for icon selection.
|
||||||
m_iconMenu = new QMenu(tr("Icon selection"), this);
|
m_iconMenu = new QMenu(tr("Icon selection"), this);
|
||||||
m_actionLoadIconFromFile = new QAction(qApp->icons()->fromTheme(QSL("image-generic")),
|
m_actionLoadIconFromFile = new QAction(qApp->icons()->fromTheme(QSL("image-generic")),
|
||||||
|
|
|
@ -412,10 +412,6 @@ void FormStandardFeedDetails::initialize() {
|
||||||
m_ui->m_txtPassword->lineEdit()->setPlaceholderText(tr("Password"));
|
m_ui->m_txtPassword->lineEdit()->setPlaceholderText(tr("Password"));
|
||||||
m_ui->m_txtPassword->lineEdit()->setToolTip(tr("Set password to access the feed."));
|
m_ui->m_txtPassword->lineEdit()->setToolTip(tr("Set password to access the feed."));
|
||||||
|
|
||||||
#if defined(Q_OS_OS2)
|
|
||||||
MessageBox::iconify(m_ui->m_buttonBox);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Add standard feed types.
|
// Add standard feed types.
|
||||||
m_ui->m_cmbType->addItem(StandardFeed::typeToString(StandardFeed::Atom10), QVariant::fromValue((int) StandardFeed::Atom10));
|
m_ui->m_cmbType->addItem(StandardFeed::typeToString(StandardFeed::Atom10), QVariant::fromValue((int) StandardFeed::Atom10));
|
||||||
m_ui->m_cmbType->addItem(StandardFeed::typeToString(StandardFeed::Rdf), QVariant::fromValue((int) StandardFeed::Rdf));
|
m_ui->m_cmbType->addItem(StandardFeed::typeToString(StandardFeed::Rdf), QVariant::fromValue((int) StandardFeed::Rdf));
|
||||||
|
|
|
@ -31,31 +31,31 @@ StandardServiceEntryPoint::StandardServiceEntryPoint() {
|
||||||
StandardServiceEntryPoint::~StandardServiceEntryPoint() {
|
StandardServiceEntryPoint::~StandardServiceEntryPoint() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StandardServiceEntryPoint::isSingleInstanceService() {
|
bool StandardServiceEntryPoint::isSingleInstanceService() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString StandardServiceEntryPoint::name() {
|
QString StandardServiceEntryPoint::name() const {
|
||||||
return QSL("Standard online feeds (RSS/RDF/ATOM)");
|
return QSL("Standard online feeds (RSS/RDF/ATOM)");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString StandardServiceEntryPoint::description() {
|
QString StandardServiceEntryPoint::description() const {
|
||||||
return QSL("This service offers integration with standard online RSS/RDF/ATOM feeds and podcasts.");
|
return QSL("This service offers integration with standard online RSS/RDF/ATOM feeds and podcasts.");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString StandardServiceEntryPoint::version() {
|
QString StandardServiceEntryPoint::version() const {
|
||||||
return APP_VERSION;
|
return APP_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString StandardServiceEntryPoint::author() {
|
QString StandardServiceEntryPoint::author() const {
|
||||||
return APP_AUTHOR;
|
return APP_AUTHOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon StandardServiceEntryPoint::icon() {
|
QIcon StandardServiceEntryPoint::icon() const {
|
||||||
return QIcon(APP_ICON_PATH);
|
return QIcon(APP_ICON_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString StandardServiceEntryPoint::code() {
|
QString StandardServiceEntryPoint::code() const {
|
||||||
return SERVICE_CODE_STD_RSS;
|
return SERVICE_CODE_STD_RSS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,13 @@ class StandardServiceEntryPoint : public ServiceEntryPoint {
|
||||||
explicit StandardServiceEntryPoint();
|
explicit StandardServiceEntryPoint();
|
||||||
virtual ~StandardServiceEntryPoint();
|
virtual ~StandardServiceEntryPoint();
|
||||||
|
|
||||||
bool isSingleInstanceService();
|
bool isSingleInstanceService() const;
|
||||||
QString name();
|
QString name() const;
|
||||||
QString description();
|
QString description() const;
|
||||||
QString version();
|
QString version() const;
|
||||||
QString author();
|
QString author() const;
|
||||||
QIcon icon();
|
QIcon icon() const;
|
||||||
QString code();
|
QString code() const;
|
||||||
|
|
||||||
ServiceRoot *createNewRoot();
|
ServiceRoot *createNewRoot();
|
||||||
QList<ServiceRoot*> initializeSubtree() const;
|
QList<ServiceRoot*> initializeSubtree() const;
|
||||||
|
|
|
@ -104,7 +104,7 @@ void StandardServiceRoot::stop() {
|
||||||
qDebug("Stopping StandardServiceRoot instance.");
|
qDebug("Stopping StandardServiceRoot instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString StandardServiceRoot::code() {
|
QString StandardServiceRoot::code() const {
|
||||||
return SERVICE_CODE_STD_RSS;
|
return SERVICE_CODE_STD_RSS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ Qt::ItemFlags StandardServiceRoot::additionalFlags() const {
|
||||||
return Qt::ItemIsDropEnabled;
|
return Qt::ItemIsDropEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
RecycleBin *StandardServiceRoot::recycleBin() {
|
RecycleBin *StandardServiceRoot::recycleBin() const {
|
||||||
return m_recycleBin;
|
return m_recycleBin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ class StandardServiceRoot : public ServiceRoot {
|
||||||
void start(bool freshly_activated);
|
void start(bool freshly_activated);
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
QString code();
|
QString code() const;
|
||||||
|
|
||||||
bool canBeEdited();
|
bool canBeEdited();
|
||||||
bool canBeDeleted();
|
bool canBeDeleted();
|
||||||
|
@ -56,7 +56,7 @@ class StandardServiceRoot : public ServiceRoot {
|
||||||
Qt::ItemFlags additionalFlags() const;
|
Qt::ItemFlags additionalFlags() const;
|
||||||
|
|
||||||
// Access to recycle bin.
|
// Access to recycle bin.
|
||||||
RecycleBin *recycleBin();
|
RecycleBin *recycleBin() const;
|
||||||
|
|
||||||
// Return "add feed" and "add category" items.
|
// Return "add feed" and "add category" items.
|
||||||
QList<QAction*> addItemMenu();
|
QList<QAction*> addItemMenu();
|
||||||
|
|
|
@ -40,34 +40,34 @@ TtRssServiceEntryPoint::~TtRssServiceEntryPoint() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TtRssServiceEntryPoint::isSingleInstanceService() {
|
bool TtRssServiceEntryPoint::isSingleInstanceService() const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TtRssServiceEntryPoint::name() {
|
QString TtRssServiceEntryPoint::name() const {
|
||||||
return QSL("Tiny Tiny RSS");
|
return QSL("Tiny Tiny RSS");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TtRssServiceEntryPoint::description() {
|
QString TtRssServiceEntryPoint::description() const {
|
||||||
return QObject::tr("This service offers integration with Tiny Tiny RSS.\n\n"
|
return QObject::tr("This service offers integration with Tiny Tiny RSS.\n\n"
|
||||||
"Tiny Tiny RSS is an open source web-based news feed (RSS/Atom) reader and aggregator, "
|
"Tiny Tiny RSS is an open source web-based news feed (RSS/Atom) reader and aggregator, "
|
||||||
"designed to allow you to read news from any location, while feeling as close to a real "
|
"designed to allow you to read news from any location, while feeling as close to a real "
|
||||||
"desktop application as possible.\n\nAt least API level %1 is required.").arg(MINIMAL_API_LEVEL);
|
"desktop application as possible.\n\nAt least API level %1 is required.").arg(MINIMAL_API_LEVEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TtRssServiceEntryPoint::version() {
|
QString TtRssServiceEntryPoint::version() const {
|
||||||
return APP_VERSION;
|
return APP_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TtRssServiceEntryPoint::author() {
|
QString TtRssServiceEntryPoint::author() const {
|
||||||
return APP_AUTHOR;
|
return APP_AUTHOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon TtRssServiceEntryPoint::icon() {
|
QIcon TtRssServiceEntryPoint::icon() const {
|
||||||
return qApp->icons()->fromTheme(QSL("application-ttrss"));
|
return qApp->icons()->fromTheme(QSL("application-ttrss"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TtRssServiceEntryPoint::code() {
|
QString TtRssServiceEntryPoint::code() const {
|
||||||
return SERVICE_CODE_TT_RSS;
|
return SERVICE_CODE_TT_RSS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,13 +27,13 @@ class TtRssServiceEntryPoint : public ServiceEntryPoint {
|
||||||
explicit TtRssServiceEntryPoint();
|
explicit TtRssServiceEntryPoint();
|
||||||
virtual ~TtRssServiceEntryPoint();
|
virtual ~TtRssServiceEntryPoint();
|
||||||
|
|
||||||
bool isSingleInstanceService();
|
bool isSingleInstanceService() const;
|
||||||
QString name();
|
QString name() const;
|
||||||
QString description();
|
QString description() const;
|
||||||
QString version();
|
QString version() const;
|
||||||
QString author();
|
QString author() const;
|
||||||
QIcon icon();
|
QIcon icon() const;
|
||||||
QString code();
|
QString code() const;
|
||||||
|
|
||||||
ServiceRoot *createNewRoot();
|
ServiceRoot *createNewRoot();
|
||||||
QList<ServiceRoot*> initializeSubtree() const;
|
QList<ServiceRoot*> initializeSubtree() const;
|
||||||
|
|
|
@ -66,7 +66,7 @@ void TtRssServiceRoot::stop() {
|
||||||
qDebug("Stopping Tiny Tiny RSS account, logging out with result '%d'.", (int) m_network->lastError());
|
qDebug("Stopping Tiny Tiny RSS account, logging out with result '%d'.", (int) m_network->lastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TtRssServiceRoot::code() {
|
QString TtRssServiceRoot::code() const {
|
||||||
return SERVICE_CODE_TT_RSS;
|
return SERVICE_CODE_TT_RSS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ QList<QAction*> TtRssServiceRoot::addItemMenu() {
|
||||||
return QList<QAction*>();
|
return QList<QAction*>();
|
||||||
}
|
}
|
||||||
|
|
||||||
RecycleBin *TtRssServiceRoot::recycleBin() {
|
RecycleBin *TtRssServiceRoot::recycleBin() const {
|
||||||
return m_recycleBin;
|
return m_recycleBin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class TtRssServiceRoot : public ServiceRoot {
|
||||||
void start(bool freshly_activated);
|
void start(bool freshly_activated);
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
QString code();
|
QString code() const;
|
||||||
|
|
||||||
bool canBeEdited();
|
bool canBeEdited();
|
||||||
bool canBeDeleted();
|
bool canBeDeleted();
|
||||||
|
@ -56,7 +56,7 @@ class TtRssServiceRoot : public ServiceRoot {
|
||||||
QList<QAction*> serviceMenu();
|
QList<QAction*> serviceMenu();
|
||||||
QList<QAction*> contextMenu();
|
QList<QAction*> contextMenu();
|
||||||
|
|
||||||
RecycleBin *recycleBin();
|
RecycleBin *recycleBin() const;
|
||||||
|
|
||||||
bool loadMessagesForItem(RootItem *item, QSqlTableModel *model);
|
bool loadMessagesForItem(RootItem *item, QSqlTableModel *model);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue