Commit ec5d7d5a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify pointer

parent 64cb9c53
Pipeline #55955 passed with stage
in 42 minutes and 42 seconds
......@@ -21,6 +21,7 @@ using namespace MessageViewer;
AttachmentDialog::AttachmentDialog(QWidget *parent, const QString &filenameText, const KService::Ptr &offer, const QString &dontAskAgainName)
: dontAskName(dontAskAgainName)
, dialog(new QDialog(parent))
{
text = xi18nc("@info",
"Open attachment <filename>%1</filename>?<nl/>"
......@@ -28,7 +29,6 @@ AttachmentDialog::AttachmentDialog(QWidget *parent, const QString &filenameText,
"your system's security.",
filenameText);
dialog = new QDialog(parent);
dialog->setWindowTitle(i18nc("@title:window", "Open Attachment?"));
dialog->setObjectName(QStringLiteral("attachmentSaveOpen"));
mButtonBox = new QDialogButtonBox(QDialogButtonBox::Cancel, dialog);
......
......@@ -38,7 +38,7 @@ private:
void openClicked();
void openWithClicked();
QString text, dontAskName;
QDialog *dialog = nullptr;
QDialog *const dialog;
QDialogButtonBox *mButtonBox = nullptr;
};
}
......
......@@ -37,10 +37,10 @@
using namespace MessageViewer;
MailSourceViewTextBrowserWidget::MailSourceViewTextBrowserWidget(const QString &syntax, QWidget *parent)
: QWidget(parent)
, mTextToSpeechWidget(new KPIMTextEdit::TextToSpeechWidget(this))
{
auto lay = new QVBoxLayout(this);
lay->setContentsMargins({});
mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget;
mTextToSpeechWidget->setObjectName(QStringLiteral("texttospeech"));
lay->addWidget(mTextToSpeechWidget);
......
......@@ -50,7 +50,7 @@ private:
MailSourceViewTextBrowser *mTextBrowser = nullptr;
FindBarSourceView *mFindBar = nullptr;
KPIMTextEdit::SlideContainer *mSliderContainer = nullptr;
KPIMTextEdit::TextToSpeechWidget *mTextToSpeechWidget = nullptr;
KPIMTextEdit::TextToSpeechWidget *const mTextToSpeechWidget;
};
class MailSourceViewTextBrowser : public QPlainTextEdit
......
......@@ -17,8 +17,8 @@ using namespace MessageViewer;
OpenSavedFileFolderWidget::OpenSavedFileFolderWidget(QWidget *parent)
: KMessageWidget(parent)
, mTimer(new QTimer(this))
{
mTimer = new QTimer(this);
mTimer->setSingleShot(true);
mTimer->setInterval(5000); // 5 seconds
connect(mTimer, &QTimer::timeout, this, &OpenSavedFileFolderWidget::slotTimeOut);
......
......@@ -31,7 +31,7 @@ private:
void slotTimeOut();
void slotExplicitlyClosed();
QList<QUrl> mUrls;
QTimer *mTimer = nullptr;
QTimer *const mTimer;
QAction *mShowFolderAction = nullptr;
};
}
......
......@@ -12,19 +12,19 @@
using namespace MessageViewer;
ShowNextMessageWidget::ShowNextMessageWidget(QWidget *parent)
: QWidget(parent)
, mNextMessage(new QPushButton(i18n("Next Message"), this))
, mPreviousMessage(new QPushButton(i18n("Previous Message"), this))
{
auto mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins({});
mPreviousMessage = new QPushButton(i18n("Previous Message"), this);
mPreviousMessage->setObjectName(QStringLiteral("previous_message"));
mPreviousMessage->setEnabled(false);
mainLayout->addWidget(mPreviousMessage);
connect(mPreviousMessage, &QPushButton::clicked, this, &ShowNextMessageWidget::showPreviousMessage);
mainLayout->addStretch(1);
mNextMessage = new QPushButton(i18n("Next Message"), this);
mNextMessage->setObjectName(QStringLiteral("next_message"));
mNextMessage->setEnabled(false);
connect(mNextMessage, &QPushButton::clicked, this, &ShowNextMessageWidget::showNextMessage);
......
......@@ -24,8 +24,8 @@ Q_SIGNALS:
void showPreviousMessage();
private:
QPushButton *mNextMessage = nullptr;
QPushButton *mPreviousMessage = nullptr;
QPushButton *const mNextMessage;
QPushButton *const mPreviousMessage;
};
}
Markdown is supported
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