Commit 858f98d8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify pointer

parent 9e3b836c
Pipeline #194000 passed with stage
in 1 minute and 14 seconds
......@@ -184,7 +184,7 @@ void NotesAgentAlarmDialog::slotModifyItem(KJob *job)
void NotesAgentAlarmDialog::slotModifyAlarm()
{
Akonadi::Item::Id id = mListWidget->currentItemId();
const Akonadi::Item::Id id = mListWidget->currentItemId();
if (id != -1) {
Akonadi::Item item(id);
auto job = new Akonadi::ItemFetchJob(item, this);
......
......@@ -25,16 +25,16 @@
NotesAgentNoteDialog::NotesAgentNoteDialog(QWidget *parent)
: QDialog(parent)
, mSubject(new QLineEdit(this))
, mNote(new KPIMTextEdit::RichTextEditorWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
setAttribute(Qt::WA_DeleteOnClose);
setWindowIcon(QIcon::fromTheme(QStringLiteral("knotes")));
mSubject = new QLineEdit(this);
mSubject->setReadOnly(true);
mainLayout->addWidget(mSubject);
mNote = new KPIMTextEdit::RichTextEditorWidget(this);
mNote->setReadOnly(true);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
......
......@@ -28,6 +28,6 @@ private Q_SLOTS:
private:
void readConfig();
void writeConfig();
KPIMTextEdit::RichTextEditorWidget *mNote = nullptr;
QLineEdit *mSubject = nullptr;
KPIMTextEdit::RichTextEditorWidget *const mNote;
QLineEdit *const mSubject;
};
......@@ -25,6 +25,8 @@
NotesAgentSettingsDialog::NotesAgentSettingsDialog(QWidget *parent)
: QDialog(parent)
, mNotify(new KNotifyConfigWidget(this))
, mNetworkConfig(new NoteShared::NoteNetworkConfigWidget(this))
{
setWindowTitle(i18nc("@title:window", "Configure Notes Agent"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("knotes")));
......@@ -40,11 +42,9 @@ NotesAgentSettingsDialog::NotesAgentSettingsDialog(QWidget *parent)
auto tab = new QTabWidget(this);
mNotify = new KNotifyConfigWidget(this);
mNotify->setApplication(QStringLiteral("akonadi_notes_agent"));
tab->addTab(mNotify, i18n("Notify"));
mNetworkConfig = new NoteShared::NoteNetworkConfigWidget(this);
tab->addTab(mNetworkConfig, i18n("Network"));
mNetworkConfig->load();
......
......@@ -25,6 +25,6 @@ private Q_SLOTS:
private:
void writeConfig();
void readConfig();
KNotifyConfigWidget *mNotify = nullptr;
NoteShared::NoteNetworkConfigWidget *mNetworkConfig = nullptr;
KNotifyConfigWidget *const mNotify;
NoteShared::NoteNetworkConfigWidget *const mNetworkConfig;
};
......@@ -32,8 +32,8 @@
NotesManager::NotesManager(QObject *parent)
: QObject(parent)
, mSession(new Akonadi::Session("KNotes Session", this))
{
mSession = new Akonadi::Session("KNotes Session", this);
mNoteRecorder = new NoteShared::NotesChangeRecorder(this);
mNoteRecorder->changeRecorder()->setSession(mSession);
connect(mNoteRecorder->changeRecorder(), &Akonadi::Monitor::itemAdded, this, &NotesManager::slotItemAdded);
......
......@@ -53,6 +53,6 @@ private:
QTcpServer *mListener = nullptr;
QTimer *mCheckAlarm = nullptr;
NoteShared::NotesChangeRecorder *mNoteRecorder = nullptr;
Akonadi::Session *mSession = nullptr;
Akonadi::Session *const mSession;
QPointer<NotesAgentAlarmDialog> mAlarmDialog;
};
......@@ -26,6 +26,8 @@ using namespace NoteShared;
NoteHostDialog::NoteHostDialog(const QString &caption, QWidget *parent)
: QDialog(parent)
, m_hostCombo(new KHistoryComboBox(true, this))
, m_servicesView(new QTreeView(this))
{
setWindowTitle(caption);
......@@ -41,7 +43,6 @@ NoteHostDialog::NoteHostDialog(const QString &caption, QWidget *parent)
auto label = new QLabel(i18n("Select recipient:"), this);
mainLayout->addWidget(label);
m_servicesView = new QTreeView(this);
m_servicesView->setRootIsDecorated(false);
auto mdl = new KDNSSD::ServiceModel(new KDNSSD::ServiceBrowser(QStringLiteral("_knotes._tcp"), true), this);
m_servicesView->setModel(mdl);
......@@ -58,7 +59,6 @@ NoteHostDialog::NoteHostDialog(const QString &caption, QWidget *parent)
label = new QLabel(i18n("Hostname or IP address:"), this);
mainLayout->addWidget(label);
m_hostCombo = new KHistoryComboBox(true, this);
mainLayout->addWidget(m_hostCombo);
m_hostCombo->setMinimumWidth(fontMetrics().maxWidth() * 15);
m_hostCombo->setDuplicatesEnabled(false);
......
......@@ -39,8 +39,8 @@ private:
void slotServiceDoubleClicked(const QModelIndex &idx);
void readConfig();
KHistoryComboBox *m_hostCombo = nullptr;
QTreeView *m_servicesView = nullptr;
KHistoryComboBox *const m_hostCombo;
QTreeView *const m_servicesView;
QPushButton *mOkButton = nullptr;
};
}
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