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