mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-01 02:48:05 +01:00
Some clazy refactorings.
This commit is contained in:
parent
507d776682
commit
0fc62ef28a
@ -545,7 +545,9 @@ void FeedsModel::loadActivatedServiceAccounts() {
|
||||
}
|
||||
|
||||
if (serviceRoots().isEmpty()) {
|
||||
QTimer::singleShot(3000, []() {
|
||||
QTimer::singleShot(3000,
|
||||
qApp->mainForm(),
|
||||
[]() {
|
||||
qApp->mainForm()->showAddAccountDialog();
|
||||
});
|
||||
}
|
||||
|
@ -120,11 +120,11 @@ QDataStream& operator>>(QDataStream& in, Message& myObj) {
|
||||
return in;
|
||||
}
|
||||
|
||||
uint qHash(Message key, uint seed) {
|
||||
uint qHash(const Message& key, uint seed) {
|
||||
Q_UNUSED(seed)
|
||||
return (key.m_accountId * 10000) + key.m_id;
|
||||
return (uint(key.m_accountId) * 10000) + uint(key.m_id);
|
||||
}
|
||||
|
||||
uint qHash(const Message& key) {
|
||||
return (key.m_accountId * 10000) + key.m_id;
|
||||
return (uint(key.m_accountId) * 10000) + uint(key.m_id);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class Message {
|
||||
QDataStream& operator<<(QDataStream& out, const Message& myObj);
|
||||
QDataStream& operator>>(QDataStream& in, Message& myObj);
|
||||
|
||||
uint qHash(Message key, uint seed);
|
||||
uint qHash(const Message& key, uint seed);
|
||||
uint qHash(const Message& key);
|
||||
|
||||
#endif // MESSAGE_H
|
||||
|
@ -38,7 +38,7 @@ class MessagesModel : public QSqlQueryModel, public MessagesModelSqlLayer {
|
||||
|
||||
// Model implementation.
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
|
||||
QVariant data(const QModelIndex& idx, int role = Qt::DisplayRole) const;
|
||||
QVariant data(int row, int column, int role = Qt::DisplayRole) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
BaseLineEdit::BaseLineEdit(QWidget* parent) : QLineEdit(parent) {}
|
||||
|
||||
BaseLineEdit::~BaseLineEdit() {}
|
||||
|
||||
void BaseLineEdit::submit(const QString& text) {
|
||||
setText(text);
|
||||
emit submitted(text);
|
||||
|
@ -11,8 +11,8 @@ class BaseLineEdit : public QLineEdit {
|
||||
public:
|
||||
|
||||
// Constructors and destructors.
|
||||
explicit BaseLineEdit(QWidget* parent = 0);
|
||||
virtual ~BaseLineEdit();
|
||||
explicit BaseLineEdit(QWidget* parent = nullptr);
|
||||
virtual ~BaseLineEdit() = default;
|
||||
|
||||
public slots:
|
||||
void submit(const QString& text);
|
||||
|
@ -5,12 +5,10 @@
|
||||
#include <QPainter>
|
||||
#include <QPaintEvent>
|
||||
|
||||
ColorLabel::ColorLabel(QWidget* parent) : QLabel(parent), m_color(QColor()) {
|
||||
ColorLabel::ColorLabel(QWidget* parent) : QLabel(parent) {
|
||||
setFixedWidth(20);
|
||||
}
|
||||
|
||||
ColorLabel::~ColorLabel() {}
|
||||
|
||||
QColor ColorLabel::color() const {
|
||||
return m_color;
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ class ColorLabel : public QLabel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ColorLabel(QWidget* parent = 0);
|
||||
virtual ~ColorLabel();
|
||||
explicit ColorLabel(QWidget* parent = nullptr);
|
||||
virtual ~ColorLabel() = default;
|
||||
|
||||
QColor color() const;
|
||||
void setColor(const QColor& color);
|
||||
|
@ -19,5 +19,3 @@ ComboBoxWithStatus::ComboBoxWithStatus(QWidget* parent)
|
||||
m_layout->addWidget(m_wdgInput);
|
||||
m_layout->addWidget(m_btnStatus);
|
||||
}
|
||||
|
||||
ComboBoxWithStatus::~ComboBoxWithStatus() {}
|
||||
|
@ -13,8 +13,8 @@ class ComboBoxWithStatus : public WidgetWithStatus {
|
||||
public:
|
||||
|
||||
// Constructors and destructors.
|
||||
explicit ComboBoxWithStatus(QWidget* parent = 0);
|
||||
virtual ~ComboBoxWithStatus();
|
||||
explicit ComboBoxWithStatus(QWidget* parent = nullptr);
|
||||
virtual ~ComboBoxWithStatus() = default;
|
||||
|
||||
inline QComboBox* comboBox() const {
|
||||
return static_cast<QComboBox*>(m_wdgInput);
|
||||
|
Loading…
Reference in New Issue
Block a user