Commit 2a41c2a7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Initialize variables in headers

parent 38e8b666
......@@ -56,11 +56,11 @@ public:
void saveConfig();
QList<Row> m_rows;
FileMetaDataProvider *m_provider;
QGridLayout *m_gridLayout;
FileMetaDataProvider *m_provider = nullptr;
QGridLayout *m_gridLayout = nullptr;
MetadataFilter *m_filter;
WidgetFactory *m_widgetFactory;
MetadataFilter *m_filter = nullptr;
WidgetFactory *m_widgetFactory = nullptr;
QMap<QString, bool> m_visibilityChanged;
bool m_configureVisibleProperties = false;
......@@ -71,8 +71,6 @@ private:
FileMetaDataWidgetPrivate::FileMetaDataWidgetPrivate(FileMetaDataWidget *parent)
: m_rows()
, m_provider(nullptr)
, m_gridLayout(nullptr)
, q(parent)
{
m_filter = new MetadataFilter(q);
......
......@@ -42,7 +42,7 @@ public:
Qt::Alignment alignment;
KBlockLayout *q;
KBlockLayout *q = nullptr;
};
KBlockLayout::KBlockLayout(QWidget *parent, int margin, int hSpacing, int vSpacing)
......
......@@ -20,17 +20,13 @@
KCommentWidget::KCommentWidget(QWidget *parent)
: QWidget(parent)
, m_readOnly(false)
, m_label(nullptr)
, m_sizeHintHelper(nullptr)
, m_comment()
, m_label(new QLabel(this))
, m_sizeHintHelper(new QLabel(this))
{
m_label = new QLabel(this);
m_label->setWordWrap(true);
m_label->setAlignment(Qt::AlignTop);
connect(m_label, &QLabel::linkActivated, this, &KCommentWidget::slotLinkActivated);
m_sizeHintHelper = new QLabel(this);
m_sizeHintHelper->hide();
QVBoxLayout *layout = new QVBoxLayout(this);
......
......@@ -47,9 +47,9 @@ private Q_SLOTS:
void slotLinkActivated(const QString &link);
private:
bool m_readOnly;
QLabel *m_label;
QLabel *m_sizeHintHelper; // see comment in KCommentWidget::sizeHint()
bool m_readOnly = false;
QLabel *const m_label;
QLabel *const m_sizeHintHelper; // see comment in KCommentWidget::sizeHint()
QString m_comment;
};
......
......@@ -17,13 +17,12 @@
KEditCommentDialog::KEditCommentDialog(QWidget *parent, const QString &commentText, const QString &captionText)
: QDialog(parent)
, m_editor(new QTextEdit(this))
{
setWindowTitle(captionText);
QVBoxLayout *layout = new QVBoxLayout;
setLayout(layout);
QVBoxLayout *layout = new QVBoxLayout(this);
m_editor = new QTextEdit(this);
m_editor->setText(commentText);
layout->addWidget(m_editor);
......
......@@ -22,7 +22,7 @@ public:
QString getCommentText() const;
private:
QTextEdit *m_editor;
QTextEdit *const m_editor;
};
#endif
......@@ -27,8 +27,6 @@
KEditTagsDialog::KEditTagsDialog(const QStringList &tags, QWidget *parent)
: QDialog(parent)
, m_tags(tags)
, m_tagTree(nullptr)
, m_newTagEdit(nullptr)
{
const QString captionText = (tags.count() > 0) ? i18nc("@title:window", "Edit Tags") : i18nc("@title:window", "Add Tags");
setWindowTitle(captionText);
......
......@@ -52,8 +52,8 @@ private:
QStringList m_allTags;
QString m_newTag;
QTreeWidget *m_tagTree;
QLineEdit *m_newTagEdit;
QTreeWidget *m_tagTree = nullptr;
QLineEdit *m_newTagEdit = nullptr;
};
#endif
......@@ -16,9 +16,7 @@ using namespace Baloo;
TagCheckBox::TagCheckBox(const QString &tag, QWidget *parent)
: QWidget(parent)
, m_label(nullptr)
, m_tag(tag)
, m_urlHover(false)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
......
......@@ -41,11 +41,11 @@ private:
void enableUrlHover(bool enabled);
// two modes: checkbox and simple label
QLabel *m_label;
QWidget *m_child;
QLabel *m_label = nullptr;
QWidget *m_child = nullptr;
QString m_tag;
bool m_urlHover;
bool m_urlHover = false;
};
}
......
......@@ -30,7 +30,6 @@ using namespace Baloo;
WidgetFactory::WidgetFactory(QObject *parent)
: QObject(parent)
, m_readOnly(false)
, m_dateFormat(QLocale::LongFormat)
{
}
......
......@@ -64,7 +64,7 @@ private:
KFileItemList m_items;
QStringList m_prevTags;
bool m_readOnly;
bool m_readOnly = false;
QLocale::FormatType m_dateFormat;
};
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment