Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KScreen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
KScreen
Commits
c2f85dd2
Commit
c2f85dd2
authored
Oct 23, 2017
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize pointer/value. Minor optimization
parent
8a3be290
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
47 additions
and
47 deletions
+47
-47
kcm/src/collapsablebutton.cpp
kcm/src/collapsablebutton.cpp
+1
-1
kcm/src/controlpanel.h
kcm/src/controlpanel.h
+1
-1
kcm/src/declarative/qmloutputcomponent.cpp
kcm/src/declarative/qmloutputcomponent.cpp
+3
-6
kcm/src/declarative/qmlscreen.cpp
kcm/src/declarative/qmlscreen.cpp
+5
-5
kcm/src/declarative/qmlscreen.h
kcm/src/declarative/qmlscreen.h
+6
-3
kcm/src/kcm_kscreen.h
kcm/src/kcm_kscreen.h
+2
-2
kcm/src/outputconfig.h
kcm/src/outputconfig.h
+7
-7
kcm/src/previewwidget.h
kcm/src/previewwidget.h
+2
-2
kcm/src/primaryoutputcombo.h
kcm/src/primaryoutputcombo.h
+2
-2
kcm/src/resolutionslider.h
kcm/src/resolutionslider.h
+6
-6
kcm/src/widget.cpp
kcm/src/widget.cpp
+1
-1
kcm/src/widget.h
kcm/src/widget.h
+11
-11
No files found.
kcm/src/collapsablebutton.cpp
View file @
c2f85dd2
...
...
@@ -30,7 +30,7 @@
CollapsableButton
::
CollapsableButton
(
const
QString
&
text
,
QWidget
*
parent
)
:
QWidget
(
parent
)
,
mCollapsed
(
false
)
,
mWidget
(
0
)
,
mWidget
(
nullptr
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
mLabel
=
new
QLabel
(
text
,
this
);
...
...
kcm/src/controlpanel.h
View file @
c2f85dd2
...
...
@@ -40,7 +40,7 @@ class ControlPanel : public QFrame
Q_OBJECT
public:
explicit
ControlPanel
(
QWidget
*
parent
=
0
);
explicit
ControlPanel
(
QWidget
*
parent
=
nullptr
);
virtual
~
ControlPanel
();
void
setConfig
(
const
KScreen
::
ConfigPtr
&
config
);
...
...
kcm/src/declarative/qmloutputcomponent.cpp
View file @
c2f85dd2
...
...
@@ -44,16 +44,13 @@ QMLOutputComponent::~QMLOutputComponent()
QMLOutput
*
QMLOutputComponent
::
createForOutput
(
const
KScreen
::
OutputPtr
&
output
)
{
QObject
*
instance
;
instance
=
beginCreate
(
m_engine
->
rootContext
());
QObject
*
instance
=
beginCreate
(
m_engine
->
rootContext
());
if
(
!
instance
)
{
qWarning
()
<<
errorString
();
return
0
;
return
nullptr
;
}
bool
success
=
false
;
success
=
instance
->
setProperty
(
"outputPtr"
,
QVariant
::
fromValue
(
output
));
bool
success
=
instance
->
setProperty
(
"outputPtr"
,
QVariant
::
fromValue
(
output
));
Q_ASSERT
(
success
);
success
=
instance
->
setProperty
(
"screen"
,
QVariant
::
fromValue
(
qobject_cast
<
QMLScreen
*>
(
parent
())));
Q_ASSERT
(
success
);
...
...
kcm/src/declarative/qmlscreen.cpp
View file @
c2f85dd2
...
...
@@ -33,13 +33,13 @@
QMLScreen
::
QMLScreen
(
QQuickItem
*
parent
)
:
QQuickItem
(
parent
),
m_config
(
0
),
m_config
(
nullptr
),
m_connectedOutputsCount
(
0
),
m_enabledOutputsCount
(
0
),
m_leftmost
(
0
),
m_topmost
(
0
),
m_rightmost
(
0
),
m_bottommost
(
0
)
m_leftmost
(
nullptr
),
m_topmost
(
nullptr
),
m_rightmost
(
nullptr
),
m_bottommost
(
nullptr
)
{
connect
(
this
,
&
QMLScreen
::
widthChanged
,
this
,
&
QMLScreen
::
viewSizeChanged
);
connect
(
this
,
&
QMLScreen
::
heightChanged
,
this
,
&
QMLScreen
::
viewSizeChanged
);
...
...
kcm/src/declarative/qmlscreen.h
View file @
c2f85dd2
...
...
@@ -56,7 +56,7 @@ class QMLScreen : public QQuickItem
MEMBER
m_engine
)
public:
explicit
QMLScreen
(
QQuickItem
*
parent
=
0
);
explicit
QMLScreen
(
QQuickItem
*
parent
=
nullptr
);
virtual
~
QMLScreen
();
...
...
@@ -111,8 +111,11 @@ class QMLScreen : public QQuickItem
int
m_connectedOutputsCount
;
int
m_enabledOutputsCount
;
QQmlEngine
*
m_engine
;
QMLOutput
*
m_leftmost
,
*
m_topmost
,
*
m_rightmost
,
*
m_bottommost
;
QQmlEngine
*
m_engine
=
nullptr
;
QMLOutput
*
m_leftmost
=
nullptr
;
QMLOutput
*
m_topmost
=
nullptr
;
QMLOutput
*
m_rightmost
=
nullptr
;
QMLOutput
*
m_bottommost
=
nullptr
;
};
...
...
kcm/src/kcm_kscreen.h
View file @
c2f85dd2
...
...
@@ -34,7 +34,7 @@ class KCMKScreen : public KCModule
Q_OBJECT
public:
explicit
KCMKScreen
(
QWidget
*
parent
=
0
,
const
QVariantList
&
args
=
QVariantList
());
explicit
KCMKScreen
(
QWidget
*
parent
=
nullptr
,
const
QVariantList
&
args
=
QVariantList
());
virtual
~
KCMKScreen
();
virtual
QSize
sizeHint
()
const
Q_DECL_OVERRIDE
;
...
...
@@ -48,7 +48,7 @@ class KCMKScreen : public KCModule
private:
void
configReady
(
KScreen
::
ConfigOperation
*
op
);
Widget
*
mKScreenWidget
;
Widget
*
mKScreenWidget
=
nullptr
;
bool
m_blockChanges
=
false
;
QHBoxLayout
*
mMainLayout
=
nullptr
;
...
...
kcm/src/outputconfig.h
View file @
c2f85dd2
...
...
@@ -40,7 +40,7 @@ class OutputConfig : public QWidget
public:
explicit
OutputConfig
(
QWidget
*
parent
);
explicit
OutputConfig
(
const
KScreen
::
OutputPtr
&
output
,
QWidget
*
parent
=
0
);
explicit
OutputConfig
(
const
KScreen
::
OutputPtr
&
output
,
QWidget
*
parent
=
nullptr
);
virtual
~
OutputConfig
();
virtual
void
setOutput
(
const
KScreen
::
OutputPtr
&
output
);
...
...
@@ -63,13 +63,13 @@ class OutputConfig : public QWidget
virtual
void
initUi
();
protected:
QLabel
*
mTitle
;
QLabel
*
mTitle
=
nullptr
;
KScreen
::
OutputPtr
mOutput
;
QCheckBox
*
mEnabled
;
ResolutionSlider
*
mResolution
;
QComboBox
*
mRotation
;
QComboBox
*
mScale
;
QComboBox
*
mRefreshRate
;
QCheckBox
*
mEnabled
=
nullptr
;
ResolutionSlider
*
mResolution
=
nullptr
;
QComboBox
*
mRotation
=
nullptr
;
QComboBox
*
mScale
=
nullptr
;
QComboBox
*
mRefreshRate
=
nullptr
;
bool
mShowScaleOption
=
false
;
};
...
...
kcm/src/previewwidget.h
View file @
c2f85dd2
...
...
@@ -28,7 +28,7 @@ class PreviewWidget : public QLabel
{
Q_OBJECT
public:
PreviewWidget
(
QWidget
*
parent
=
0
);
explicit
PreviewWidget
(
QWidget
*
parent
=
nullptr
);
~
PreviewWidget
();
void
setScale
(
qreal
scale
);
public
Q_SLOTS
:
...
...
@@ -36,7 +36,7 @@ public Q_SLOTS:
private:
qreal
pointSizeToPixelSize
(
qreal
pointSize
)
const
;
qreal
m_scale
;
QWidget
*
m_internalPreview
;
QWidget
*
m_internalPreview
=
nullptr
;
};
#endif // PREVIEWWIDGET_H
kcm/src/primaryoutputcombo.h
View file @
c2f85dd2
...
...
@@ -30,7 +30,7 @@ class PrimaryOutputCombo : public QComboBox
{
Q_OBJECT
public:
explicit
PrimaryOutputCombo
(
QWidget
*
parent
=
0
);
explicit
PrimaryOutputCombo
(
QWidget
*
parent
=
nullptr
);
virtual
~
PrimaryOutputCombo
();
void
setConfig
(
const
KScreen
::
ConfigPtr
&
config
);
...
...
@@ -55,4 +55,4 @@ private:
KScreen
::
ConfigPtr
mConfig
;
};
#endif
\ No newline at end of file
#endif
kcm/src/resolutionslider.h
View file @
c2f85dd2
...
...
@@ -36,7 +36,7 @@ class ResolutionSlider : public QWidget
Q_OBJECT
public:
explicit
ResolutionSlider
(
const
KScreen
::
OutputPtr
&
output
,
QWidget
*
parent
=
0
);
explicit
ResolutionSlider
(
const
KScreen
::
OutputPtr
&
output
,
QWidget
*
parent
=
nullptr
);
virtual
~
ResolutionSlider
();
QSize
currentResolution
()
const
;
...
...
@@ -53,11 +53,11 @@ class ResolutionSlider : public QWidget
QList
<
QSize
>
mModes
;
QLabel
*
mSmallestLabel
;
QLabel
*
mBiggestLabel
;
QLabel
*
mCurrentLabel
;
QSlider
*
mSlider
;
QComboBox
*
mComboBox
;
QLabel
*
mSmallestLabel
=
nullptr
;
QLabel
*
mBiggestLabel
=
nullptr
;
QLabel
*
mCurrentLabel
=
nullptr
;
QSlider
*
mSlider
=
nullptr
;
QComboBox
*
mComboBox
=
nullptr
;
};
#endif // RESOLUTIONSLIDER_H
kcm/src/widget.cpp
View file @
c2f85dd2
...
...
@@ -190,7 +190,7 @@ void Widget::setConfig(const KScreen::ConfigPtr &config)
if
(
qmlOutput
)
{
mScreen
->
setActiveOutput
(
qmlOutput
);
}
else
{
if
(
mScreen
->
outputs
().
count
()
>
0
)
{
if
(
!
mScreen
->
outputs
().
isEmpty
()
)
{
mScreen
->
setActiveOutput
(
mScreen
->
outputs
()[
0
]);
}
}
...
...
kcm/src/widget.h
View file @
c2f85dd2
...
...
@@ -46,7 +46,7 @@ class Widget : public QWidget
Q_OBJECT
public:
explicit
Widget
(
QWidget
*
parent
=
0
);
explicit
Widget
(
QWidget
*
parent
=
nullptr
);
virtual
~
Widget
();
void
setConfig
(
const
KScreen
::
ConfigPtr
&
config
);
...
...
@@ -80,23 +80,23 @@ class Widget : public QWidget
KScreen
::
OutputPtr
findOutput
(
const
KScreen
::
ConfigPtr
&
config
,
const
QVariantMap
&
info
);
private:
QMLScreen
*
mScreen
;
QMLScreen
*
mScreen
=
nullptr
;
KScreen
::
ConfigPtr
mConfig
;
KScreen
::
ConfigPtr
mPrevConfig
;
QQuickView
*
mDeclarativeView
;
ControlPanel
*
mControlPanel
;
QQuickView
*
mDeclarativeView
=
nullptr
;
ControlPanel
*
mControlPanel
=
nullptr
;
ProfilesModel
*
mProfilesModel
;
PrimaryOutputCombo
*
mPrimaryCombo
;
QComboBox
*
mProfilesCombo
;
ProfilesModel
*
mProfilesModel
=
nullptr
;
PrimaryOutputCombo
*
mPrimaryCombo
=
nullptr
;
QComboBox
*
mProfilesCombo
=
nullptr
;
QPushButton
*
mScaleAllOutputsButton
;
QPushButton
*
mUnifyButton
;
QPushButton
*
mSaveProfileButton
;
QPushButton
*
mScaleAllOutputsButton
=
nullptr
;
QPushButton
*
mUnifyButton
=
nullptr
;
QPushButton
*
mSaveProfileButton
=
nullptr
;
QList
<
QQuickView
*>
mOutputIdentifiers
;
QTimer
*
mOutputTimer
;
QTimer
*
mOutputTimer
=
nullptr
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment