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

const'ify pointer

parent 23440544
Pipeline #96851 skipped
......@@ -30,6 +30,8 @@ ShowArchiveStructureDialog::ShowArchiveStructureDialog(const QString &filename,
: QDialog(parent)
, mFileName(filename)
, mTreeWidget(new QTreeWidget(this))
, mExtractFile(new QPushButton(i18n("Extract Selected File"), this))
, mOpenFile(new QPushButton(i18n("Open Selected File"), this))
{
setWindowTitle(i18nc("@title:window", "Show Archive Content on file \"%1\"", filename));
setModal(true);
......@@ -47,14 +49,10 @@ ShowArchiveStructureDialog::ShowArchiveStructureDialog(const QString &filename,
connect(buttonBox, &QDialogButtonBox::rejected, this, &ShowArchiveStructureDialog::reject);
mExtractFile = new QPushButton(this);
mExtractFile->setText(i18n("Extract Selected File"));
mExtractFile->setEnabled(false);
connect(mExtractFile, &QPushButton::clicked, this, &ShowArchiveStructureDialog::slotExtractFile);
buttonBox->addButton(mExtractFile, QDialogButtonBox::ActionRole);
mOpenFile = new QPushButton(this);
mOpenFile->setText(i18n("Open Selected File"));
mOpenFile->setEnabled(false);
connect(mOpenFile, &QPushButton::clicked, this, &ShowArchiveStructureDialog::slotOpenFile);
buttonBox->addButton(mOpenFile, QDialogButtonBox::ActionRole);
......
......@@ -39,8 +39,8 @@ private:
QString mFileName;
QString mLogFile;
QTreeWidget *const mTreeWidget;
QPushButton *mExtractFile = nullptr;
QPushButton *mOpenFile = nullptr;
QPushButton *const mExtractFile;
QPushButton *const mOpenFile;
KZip *mZip = nullptr;
QTemporaryDir *mTempDir = nullptr;
};
......@@ -18,6 +18,7 @@
SynchronizeResourceDialog::SynchronizeResourceDialog(QWidget *parent)
: QDialog(parent)
, mListResourceWidget(new QListWidget(this))
{
setWindowTitle(i18nc("@title:window", "Synchronize Resources"));
auto topLayout = new QVBoxLayout(this);
......@@ -31,7 +32,6 @@ SynchronizeResourceDialog::SynchronizeResourceDialog(QWidget *parent)
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
mListResourceWidget = new QListWidget(this);
mListResourceWidget->setObjectName(QStringLiteral("listresourcewidget"));
auto listWidgetSearchLine = new KListWidgetSearchLine(this, mListResourceWidget);
listWidgetSearchLine->setObjectName(QStringLiteral("listwidgetsearchline"));
......
......@@ -28,5 +28,5 @@ private:
void readConfig();
void writeConfig();
void selectItem(bool state);
QListWidget *mListResourceWidget = nullptr;
QListWidget *const mListResourceWidget;
};
......@@ -52,6 +52,7 @@
PimDataExporterWindow::PimDataExporterWindow(QWidget *parent)
: KXmlGuiWindow(parent)
, mLogWidget(new LogWidget(this))
{
// Initialize filtermanager
(void)MailCommon::FilterManager::instance();
......@@ -65,7 +66,6 @@ PimDataExporterWindow::PimDataExporterWindow(QWidget *parent)
setupActions(true);
setupGUI(Keys | StatusBar | Save | Create, QStringLiteral("pimdataexporter.rc"));
mLogWidget = new LogWidget(this);
setCentralWidget(mLogWidget);
resize(800, 600);
......
......@@ -53,7 +53,7 @@ private:
QString mLastArchiveFileName;
// Name, identifier
QHash<QString, QString> mNeedToSyncResources;
LogWidget *mLogWidget = nullptr;
LogWidget *const mLogWidget;
KRecentFilesMenu *mRecentFilesMenu = nullptr;
QAction *mBackupAction = nullptr;
QAction *mRestoreAction = nullptr;
......
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