mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-02 18:36:49 +01:00
Const refactoring.
This commit is contained in:
parent
112d5dcc28
commit
d7470c7465
@ -495,9 +495,9 @@ QList<ServiceRoot*> FeedsModel::serviceRoots() const {
|
||||
return roots;
|
||||
}
|
||||
|
||||
bool FeedsModel::containsServiceRootFromEntryPoint(ServiceEntryPoint *point) const {
|
||||
foreach (RootItem *root, serviceRoots()) {
|
||||
if (root->toServiceRoot()->code() == point->code()) {
|
||||
bool FeedsModel::containsServiceRootFromEntryPoint(const ServiceEntryPoint *point) const {
|
||||
foreach (const ServiceRoot *root, serviceRoots()) {
|
||||
if (root->code() == point->code()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -506,7 +506,7 @@ bool FeedsModel::containsServiceRootFromEntryPoint(ServiceEntryPoint *point) con
|
||||
}
|
||||
|
||||
StandardServiceRoot *FeedsModel::standardServiceRoot() const {
|
||||
foreach (RootItem *root, serviceRoots()) {
|
||||
foreach (ServiceRoot *root, serviceRoots()) {
|
||||
StandardServiceRoot *std_service_root;
|
||||
|
||||
if ((std_service_root = dynamic_cast<StandardServiceRoot*>(root)) != NULL) {
|
||||
|
@ -84,7 +84,7 @@ class FeedsModel : public QAbstractItemModel {
|
||||
QList<ServiceRoot*> serviceRoots() const;
|
||||
|
||||
// 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.
|
||||
// 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
|
||||
#define IOEXCEPTION_H
|
||||
|
||||
#include "exceptions/applicationexception.h"
|
||||
|
||||
|
||||
class IOException : public ApplicationException
|
||||
{
|
||||
class IOException : public ApplicationException {
|
||||
public:
|
||||
explicit IOException(const QString &message = QString());
|
||||
virtual ~IOException();
|
||||
|
@ -21,10 +21,6 @@
|
||||
#include "miscellaneous/textfactory.h"
|
||||
#include "miscellaneous/settingsproperties.h"
|
||||
|
||||
#if !defined(Q_OS_WIN)
|
||||
#include "gui/messagebox.h"
|
||||
#endif
|
||||
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
||||
@ -39,10 +35,6 @@ FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout(
|
||||
//: About RSS Guard dialog title.
|
||||
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));
|
||||
|
||||
// Load information from embedded text files.
|
||||
|
@ -22,10 +22,6 @@
|
||||
#include "core/feedsmodel.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)
|
||||
: 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);
|
||||
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_buttonBox, SIGNAL(accepted()), this, SLOT(addSelectedAccount()));
|
||||
connect(m_ui->m_listEntryPoints, SIGNAL(itemSelectionChanged()), this, SLOT(displayActiveEntryPointDetails()));
|
||||
@ -46,7 +38,7 @@ FormAddAccount::FormAddAccount(const QList<ServiceEntryPoint*> &entry_points, Fe
|
||||
}
|
||||
|
||||
FormAddAccount::~FormAddAccount() {
|
||||
delete m_ui;
|
||||
qDebug("Destroying FormAddAccount instance.");
|
||||
}
|
||||
|
||||
void FormAddAccount::addSelectedAccount() {
|
||||
@ -64,7 +56,7 @@ void FormAddAccount::addSelectedAccount() {
|
||||
}
|
||||
|
||||
void FormAddAccount::displayActiveEntryPointDetails() {
|
||||
ServiceEntryPoint *point = selectedEntryPoint();
|
||||
const ServiceEntryPoint *point = selectedEntryPoint();
|
||||
|
||||
m_ui->m_txtAuthor->setText(point->author());
|
||||
m_ui->m_txtDescription->setText(point->description());
|
||||
@ -72,12 +64,12 @@ void FormAddAccount::displayActiveEntryPointDetails() {
|
||||
m_ui->m_txtVersion->setText(point->version());
|
||||
}
|
||||
|
||||
ServiceEntryPoint *FormAddAccount::selectedEntryPoint() {
|
||||
ServiceEntryPoint *FormAddAccount::selectedEntryPoint() const {
|
||||
return m_entryPoints.at(m_ui->m_listEntryPoints->currentRow());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (entry_point->isSingleInstanceService() && m_model->containsServiceRootFromEntryPoint(entry_point)) {
|
||||
|
@ -42,10 +42,10 @@ class FormAddAccount : public QDialog {
|
||||
void displayActiveEntryPointDetails();
|
||||
|
||||
private:
|
||||
ServiceEntryPoint *selectedEntryPoint();
|
||||
ServiceEntryPoint *selectedEntryPoint() const;
|
||||
void loadEntryPoints();
|
||||
|
||||
Ui::FormAddAccount *m_ui;
|
||||
QScopedPointer<Ui::FormAddAccount> m_ui;
|
||||
FeedsModel *m_model;
|
||||
QList<ServiceEntryPoint*> m_entryPoints;
|
||||
};
|
||||
|
@ -53,7 +53,7 @@ FormBackupDatabaseSettings::FormBackupDatabaseSettings(QWidget *parent) : QDialo
|
||||
}
|
||||
|
||||
FormBackupDatabaseSettings::~FormBackupDatabaseSettings() {
|
||||
delete m_ui;
|
||||
qDebug("Destroying FormBackupDatabaseSettings instance.");
|
||||
}
|
||||
|
||||
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."));
|
||||
}
|
||||
catch (ApplicationException &ex) {
|
||||
catch (const ApplicationException &ex) {
|
||||
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();
|
||||
|
||||
private:
|
||||
Ui::FormBackupDatabaseSettings *m_ui;
|
||||
QScopedPointer<Ui::FormBackupDatabaseSettings> m_ui;
|
||||
};
|
||||
|
||||
#endif // FORMBACKUPDATABASECONFIG_H
|
||||
|
@ -38,7 +38,7 @@ FormDatabaseCleanup::FormDatabaseCleanup(QWidget *parent) : QDialog(parent), m_u
|
||||
}
|
||||
|
||||
FormDatabaseCleanup::~FormDatabaseCleanup() {
|
||||
delete m_ui;
|
||||
qDebug("Destroying FormDatabaseCleanup instance.");
|
||||
}
|
||||
|
||||
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:
|
||||
void updateDaysSuffix(int number);
|
||||
|
||||
void startPurging();
|
||||
void onPurgeStarted();
|
||||
void onPurgeProgress(int progress, const QString &description);
|
||||
@ -58,7 +57,7 @@ class FormDatabaseCleanup : public QDialog {
|
||||
void loadDatabaseInfo();
|
||||
|
||||
private:
|
||||
Ui::FormDatabaseCleanup *m_ui;
|
||||
QScopedPointer<Ui::FormDatabaseCleanup> m_ui;
|
||||
DatabaseCleaner *m_cleaner;
|
||||
};
|
||||
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include <QCloseEvent>
|
||||
#include <QSessionManager>
|
||||
#include <QRect>
|
||||
#include <QScopedPointer>
|
||||
#include <QDesktopWidget>
|
||||
#include <QReadWriteLock>
|
||||
#include <QTimer>
|
||||
@ -85,10 +86,10 @@ FormMain::FormMain(QWidget *parent, Qt::WindowFlags f)
|
||||
}
|
||||
|
||||
FormMain::~FormMain() {
|
||||
delete m_ui;
|
||||
qDebug("Destroying FormDatabaseCleanup instance.");
|
||||
}
|
||||
|
||||
QList<QAction*> FormMain::allActions() {
|
||||
QList<QAction*> FormMain::allActions() const {
|
||||
QList<QAction*> actions;
|
||||
|
||||
// Add basic actions.
|
||||
@ -172,7 +173,8 @@ void FormMain::prepareMenus() {
|
||||
void FormMain::switchFullscreenMode() {
|
||||
if (!isFullScreen()) {
|
||||
showFullScreen();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
showNormal();
|
||||
}
|
||||
}
|
||||
@ -198,8 +200,8 @@ void FormMain::updateAddItemMenu() {
|
||||
|
||||
if (activated_root->supportsFeedAdding()) {
|
||||
QAction *action_new_feed = new QAction(qApp->icons()->fromTheme(QSL("folder-feed")),
|
||||
tr("Add new feed"),
|
||||
m_ui->m_menuAddItem);
|
||||
tr("Add new feed"),
|
||||
m_ui->m_menuAddItem);
|
||||
root_menu->addAction(action_new_feed);
|
||||
connect(action_new_feed, SIGNAL(triggered()), activated_root, SLOT(addNewFeed()));
|
||||
}
|
||||
@ -225,7 +227,7 @@ void FormMain::updateAddItemMenu() {
|
||||
void FormMain::updateRecycleBinMenu() {
|
||||
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);
|
||||
root_menu->setIcon(activated_root->icon());
|
||||
root_menu->setToolTip(activated_root->description());
|
||||
@ -414,8 +416,8 @@ void FormMain::setupIcons() {
|
||||
}
|
||||
|
||||
void FormMain::loadSize() {
|
||||
QRect screen = qApp->desktop()->screenGeometry();
|
||||
Settings *settings = qApp->settings();
|
||||
const QRect screen = qApp->desktop()->screenGeometry();
|
||||
const Settings *settings = qApp->settings();
|
||||
|
||||
// Reload main window size & position.
|
||||
resize(settings->value(GROUP(GUI), GUI::MainWindowInitialSize, size()).toSize());
|
||||
@ -446,8 +448,8 @@ void FormMain::loadSize() {
|
||||
|
||||
void FormMain::saveSize() {
|
||||
Settings *settings = qApp->settings();
|
||||
bool is_fullscreen = isFullScreen();
|
||||
bool is_maximized = isMaximized();
|
||||
const bool is_fullscreen = isFullScreen();
|
||||
const bool is_maximized = isMaximized();
|
||||
|
||||
if (is_fullscreen) {
|
||||
m_ui->m_actionFullscreen->setChecked(false);
|
||||
@ -519,7 +521,7 @@ void FormMain::createConnections() {
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
@ -539,21 +541,19 @@ void FormMain::loadWebBrowserMenu(int index) {
|
||||
}
|
||||
|
||||
void FormMain::backupDatabaseSettings() {
|
||||
QPointer<FormBackupDatabaseSettings> form = new FormBackupDatabaseSettings(this);
|
||||
form.data()->exec();
|
||||
delete form.data();
|
||||
QScopedPointer<FormBackupDatabaseSettings> form(new FormBackupDatabaseSettings(this));
|
||||
form->exec();
|
||||
}
|
||||
|
||||
void FormMain::restoreDatabaseSettings() {
|
||||
QPointer<FormRestoreDatabaseSettings> form = new FormRestoreDatabaseSettings(this);
|
||||
form.data()->exec();
|
||||
delete form.data();
|
||||
QScopedPointer<FormRestoreDatabaseSettings> form(new FormRestoreDatabaseSettings(this));
|
||||
form->exec();
|
||||
}
|
||||
|
||||
void FormMain::changeEvent(QEvent *event) {
|
||||
switch (event->type()) {
|
||||
case QEvent::WindowStateChange: {
|
||||
if (this->windowState() & Qt::WindowMinimized &&
|
||||
if (windowState() & Qt::WindowMinimized &&
|
||||
SystemTrayIcon::isSystemTrayActivated() &&
|
||||
qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideMainWindowWhenMinimized)).toBool()) {
|
||||
event->ignore();
|
||||
@ -571,15 +571,13 @@ void FormMain::changeEvent(QEvent *event) {
|
||||
}
|
||||
|
||||
void FormMain::showAbout() {
|
||||
QPointer<FormAbout> form_pointer = new FormAbout(this);
|
||||
form_pointer.data()->exec();
|
||||
delete form_pointer.data();
|
||||
QScopedPointer<FormAbout> form_pointer(new FormAbout(this));
|
||||
form_pointer->exec();
|
||||
}
|
||||
|
||||
void FormMain::showUpdates() {
|
||||
QPointer<FormUpdate> form_update = new FormUpdate(this);
|
||||
form_update.data()->exec();
|
||||
delete form_update.data();
|
||||
QScopedPointer<FormUpdate> form_update(new FormUpdate(this));
|
||||
form_update->exec();
|
||||
}
|
||||
|
||||
void FormMain::showWiki() {
|
||||
@ -591,11 +589,10 @@ void FormMain::showWiki() {
|
||||
}
|
||||
|
||||
void FormMain::showAddAccountDialog() {
|
||||
QPointer<FormAddAccount> form_update = new FormAddAccount(qApp->feedServices(),
|
||||
tabWidget()->feedMessageViewer()->feedsView()->sourceModel(),
|
||||
this);
|
||||
form_update.data()->exec();
|
||||
delete form_update.data();
|
||||
QScopedPointer<FormAddAccount> form_update(new FormAddAccount(qApp->feedServices(),
|
||||
tabWidget()->feedMessageViewer()->feedsView()->sourceModel(),
|
||||
this));
|
||||
form_update->exec();
|
||||
}
|
||||
|
||||
void FormMain::reportABugOnGitHub() {
|
||||
@ -623,7 +620,6 @@ void FormMain::donate() {
|
||||
}
|
||||
|
||||
void FormMain::showSettings() {
|
||||
QPointer<FormSettings> form_pointer = new FormSettings(this);
|
||||
form_pointer.data()->exec();
|
||||
delete form_pointer.data();
|
||||
QScopedPointer<FormSettings> form_pointer(new FormSettings(this));
|
||||
form_pointer->exec();
|
||||
}
|
||||
|
@ -40,24 +40,24 @@ class FormMain : public QMainWindow {
|
||||
virtual ~FormMain();
|
||||
|
||||
// Returns menu for the tray icon.
|
||||
inline QMenu *trayMenu() {
|
||||
inline QMenu *trayMenu() const {
|
||||
return m_trayMenu;
|
||||
}
|
||||
|
||||
// Returns global tab widget.
|
||||
inline TabWidget *tabWidget() {
|
||||
inline TabWidget *tabWidget() const {
|
||||
return m_ui->m_tabWidget;
|
||||
}
|
||||
|
||||
// Access to statusbar.
|
||||
inline StatusBar *statusBar() {
|
||||
inline StatusBar *statusBar() const {
|
||||
return m_statusBar;
|
||||
}
|
||||
|
||||
// Returns list of all globally available actions.
|
||||
// NOTE: This is used for setting dynamic shortcuts
|
||||
// for given actions.
|
||||
QList<QAction*> allActions();
|
||||
QList<QAction*> allActions() const;
|
||||
|
||||
// Loads/saves visual state of the application.
|
||||
void loadSize();
|
||||
@ -106,7 +106,7 @@ class FormMain : public QMainWindow {
|
||||
// Sets up proper icons for this widget.
|
||||
void setupIcons();
|
||||
|
||||
Ui::FormMain *m_ui;
|
||||
QScopedPointer<Ui::FormMain> m_ui;
|
||||
QMenu *m_trayMenu;
|
||||
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_editorFeedsToolbar->availableItemsWidget()->viewport()->installEventFilter(this);
|
||||
|
||||
#if defined(Q_OS_OS2)
|
||||
MessageBox::iconify(m_ui->m_buttonBox);
|
||||
#endif
|
||||
|
||||
// Setup behavior.
|
||||
m_ui->m_listSettings->setCurrentRow(0);
|
||||
m_ui->m_treeLanguages->setColumnCount(5);
|
||||
|
@ -42,10 +42,6 @@ FormUpdate::FormUpdate(QWidget *parent)
|
||||
m_btnUpdate->setToolTip(tr("Download new installation files."));
|
||||
m_ui->m_lblCurrentRelease->setText(APP_VERSION);
|
||||
|
||||
#if defined(Q_OS_OS2)
|
||||
MessageBox::iconify(m_ui->m_buttonBox);
|
||||
#endif
|
||||
|
||||
// Set flags and attributes.
|
||||
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint);
|
||||
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));
|
||||
}
|
||||
|
||||
#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) {
|
||||
switch (status) {
|
||||
case QMessageBox::Information:
|
||||
@ -115,12 +82,6 @@ QMessageBox::StandardButton MessageBox::show(QWidget *parent,
|
||||
msg_box.setStandardButtons(buttons);
|
||||
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.
|
||||
if (msg_box.exec() == -1) {
|
||||
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);
|
||||
|
||||
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
|
||||
|
@ -339,7 +339,7 @@ class Settings : public QSettings {
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ class Settings : public QSettings {
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ class WebBrowser : public TabContent {
|
||||
}
|
||||
|
||||
// Returns global menu for this web browser.
|
||||
inline virtual QList<QAction*> globalMenu() {
|
||||
inline virtual QList<QAction*> globalMenu() const {
|
||||
QList<QAction*> browser_menu;
|
||||
|
||||
// Add needed actions into the menu.
|
||||
|
@ -52,26 +52,26 @@ class ServiceEntryPoint {
|
||||
// Can this service account be added just once?
|
||||
// NOTE: This is true particularly for "standard" service
|
||||
// which operates with normal RSS/ATOM feeds.
|
||||
virtual bool isSingleInstanceService() = 0;
|
||||
virtual bool isSingleInstanceService() const = 0;
|
||||
|
||||
// Human readable service name, for example "TT-RSS".
|
||||
virtual QString name() = 0;
|
||||
virtual QString name() const = 0;
|
||||
|
||||
// Some arbitrary string.
|
||||
// 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.".
|
||||
virtual QString description() = 0;
|
||||
virtual QString description() const = 0;
|
||||
|
||||
// Version of the service, using of semantic versioning is recommended.
|
||||
virtual QString version() = 0;
|
||||
virtual QString version() const = 0;
|
||||
|
||||
// Author of the service.
|
||||
virtual QString author() = 0;
|
||||
virtual QString author() const = 0;
|
||||
|
||||
// Icon of the service.
|
||||
virtual QIcon icon() = 0;
|
||||
virtual QIcon icon() const = 0;
|
||||
|
||||
/////////////////////////////////////////
|
||||
// Members to override. */
|
||||
|
@ -68,7 +68,7 @@ class ServiceRoot : public RootItem {
|
||||
virtual QList<QAction*> serviceMenu() = 0;
|
||||
|
||||
// Access to recycle bin of this account if there is any.
|
||||
virtual RecycleBin *recycleBin() = 0;
|
||||
virtual RecycleBin *recycleBin() const = 0;
|
||||
|
||||
QList<Message> undeletedMessages() const;
|
||||
|
||||
@ -84,7 +84,7 @@ class ServiceRoot : public RootItem {
|
||||
|
||||
// Returns the UNIQUE code of the given service.
|
||||
// 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?)
|
||||
// into predefined "Messages" table
|
||||
|
@ -218,10 +218,6 @@ void FormStandardCategoryDetails::initialize() {
|
||||
// Setup button box.
|
||||
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.
|
||||
m_iconMenu = new QMenu(tr("Icon selection"), this);
|
||||
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()->setToolTip(tr("Set password to access the feed."));
|
||||
|
||||
#if defined(Q_OS_OS2)
|
||||
MessageBox::iconify(m_ui->m_buttonBox);
|
||||
#endif
|
||||
|
||||
// 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::Rdf), QVariant::fromValue((int) StandardFeed::Rdf));
|
||||
|
@ -31,31 +31,31 @@ StandardServiceEntryPoint::StandardServiceEntryPoint() {
|
||||
StandardServiceEntryPoint::~StandardServiceEntryPoint() {
|
||||
}
|
||||
|
||||
bool StandardServiceEntryPoint::isSingleInstanceService() {
|
||||
bool StandardServiceEntryPoint::isSingleInstanceService() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
QString StandardServiceEntryPoint::name() {
|
||||
QString StandardServiceEntryPoint::name() const {
|
||||
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.");
|
||||
}
|
||||
|
||||
QString StandardServiceEntryPoint::version() {
|
||||
QString StandardServiceEntryPoint::version() const {
|
||||
return APP_VERSION;
|
||||
}
|
||||
|
||||
QString StandardServiceEntryPoint::author() {
|
||||
QString StandardServiceEntryPoint::author() const {
|
||||
return APP_AUTHOR;
|
||||
}
|
||||
|
||||
QIcon StandardServiceEntryPoint::icon() {
|
||||
QIcon StandardServiceEntryPoint::icon() const {
|
||||
return QIcon(APP_ICON_PATH);
|
||||
}
|
||||
|
||||
QString StandardServiceEntryPoint::code() {
|
||||
QString StandardServiceEntryPoint::code() const {
|
||||
return SERVICE_CODE_STD_RSS;
|
||||
}
|
||||
|
||||
|
@ -26,13 +26,13 @@ class StandardServiceEntryPoint : public ServiceEntryPoint {
|
||||
explicit StandardServiceEntryPoint();
|
||||
virtual ~StandardServiceEntryPoint();
|
||||
|
||||
bool isSingleInstanceService();
|
||||
QString name();
|
||||
QString description();
|
||||
QString version();
|
||||
QString author();
|
||||
QIcon icon();
|
||||
QString code();
|
||||
bool isSingleInstanceService() const;
|
||||
QString name() const;
|
||||
QString description() const;
|
||||
QString version() const;
|
||||
QString author() const;
|
||||
QIcon icon() const;
|
||||
QString code() const;
|
||||
|
||||
ServiceRoot *createNewRoot();
|
||||
QList<ServiceRoot*> initializeSubtree() const;
|
||||
|
@ -104,7 +104,7 @@ void StandardServiceRoot::stop() {
|
||||
qDebug("Stopping StandardServiceRoot instance.");
|
||||
}
|
||||
|
||||
QString StandardServiceRoot::code() {
|
||||
QString StandardServiceRoot::code() const {
|
||||
return SERVICE_CODE_STD_RSS;
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ Qt::ItemFlags StandardServiceRoot::additionalFlags() const {
|
||||
return Qt::ItemIsDropEnabled;
|
||||
}
|
||||
|
||||
RecycleBin *StandardServiceRoot::recycleBin() {
|
||||
RecycleBin *StandardServiceRoot::recycleBin() const {
|
||||
return m_recycleBin;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ class StandardServiceRoot : public ServiceRoot {
|
||||
void start(bool freshly_activated);
|
||||
void stop();
|
||||
|
||||
QString code();
|
||||
QString code() const;
|
||||
|
||||
bool canBeEdited();
|
||||
bool canBeDeleted();
|
||||
@ -56,7 +56,7 @@ class StandardServiceRoot : public ServiceRoot {
|
||||
Qt::ItemFlags additionalFlags() const;
|
||||
|
||||
// Access to recycle bin.
|
||||
RecycleBin *recycleBin();
|
||||
RecycleBin *recycleBin() const;
|
||||
|
||||
// Return "add feed" and "add category" items.
|
||||
QList<QAction*> addItemMenu();
|
||||
|
@ -40,34 +40,34 @@ TtRssServiceEntryPoint::~TtRssServiceEntryPoint() {
|
||||
|
||||
}
|
||||
|
||||
bool TtRssServiceEntryPoint::isSingleInstanceService() {
|
||||
bool TtRssServiceEntryPoint::isSingleInstanceService() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
QString TtRssServiceEntryPoint::name() {
|
||||
QString TtRssServiceEntryPoint::name() const {
|
||||
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"
|
||||
"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 "
|
||||
"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;
|
||||
}
|
||||
|
||||
QString TtRssServiceEntryPoint::author() {
|
||||
QString TtRssServiceEntryPoint::author() const {
|
||||
return APP_AUTHOR;
|
||||
}
|
||||
|
||||
QIcon TtRssServiceEntryPoint::icon() {
|
||||
QIcon TtRssServiceEntryPoint::icon() const {
|
||||
return qApp->icons()->fromTheme(QSL("application-ttrss"));
|
||||
}
|
||||
|
||||
QString TtRssServiceEntryPoint::code() {
|
||||
QString TtRssServiceEntryPoint::code() const {
|
||||
return SERVICE_CODE_TT_RSS;
|
||||
}
|
||||
|
||||
|
@ -27,13 +27,13 @@ class TtRssServiceEntryPoint : public ServiceEntryPoint {
|
||||
explicit TtRssServiceEntryPoint();
|
||||
virtual ~TtRssServiceEntryPoint();
|
||||
|
||||
bool isSingleInstanceService();
|
||||
QString name();
|
||||
QString description();
|
||||
QString version();
|
||||
QString author();
|
||||
QIcon icon();
|
||||
QString code();
|
||||
bool isSingleInstanceService() const;
|
||||
QString name() const;
|
||||
QString description() const;
|
||||
QString version() const;
|
||||
QString author() const;
|
||||
QIcon icon() const;
|
||||
QString code() const;
|
||||
|
||||
ServiceRoot *createNewRoot();
|
||||
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());
|
||||
}
|
||||
|
||||
QString TtRssServiceRoot::code() {
|
||||
QString TtRssServiceRoot::code() const {
|
||||
return SERVICE_CODE_TT_RSS;
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ QList<QAction*> TtRssServiceRoot::addItemMenu() {
|
||||
return QList<QAction*>();
|
||||
}
|
||||
|
||||
RecycleBin *TtRssServiceRoot::recycleBin() {
|
||||
RecycleBin *TtRssServiceRoot::recycleBin() const {
|
||||
return m_recycleBin;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class TtRssServiceRoot : public ServiceRoot {
|
||||
void start(bool freshly_activated);
|
||||
void stop();
|
||||
|
||||
QString code();
|
||||
QString code() const;
|
||||
|
||||
bool canBeEdited();
|
||||
bool canBeDeleted();
|
||||
@ -56,7 +56,7 @@ class TtRssServiceRoot : public ServiceRoot {
|
||||
QList<QAction*> serviceMenu();
|
||||
QList<QAction*> contextMenu();
|
||||
|
||||
RecycleBin *recycleBin();
|
||||
RecycleBin *recycleBin() const;
|
||||
|
||||
bool loadMessagesForItem(RootItem *item, QSqlTableModel *model);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user