Commit 8ee70880 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer

parent a7249d3e
Pipeline #57969 canceled with stage
in 9 minutes and 20 seconds
......@@ -25,7 +25,7 @@ public:
void render(Grantlee::OutputStream *stream, Grantlee::Context *context) const override;
private:
QString m_name;
const QString m_name;
};
class CallbackTagFactory : public Grantlee::AbstractNodeFactory
......
......@@ -116,18 +116,18 @@ protected:
QString imgHideUrl;
private:
QString quoteCssDefinition() const;
Q_REQUIRED_RESULT QString quoteCssDefinition() const;
int fontSize(bool fixed, bool print = false) const;
// returns CSS rules specific to the print media type
QString printCssDefinitions(bool fixed) const;
Q_REQUIRED_RESULT QString printCssDefinitions(bool fixed) const;
// returns CSS rules specific to the screen media type
QString screenCssDefinitions(const CSSHelperBase *helper, bool fixed) const;
Q_REQUIRED_RESULT QString screenCssDefinitions(const CSSHelperBase *helper, bool fixed) const;
// returns CSS rules common to both screen and print media types
QString commonCssDefinitions() const;
QString fullAddressList() const;
QString linkColorDefinition() const;
QString defaultScreenHeaderFont() const;
QString defaultPrintHeaderFont() const;
Q_REQUIRED_RESULT QString commonCssDefinitions() const;
Q_REQUIRED_RESULT QString fullAddressList() const;
Q_REQUIRED_RESULT QString linkColorDefinition() const;
Q_REQUIRED_RESULT QString defaultScreenHeaderFont() const;
Q_REQUIRED_RESULT QString defaultPrintHeaderFont() const;
const QPaintDevice *mPaintDevice = nullptr;
const HeaderStylePlugin *mHeaderPlugin = nullptr;
......
......@@ -37,6 +37,7 @@
using namespace MessageViewer;
MailSourceViewTextBrowserWidget::MailSourceViewTextBrowserWidget(const QString &syntax, QWidget *parent)
: QWidget(parent)
, mSliderContainer(new KPIMTextEdit::SlideContainer(this))
, mTextToSpeechWidget(new KPIMTextEdit::TextToSpeechWidget(this))
{
auto lay = new QVBoxLayout(this);
......@@ -63,7 +64,6 @@ MailSourceViewTextBrowserWidget::MailSourceViewTextBrowserWidget(const QString &
connect(mTextBrowser, &MailSourceViewTextBrowser::findText, this, &MailSourceViewTextBrowserWidget::slotFind);
lay->addWidget(mTextBrowser);
mSliderContainer = new KPIMTextEdit::SlideContainer(this);
mFindBar = new FindBarSourceView(mTextBrowser, this);
mFindBar->setObjectName(QStringLiteral("findbar"));
......
......@@ -49,7 +49,7 @@ private:
KSyntaxHighlighting::Repository mRepo;
MailSourceViewTextBrowser *mTextBrowser = nullptr;
FindBarSourceView *mFindBar = nullptr;
KPIMTextEdit::SlideContainer *mSliderContainer = nullptr;
KPIMTextEdit::SlideContainer *const mSliderContainer;
KPIMTextEdit::TextToSpeechWidget *const mTextToSpeechWidget;
};
......
......@@ -18,6 +18,7 @@ using namespace MessageViewer;
OpenSavedFileFolderWidget::OpenSavedFileFolderWidget(QWidget *parent)
: KMessageWidget(parent)
, mTimer(new QTimer(this))
, mShowFolderAction(new QAction(i18nc("@action", "Open folder where attachment was saved"), this))
{
mTimer->setSingleShot(true);
mTimer->setInterval(5000); // 5 seconds
......@@ -31,7 +32,6 @@ OpenSavedFileFolderWidget::OpenSavedFileFolderWidget(QWidget *parent)
connect(action, &QAction::triggered, this, &OpenSavedFileFolderWidget::slotExplicitlyClosed);
}
mShowFolderAction = new QAction(i18nc("@action", "Open folder where attachment was saved"), this);
connect(mShowFolderAction, &QAction::triggered, this, &OpenSavedFileFolderWidget::slotOpenSavedFileFolder);
addAction(mShowFolderAction);
}
......
......@@ -32,7 +32,7 @@ private:
void slotExplicitlyClosed();
QList<QUrl> mUrls;
QTimer *const mTimer;
QAction *mShowFolderAction = nullptr;
QAction *const mShowFolderAction;
};
}
......@@ -30,14 +30,15 @@ static const char myVCardViewerConfigGroupName[] = "VCardViewer";
}
VCardViewer::VCardViewer(QWidget *parent, const QByteArray &vCard)
: QDialog(parent)
, mContactViewer(new KAddressBookGrantlee::GrantleeContactViewer(this))
, mUser2Button(new QPushButton)
, mUser3Button(new QPushButton)
{
setWindowTitle(i18nc("@title:window", "vCard Viewer"));
auto mainLayout = new QVBoxLayout(this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
auto user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
mUser2Button = new QPushButton;
mUser3Button = new QPushButton;
buttonBox->addButton(mUser3Button, QDialogButtonBox::ActionRole);
buttonBox->addButton(mUser2Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &VCardViewer::reject);
......@@ -48,7 +49,6 @@ VCardViewer::VCardViewer(QWidget *parent, const QByteArray &vCard)
KGuiItem::assign(mUser2Button, KGuiItem(i18n("&Next Card")));
KGuiItem::assign(mUser3Button, KGuiItem(i18n("&Previous Card")));
mContactViewer = new KAddressBookGrantlee::GrantleeContactViewer(this);
auto actions = new Akonadi::ContactDefaultActions(this);
actions->connectToView(mContactViewer);
......
......@@ -32,9 +32,9 @@ private:
KContacts::Addressee::List mAddresseeList;
int mAddresseeListIndex = 0;
KAddressBookGrantlee::GrantleeContactViewer *mContactViewer = nullptr;
QPushButton *mUser2Button = nullptr;
QPushButton *mUser3Button = nullptr;
KAddressBookGrantlee::GrantleeContactViewer *const mContactViewer;
QPushButton *const mUser2Button;
QPushButton *const mUser3Button;
};
}
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