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

Modernize code

parent 5f175030
Pipeline #33697 passed with stage
in 19 minutes and 18 seconds
......@@ -24,8 +24,6 @@
EditorPage::EditorPage(GrantleeThemeEditor::EditorPage::PageType type, const QString &projectDirectory, QWidget *parent)
: GrantleeThemeEditor::EditorPage(type, parent)
, mPreview(nullptr)
, mWidgetSplitter(nullptr)
{
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
......
......@@ -29,8 +29,6 @@
ThemeEditorMainWindow::ThemeEditorMainWindow()
: KXmlGuiWindow()
, mThemeEditor(nullptr)
, mUploadTheme(nullptr)
{
setupActions();
setupGUI();
......
......@@ -30,7 +30,6 @@
ThemeEditorPage::ThemeEditorPage(const QString &projectDir, const QString &themeName, QWidget *parent)
: QWidget(parent)
, mThemeSession(new GrantleeThemeEditor::ThemeSession(projectDir, QStringLiteral("headerthemeeditor")))
, mChanged(false)
{
QHBoxLayout *lay = new QHBoxLayout(this);
mTabWidget = new GrantleeThemeEditor::ThemeEditorTabWidget;
......
......@@ -61,7 +61,7 @@ private:
GrantleeThemeEditor::ThemeEditorTabWidget *mTabWidget = nullptr;
EditorPage *mEditorPage = nullptr;
GrantleeThemeEditor::DesktopFilePage *mDesktopPage = nullptr;
GrantleeThemeEditor::ThemeSession *mThemeSession = nullptr;
GrantleeThemeEditor::ThemeSession *const mThemeSession;
bool mChanged = false;
};
......
......@@ -30,7 +30,6 @@
ContactEditorPage::ContactEditorPage(const QString &projectDir, const QString &themeName, QWidget *parent)
: QWidget(parent)
, mThemeSession(new GrantleeThemeEditor::ThemeSession(projectDir, QStringLiteral("contactthemeeditor")))
, mChanged(false)
{
QHBoxLayout *lay = new QHBoxLayout(this);
mTabWidget = new GrantleeThemeEditor::ThemeEditorTabWidget(this);
......
......@@ -66,7 +66,7 @@ private:
EditorPage *mEditorGroupEmbeddedPage = nullptr;
EditorPage *mEditorEmbeddedPage = nullptr;
GrantleeThemeEditor::DesktopFilePage *mDesktopPage = nullptr;
GrantleeThemeEditor::ThemeSession *mThemeSession = nullptr;
GrantleeThemeEditor::ThemeSession *const mThemeSession;
bool mChanged = false;
};
......
......@@ -22,7 +22,6 @@
EditorPage::EditorPage(GrantleeThemeEditor::EditorPage::PageType type, const QString &projectDirectory, QWidget *parent)
: GrantleeThemeEditor::EditorPage(type, parent)
, mWidgetSplitter(nullptr)
{
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
......
......@@ -27,7 +27,7 @@ public:
void setDefault();
private:
Ui::ConfigureWidget *ui = nullptr;
Ui::ConfigureWidget *const ui;
};
}
......
......@@ -25,8 +25,6 @@ using namespace GrantleeThemeEditor;
DesktopFilePage::DesktopFilePage(const QString &defaultFileName, DesktopFilePage::DesktopFileOptions options, QWidget *parent)
: QWidget(parent)
, mFilename(nullptr)
, mExtraDisplayHeaders(nullptr)
{
QGridLayout *gridLayout = new QGridLayout(this);
QLabel *lab = new QLabel(i18n("Name:"), this);
......
......@@ -20,8 +20,6 @@ using namespace GrantleeThemeEditor;
EditorPage::EditorPage(PageType type, QWidget *parent)
: QWidget(parent)
, mType(type)
, mPreview(nullptr)
, mEditor(nullptr)
{
}
......
......@@ -46,7 +46,7 @@ Q_SIGNALS:
void changed();
protected:
PageType mType;
const PageType mType;
QString mPageFileName;
GrantleeThemeEditor::PreviewWidget *mPreview = nullptr;
GrantleeThemeEditor::EditorWidget *mEditor = nullptr;
......
......@@ -9,7 +9,6 @@ using namespace GrantleeThemeEditor;
PreviewWidget::PreviewWidget(QWidget *parent)
: QWidget(parent)
, mPrinting(false)
{
}
......
......@@ -33,7 +33,7 @@ Q_SIGNALS:
void needUpdateViewer();
protected:
bool mPrinting;
bool mPrinting = false;
};
}
......
......@@ -17,7 +17,6 @@ using namespace GrantleeThemeEditor;
ThemeSession::ThemeSession(const QString &projectDirectory, const QString &themeTypeName)
: mProjectDirectory(projectDirectory)
, mThemeTypeName(themeTypeName)
, mVersion(1)
{
}
......
......@@ -30,8 +30,8 @@ private:
QString mProjectDirectory;
QString mMainPageFileName;
QStringList mExtraPage;
QString mThemeTypeName;
int mVersion;
const QString mThemeTypeName;
const int mVersion = 1;
};
}
......
......@@ -22,7 +22,6 @@
EditorPage::EditorPage(GrantleeThemeEditor::EditorPage::PageType type, const QString &projectDirectory, QWidget *parent)
: GrantleeThemeEditor::EditorPage(type, parent)
, mWidgetSplitter(nullptr)
{
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
......
......@@ -30,8 +30,6 @@
ThemeEditorMainWindow::ThemeEditorMainWindow()
: KXmlGuiWindow()
, mThemeEditor(nullptr)
, mUploadTheme(nullptr)
{
setupActions();
setupGUI();
......
......@@ -63,7 +63,7 @@ private:
GrantleeThemeEditor::ThemeEditorTabWidget *mTabWidget = nullptr;
EditorPage *mEditorPage = nullptr;
GrantleeThemeEditor::DesktopFilePage *mDesktopPage = nullptr;
GrantleeThemeEditor::ThemeSession *mThemeSession = nullptr;
GrantleeThemeEditor::ThemeSession *const mThemeSession;
bool mChanged = false;
};
......
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