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
KInfoCenter
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
3
Merge Requests
3
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
KInfoCenter
Commits
653900d2
Commit
653900d2
authored
Oct 22, 2017
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USe nullptr. Clean up. Optimization
parent
49f84c21
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
61 additions
and
68 deletions
+61
-68
Modules/about-distro/src/Module.cpp
Modules/about-distro/src/Module.cpp
+1
-0
Modules/about-distro/src/OSRelease.cpp
Modules/about-distro/src/OSRelease.cpp
+3
-3
Modules/devinfo/devicelisting.cpp
Modules/devinfo/devicelisting.cpp
+2
-2
Modules/devinfo/infopanel.cpp
Modules/devinfo/infopanel.cpp
+1
-6
Modules/devinfo/qvlistlayout.cpp
Modules/devinfo/qvlistlayout.cpp
+1
-1
Modules/devinfo/soldevice.cpp
Modules/devinfo/soldevice.cpp
+3
-3
Modules/devinfo/soldevicetypes.cpp
Modules/devinfo/soldevicetypes.cpp
+7
-7
Modules/devinfo/solidhelper.cpp
Modules/devinfo/solidhelper.cpp
+1
-1
Modules/energy/statisticsprovider.cpp
Modules/energy/statisticsprovider.cpp
+1
-1
Modules/info/info.cpp
Modules/info/info.cpp
+1
-2
Modules/memory/chartWidget.cpp
Modules/memory/chartWidget.cpp
+11
-11
Modules/memory/chartWidget.h
Modules/memory/chartWidget.h
+3
-3
Modules/nics/nic.cpp
Modules/nics/nic.cpp
+1
-2
Modules/opengl/opengl.cpp
Modules/opengl/opengl.cpp
+13
-13
Modules/samba/ksmbstatus.cpp
Modules/samba/ksmbstatus.cpp
+1
-1
Modules/samba/main.cpp
Modules/samba/main.cpp
+1
-1
Modules/usbview/kcmusb.cpp
Modules/usbview/kcmusb.cpp
+1
-1
Modules/usbview/usbdevices.cpp
Modules/usbview/usbdevices.cpp
+2
-2
infocenter.cpp
infocenter.cpp
+0
-1
infokcmmodel.cpp
infokcmmodel.cpp
+5
-5
kcmtreeitem.cpp
kcmtreeitem.cpp
+2
-2
No files found.
Modules/about-distro/src/Module.cpp
View file @
653900d2
...
...
@@ -212,6 +212,7 @@ void Module::loadHardware()
}
// Create a formatted list of grouped processors
QStringList
names
;
names
.
reserve
(
processorMap
.
count
());
for
(
auto
it
=
processorMap
.
constBegin
();
it
!=
processorMap
.
constEnd
();
++
it
)
{
const
int
count
=
it
.
value
();
QString
name
=
it
.
key
();
...
...
Modules/about-distro/src/OSRelease.cpp
View file @
653900d2
...
...
@@ -34,7 +34,7 @@ static void setVar(QString *var, const QString &value)
if
(
error
!=
KShell
::
NoError
)
{
// Failed to parse.
return
;
}
*
var
=
args
.
join
(
QChar
(
' '
));
*
var
=
args
.
join
(
Q
Latin1
Char
(
' '
));
}
static
void
setVar
(
QStringList
*
var
,
const
QString
&
value
)
...
...
@@ -91,12 +91,12 @@ OSRelease::OSRelease()
while
(
!
file
.
atEnd
())
{
line
=
file
.
readLine
();
if
(
line
.
startsWith
(
QChar
(
'#'
)))
{
if
(
line
.
startsWith
(
Q
Latin1
Char
(
'#'
)))
{
// Comment line
continue
;
}
comps
=
line
.
split
(
QChar
(
'='
));
comps
=
line
.
split
(
Q
Latin1
Char
(
'='
));
if
(
comps
.
size
()
!=
2
)
{
// Invalid line.
...
...
Modules/devinfo/devicelisting.cpp
View file @
653900d2
...
...
@@ -153,7 +153,7 @@ void DeviceListing::deviceAddedSlot(const QString &udi)
QTreeWidgetItem
*
parent
=
getTreeWidgetItemFromUdi
(
this
,
dev
.
parentUdi
());
// Incase of bad index
if
(
deviceMap
[
deviceType
]
==
NULL
)
{
if
(
deviceMap
[
deviceType
]
==
nullptr
)
{
QTreeWidgetItem
*
topItem
=
topLevelItem
(
0
);
if
(
topItem
==
0
)
{
delete
solhelp
;
...
...
@@ -179,7 +179,7 @@ void DeviceListing::deviceAddedSlot(const QString &udi)
new
SolStorageDevice
(
deviceMap
[
deviceType
],
dev
,
SolStorageDevice
::
NOCHILDREN
);
break
;
case
Solid
::
DeviceInterface
::
StorageVolume
:
if
(
parent
==
NULL
)
{
if
(
parent
==
nullptr
)
{
break
;
}
new
SolVolumeDevice
(
parent
,
dev
);
...
...
Modules/devinfo/infopanel.cpp
View file @
653900d2
...
...
@@ -117,17 +117,12 @@ QLabel *InfoPanel::setDevicesIcon(const QIcon &deviceIcon)
void
InfoPanel
::
setTopInfo
(
const
QIcon
&
deviceIcon
,
Solid
::
Device
*
device
)
{
QList
<
QString
>
labels
;
setTopWidgetLayout
();
QVListLayout
*
tLayout
=
static_cast
<
QVListLayout
*>
(
top
->
layout
());
tLayout
->
addWidget
(
setDevicesIcon
(
deviceIcon
),
0
,
Qt
::
AlignHCenter
);
labels
<<
i18n
(
"Product: "
)
<<
device
->
product
()
<<
i18n
(
"Vendor: "
)
<<
friendlyString
(
device
->
vendor
());
const
QStringList
labels
{
i18n
(
"Product: "
),
device
->
product
(),
i18n
(
"Vendor: "
),
friendlyString
(
device
->
vendor
())};
status
->
updateStatus
(
device
->
udi
());
tLayout
->
applyQListToLayout
(
labels
);
...
...
Modules/devinfo/qvlistlayout.cpp
View file @
653900d2
...
...
@@ -37,7 +37,7 @@ void QVListLayout::applyQListToLayout(const QStringList &list)
QFont
labelFont
;
labelFont
.
setBold
(
true
);
for
each
(
const
QString
&
item
,
list
)
{
for
(
const
QString
&
item
:
list
)
{
if
(
!
item
.
isEmpty
())
{
bLabel
=
new
QLabel
(
item
);
bLabel
->
setWordWrap
(
true
);
...
...
Modules/devinfo/soldevice.cpp
View file @
653900d2
...
...
@@ -25,7 +25,7 @@
SolDevice
::
SolDevice
(
const
Solid
::
DeviceInterface
::
Type
&
type
)
:
QTreeWidgetItem
()
,
deviceSet
(
0
)
,
deviceSet
(
false
)
{
deviceTypeHolder
=
type
;
setText
(
0
,
Solid
::
DeviceInterface
::
typeToString
(
type
));
...
...
@@ -33,14 +33,14 @@ SolDevice::SolDevice(const Solid::DeviceInterface::Type &type)
SolDevice
::
SolDevice
(
QTreeWidgetItem
*
parent
)
:
QTreeWidgetItem
(
parent
)
,
deviceSet
(
0
)
,
deviceSet
(
false
)
{
deviceTypeHolder
=
Solid
::
DeviceInterface
::
Unknown
;
}
SolDevice
::
SolDevice
(
const
Solid
::
DeviceInterface
::
Type
&
type
,
const
QString
&
typeName
)
:
QTreeWidgetItem
()
,
deviceSet
(
0
)
,
deviceSet
(
false
)
{
deviceTypeHolder
=
type
;
setText
(
0
,
typeName
);
...
...
Modules/devinfo/soldevicetypes.cpp
View file @
653900d2
...
...
@@ -64,7 +64,7 @@ QVListLayout *SolProcessorDevice::infoPanelLayout()
const
Solid
::
Processor
*
prodev
=
interface
<
const
Solid
::
Processor
>
();
if
(
!
prodev
)
{
return
NULL
;
return
nullptr
;
}
deviceInfoLayout
=
new
QVListLayout
();
...
...
@@ -181,7 +181,7 @@ QVListLayout *SolStorageDevice::infoPanelLayout()
const
Solid
::
StorageDrive
*
stodev
=
interface
<
const
Solid
::
StorageDrive
>
();
if
(
!
stodev
)
{
return
NULL
;
return
nullptr
;
}
deviceInfoLayout
=
new
QVListLayout
();
...
...
@@ -244,13 +244,13 @@ void SolVolumeDevice::setDefaultListing(const Solid::DeviceInterface::Type &type
QVListLayout
*
SolVolumeDevice
::
infoPanelLayout
()
{
QStringList
labels
;
KCapacityBar
*
usageBar
=
NULL
;
KCapacityBar
*
usageBar
=
nullptr
;
const
Solid
::
StorageVolume
*
voldev
=
interface
<
const
Solid
::
StorageVolume
>
();
const
Solid
::
StorageAccess
*
accdev
=
interface
<
const
Solid
::
StorageAccess
>
();
if
(
!
voldev
)
{
return
NULL
;
return
nullptr
;
}
deviceInfoLayout
=
new
QVListLayout
();
...
...
@@ -349,7 +349,7 @@ QVListLayout *SolMediaPlayerDevice::infoPanelLayout()
const
Solid
::
PortableMediaPlayer
*
mpdev
=
interface
<
const
Solid
::
PortableMediaPlayer
>
();
if
(
!
mpdev
)
{
return
NULL
;
return
nullptr
;
}
deviceInfoLayout
=
new
QVListLayout
();
...
...
@@ -391,7 +391,7 @@ QVListLayout *SolCameraDevice::infoPanelLayout()
const
Solid
::
Camera
*
camdev
=
interface
<
const
Solid
::
Camera
>
();
if
(
!
camdev
)
{
return
NULL
;
return
nullptr
;
}
deviceInfoLayout
=
new
QVListLayout
();
...
...
@@ -433,7 +433,7 @@ QVListLayout *SolBatteryDevice::infoPanelLayout()
const
Solid
::
Battery
*
batdev
=
interface
<
const
Solid
::
Battery
>
();
if
(
!
batdev
)
{
return
NULL
;
return
nullptr
;
}
deviceInfoLayout
=
new
QVListLayout
();
...
...
Modules/devinfo/solidhelper.cpp
View file @
653900d2
...
...
@@ -32,7 +32,7 @@ Solid::DeviceInterface::Type SolidHelper::deviceType(const Solid::Device *dev)
Solid
::
DeviceInterface
::
StorageVolume
};
for
(
unsigned
int
i
=
0
;
i
<
(
sizeof
(
needHardware
)
/
sizeof
(
Solid
::
DeviceInterface
::
Type
));
i
++
)
{
for
(
unsigned
int
i
=
0
,
total
=
(
sizeof
(
needHardware
)
/
sizeof
(
Solid
::
DeviceInterface
::
Type
));
i
<
total
;
++
i
)
{
if
(
dev
->
isDeviceInterface
(
needHardware
[
i
])
==
true
)
{
return
needHardware
[
i
];
}
...
...
Modules/energy/statisticsprovider.cpp
View file @
653900d2
...
...
@@ -145,7 +145,7 @@ int StatisticsProvider::largestValue() const
}
int
max
=
0
;
// TODO std::max or something?
for
(
auto
it
=
m_values
.
constBegin
()
;
it
!=
m_values
.
constEnd
()
;
++
it
)
{
for
(
auto
it
=
m_values
.
constBegin
()
,
end
=
m_values
.
constEnd
();
it
!=
end
;
++
it
)
{
if
((
*
it
).
value
>
max
)
{
max
=
(
*
it
).
value
;
}
...
...
Modules/info/info.cpp
View file @
653900d2
...
...
@@ -48,8 +48,7 @@ KInfoListWidget::KInfoListWidget(const QString &_title, QWidget *parent, bool _g
//setButtons(KCModule::Help);
getlistbox
=
_getlistbox
;
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
//PORT QT5 layout->setSpacing(KDialog::spacingHint());
layout
->
setMargin
(
0
);
layout
->
setMargin
(
0
);
widgetStack
=
new
QStackedWidget
(
this
);
layout
->
addWidget
(
widgetStack
);
...
...
Modules/memory/chartWidget.cpp
View file @
653900d2
...
...
@@ -28,8 +28,8 @@ Chart::Chart(QWidget* parent) :
setSizePolicy
(
QSizePolicy
::
Minimum
,
QSizePolicy
::
MinimumExpanding
);
memoryInfos
=
NULL
;
freeMemoryLabel
=
NULL
;
memoryInfos
=
nullptr
;
mFreeMemoryLabel
=
nullptr
;
}
...
...
@@ -38,7 +38,7 @@ void Chart::setMemoryInfos(t_memsize* memoryInfos) {
}
void
Chart
::
setFreeMemoryLabel
(
QLabel
*
freeMemoryLabel
)
{
this
->
f
reeMemoryLabel
=
freeMemoryLabel
;
this
->
mF
reeMemoryLabel
=
freeMemoryLabel
;
}
...
...
@@ -54,7 +54,7 @@ bool Chart::drawChart(t_memsize total, const QList<t_memsize>& used, const QList
paint
.
setPen
(
pen
);
paint
.
drawRect
(
rect
());
setAccessibleDescription
(
i18n
(
"Not available."
));
f
reeMemoryLabel
->
setText
(
i18n
(
"Not available."
));
mF
reeMemoryLabel
->
setText
(
i18n
(
"Not available."
));
return
false
;
}
...
...
@@ -103,7 +103,7 @@ bool Chart::drawChart(t_memsize total, const QList<t_memsize>& used, const QList
QRect
r
=
rect
();
qDrawShadePanel
(
&
paint
,
r
.
x
(),
r
.
y
(),
r
.
width
(),
r
.
height
(),
palette
(),
true
,
1
);
f
reeMemoryLabel
->
setText
(
i18n
(
"%1 free"
,
formattedUnit
(
last_used
)));
mF
reeMemoryLabel
->
setText
(
i18n
(
"%1 free"
,
formattedUnit
(
last_used
)));
setAccessibleDescription
(
accessibleDescription
.
join
(
'\n'
));
return
true
;
...
...
@@ -129,13 +129,13 @@ ChartWidget::ChartWidget(const QString& title, const QString& hint, Chart* chart
chart
->
setToolTip
(
hint
);
mainLayout
->
addWidget
(
chart
);
f
reeMemoryLabel
=
new
QLabel
(
QLatin1String
(
""
),
this
);
f
reeMemoryLabel
->
setTextInteractionFlags
(
Qt
::
TextSelectableByMouse
);
f
reeMemoryLabel
->
setAlignment
(
Qt
::
AlignHCenter
);
f
reeMemoryLabel
->
setToolTip
(
hint
);
mainLayout
->
addWidget
(
f
reeMemoryLabel
);
mF
reeMemoryLabel
=
new
QLabel
(
QLatin1String
(
""
),
this
);
mF
reeMemoryLabel
->
setTextInteractionFlags
(
Qt
::
TextSelectableByMouse
);
mF
reeMemoryLabel
->
setAlignment
(
Qt
::
AlignHCenter
);
mF
reeMemoryLabel
->
setToolTip
(
hint
);
mainLayout
->
addWidget
(
mF
reeMemoryLabel
);
chart
->
setFreeMemoryLabel
(
f
reeMemoryLabel
);
chart
->
setFreeMemoryLabel
(
mF
reeMemoryLabel
);
}
void
ChartWidget
::
setMemoryInfos
(
t_memsize
*
memoryInfos
)
{
...
...
Modules/memory/chartWidget.h
View file @
653900d2
...
...
@@ -38,7 +38,7 @@ public:
explicit
Chart
(
QWidget
*
parent
=
nullptr
);
void
setMemoryInfos
(
t_memsize
*
memoryInfos
);
void
setFreeMemoryLabel
(
QLabel
*
freeMemoryLabel
);
void
setFreeMemoryLabel
(
QLabel
*
freeMemoryLabel
);
static
QString
formattedUnit
(
t_memsize
value
);
...
...
@@ -48,7 +48,7 @@ protected:
t_memsize
*
memoryInfos
=
nullptr
;
QLabel
*
f
reeMemoryLabel
=
nullptr
;
QLabel
*
mF
reeMemoryLabel
=
nullptr
;
};
...
...
@@ -69,7 +69,7 @@ private:
Chart
*
chart
=
nullptr
;
QLabel
*
f
reeMemoryLabel
=
nullptr
;
QLabel
*
mF
reeMemoryLabel
=
nullptr
;
};
...
...
Modules/nics/nic.cpp
View file @
653900d2
...
...
@@ -87,7 +87,6 @@ KCMNic::KCMNic(QWidget *parent, const QVariantList &) :
KCModule
(
parent
)
{
QVBoxLayout
*
box
=
new
QVBoxLayout
(
this
);
box
->
setMargin
(
0
);
//PORT QT5 box->setSpacing(KDialog::spacingHint());
m_list
=
new
QTreeWidget
(
this
);
m_list
->
setRootIsDecorated
(
false
);
box
->
addWidget
(
m_list
);
...
...
@@ -258,7 +257,7 @@ QList<MyNIC*> findNICs() {
getnameinfo
(
ifa
->
ifa_addr
,
ifa
->
ifa_addr
->
sa_len
,
buf
,
127
,
0
,
0
,
NI_NUMERICHOST
);
tmp
->
addr
=
buf
;
if
(
ifa
->
ifa_netmask
!=
NULL
)
{
if
(
ifa
->
ifa_netmask
!=
nullptr
)
{
bzero
(
buf
,
128
);
getnameinfo
(
ifa
->
ifa_netmask
,
ifa
->
ifa_netmask
->
sa_len
,
buf
,
127
,
0
,
0
,
NI_NUMERICHOST
);
tmp
->
netmask
=
buf
;
...
...
Modules/opengl/opengl.cpp
View file @
653900d2
...
...
@@ -102,9 +102,9 @@ void KCMOpenGL::treeWidgetChanged() {
QTreeWidgetItem
*
newItem
(
QTreeWidgetItem
*
parent
,
QTreeWidgetItem
*
preceding
,
const
QString
&
textCol1
,
const
QString
&
textCol2
=
QString
())
{
QTreeWidgetItem
*
newItem
;
if
((
parent
==
NULL
)
&&
(
preceding
==
NULL
))
{
if
((
parent
==
nullptr
)
&&
(
preceding
==
nullptr
))
{
newItem
=
new
QTreeWidgetItem
();
}
else
if
(
preceding
==
NULL
)
{
}
else
if
(
preceding
==
nullptr
)
{
newItem
=
new
QTreeWidgetItem
(
parent
);
}
else
{
newItem
=
new
QTreeWidgetItem
(
parent
,
preceding
);
...
...
@@ -280,7 +280,7 @@ print_extension_list(const char *ext, QTreeWidgetItem *l1)
if
(
!
ext
||
!
ext
[
0
])
return
;
QString
qext
=
QString
::
fromLatin1
(
ext
);
QTreeWidgetItem
*
l2
=
NULL
;
QTreeWidgetItem
*
l2
=
nullptr
;
i
=
j
=
0
;
while
(
1
)
{
...
...
@@ -339,9 +339,9 @@ print_limits(QTreeWidgetItem *l1, const char * glExtensions, bool getProcAddress
const
char
*
ext
;
};
QTreeWidgetItem
*
l2
=
NULL
,
*
l3
=
NULL
;
QTreeWidgetItem
*
l2
=
nullptr
,
*
l3
=
nullptr
;
#if defined(PFNGLGETPROGRAMIVARBPROC)
PFNGLGETPROGRAMIVARBPROC
kcm_glGetProgramivARB
=
NULL
;
PFNGLGETPROGRAMIVARBPROC
kcm_glGetProgramivARB
=
nullptr
;
#endif
#define KCMGL_FLOAT 128
...
...
@@ -516,7 +516,7 @@ print_limits(QTreeWidgetItem *l1, const char * glExtensions, bool getProcAddress
if
(
l2
)
l2
=
newItem
(
l1
,
l2
,
groups
[
i
].
descr
);
else
l2
=
newItem
(
l1
,
groups
[
i
].
descr
);
l3
=
NULL
;
l3
=
nullptr
;
const
struct
token_name
*
cur_token
;
for
(
cur_token
=
groups
[
i
].
group
;
cur_token
->
type
;
cur_token
++
)
{
...
...
@@ -553,7 +553,7 @@ print_limits(QTreeWidgetItem *l1, const char * glExtensions, bool getProcAddress
static
QTreeWidgetItem
*
print_screen_info
(
QTreeWidgetItem
*
l1
,
QTreeWidgetItem
*
after
,
const
QString
&
title
)
{
QTreeWidgetItem
*
l2
=
NULL
,
*
l3
=
NULL
;
QTreeWidgetItem
*
l2
=
nullptr
,
*
l3
=
nullptr
;
if
(
after
)
{
l1
=
newItem
(
l1
,
after
,
title
);
...
...
@@ -605,7 +605,7 @@ static QTreeWidgetItem *print_screen_info(QTreeWidgetItem *l1, QTreeWidgetItem *
#if KCM_HAVE_GLX
if
(
QGuiApplication
::
platformName
()
==
QStringLiteral
(
"xcb"
))
{
l3
=
newItem
(
l2
,
l3
,
i18n
(
"Implementation specific"
));
print_limits
(
l3
,
gli
.
glExtensions
,
strstr
(
gli
.
clientExtensions
,
"GLX_ARB_get_proc_address"
)
!=
NULL
);
print_limits
(
l3
,
gli
.
glExtensions
,
strstr
(
gli
.
clientExtensions
,
"GLX_ARB_get_proc_address"
)
!=
nullptr
);
}
#endif
...
...
@@ -716,7 +716,7 @@ static QTreeWidgetItem *get_gl_info_glx(Display *dpy, int scrnum, Bool allowDire
gli
.
glRenderer
=
(
const
char
*
)
glGetString
(
GL_RENDERER
);
gli
.
glVersion
=
(
const
char
*
)
glGetString
(
GL_VERSION
);
gli
.
glExtensions
=
(
const
char
*
)
glGetString
(
GL_EXTENSIONS
);
gli
.
displayName
=
NULL
;
gli
.
displayName
=
nullptr
;
gli
.
gluVersion
=
(
const
char
*
)
gluGetString
(
GLU_VERSION
);
gli
.
gluExtensions
=
(
const
char
*
)
gluGetString
(
GLU_EXTENSIONS
);
...
...
@@ -835,7 +835,7 @@ static QTreeWidgetItem *get_gl_info_egl(Display *dpy, int scrnum, QTreeWidgetIte
gli
.
glRenderer
=
(
const
char
*
)
glGetString
(
GL_RENDERER
);
gli
.
glVersion
=
(
const
char
*
)
glGetString
(
GL_VERSION
);
gli
.
glExtensions
=
(
const
char
*
)
glGetString
(
GL_EXTENSIONS
);
gli
.
displayName
=
NULL
;
gli
.
displayName
=
nullptr
;
result
=
print_screen_info
(
l1
,
after
,
i18n
(
"Direct Rendering (EGL)"
));
}
else
{
...
...
@@ -879,7 +879,7 @@ static QTreeWidgetItem *get_gl_info_egl_qt(QTreeWidgetItem *l1, QTreeWidgetItem
gli
.
glRenderer
=
(
const
char
*
)
glGetString
(
GL_RENDERER
);
gli
.
glVersion
=
(
const
char
*
)
glGetString
(
GL_VERSION
);
gli
.
glExtensions
=
(
const
char
*
)
glGetString
(
GL_EXTENSIONS
);
gli
.
displayName
=
NULL
;
gli
.
displayName
=
nullptr
;
result
=
print_screen_info
(
l1
,
after
,
title
);
}
else
{
...
...
@@ -894,7 +894,7 @@ static QTreeWidgetItem *get_gl_info_egl_qt(QTreeWidgetItem *l1, QTreeWidgetItem
bool
GetInfo_OpenGL
(
QTreeWidget
*
treeWidget
)
{
QTreeWidgetItem
*
l1
,
*
l2
=
NULL
;
QTreeWidgetItem
*
l1
,
*
l2
=
nullptr
;
static
bool
isX11
=
QGuiApplication
::
platformName
()
==
QStringLiteral
(
"xcb"
);
static
bool
isWayland
=
QGuiApplication
::
platformName
().
contains
(
QStringLiteral
(
"wayland"
));
...
...
@@ -909,7 +909,7 @@ bool GetInfo_OpenGL(QTreeWidget *treeWidget)
l1
=
new
QTreeWidgetItem
(
treeWidget
);
if
(
isX11
)
{
char
*
displayName
=
NULL
;
char
*
displayName
=
nullptr
;
Display
*
dpy
;
int
numScreens
,
scrnum
;
...
...
Modules/samba/ksmbstatus.cpp
View file @
653900d2
...
...
@@ -33,7 +33,7 @@
#define After(ttf,in) (in.contains(ttf)?QString(in.mid(in.indexOf(ttf)+QString(ttf).length())):QString(""))
NetMon
::
NetMon
(
QWidget
*
parent
,
KConfig
*
config
)
:
QWidget
(
parent
),
configFile
(
config
),
showmountProc
(
0
),
strShare
(
""
),
strUser
(
""
),
strGroup
(
""
),
strMachine
(
""
),
strSince
(
""
),
strPid
(
""
),
iUser
(
0
),
iGroup
(
0
),
iMachine
(
0
),
iPid
(
0
)
{
QWidget
(
parent
),
configFile
(
config
),
showmountProc
(
nullptr
),
strShare
(
""
),
strUser
(
""
),
strGroup
(
""
),
strMachine
(
""
),
strSince
(
""
),
strPid
(
""
),
iUser
(
0
),
iGroup
(
0
),
iMachine
(
0
),
iPid
(
0
)
{
QBoxLayout
*
topLayout
=
new
QVBoxLayout
(
this
);
list
=
new
QTreeWidget
(
this
);
...
...
Modules/samba/main.cpp
View file @
653900d2
...
...
@@ -31,7 +31,7 @@
class
SambaContainer
:
public
KCModule
{
Q_OBJECT
public:
SambaContainer
(
QWidget
*
parent
=
0
,
const
QVariantList
&
list
=
QVariantList
());
SambaContainer
(
QWidget
*
parent
=
nullptr
,
const
QVariantList
&
list
=
QVariantList
());
virtual
~
SambaContainer
();
void
load
()
Q_DECL_OVERRIDE
;
void
save
()
Q_DECL_OVERRIDE
;
...
...
Modules/usbview/kcmusb.cpp
View file @
653900d2
...
...
@@ -96,7 +96,7 @@ static void delete_recursive(QTreeWidgetItem *item, const QMap<int, QTreeWidgetI
return
;
QTreeWidgetItemIterator
it
(
item
,
QTreeWidgetItemIterator
::
All
);
while
(
*
it
!=
NULL
)
{
while
(
*
it
!=
nullptr
)
{
QTreeWidgetItem
*
currentItem
=
*
it
;
if
(
new_items
.
contains
(
currentItem
->
text
(
1
).
toUInt
())
==
false
)
{
delete_recursive
(
currentItem
->
child
(
0
),
new_items
);
...
...
Modules/usbview/usbdevices.cpp
View file @
653900d2
...
...
@@ -136,7 +136,7 @@ USBDevice* USBDevice::find(int bus, int device) {
return
usbDevice
;
}
return
NULL
;
return
nullptr
;
}
QString
USBDevice
::
product
()
{
...
...
@@ -276,7 +276,7 @@ bool USBDevice::parseSys(const QString &dname) {
d
.
setNameFilters
(
QStringList
()
<<
QStringLiteral
(
"usb*"
));
const
QStringList
list
=
d
.
entryList
();
for
(
QStringList
::
const_iterator
it
=
list
.
constBegin
();
it
!=
list
.
constEnd
()
;
++
it
)
{
for
(
QStringList
::
const_iterator
it
=
list
.
constBegin
(),
total
=
list
.
constEnd
();
it
!=
total
;
++
it
)
{
USBDevice
*
device
=
new
USBDevice
();
int
bus
=
0
;
...
...
infocenter.cpp
View file @
653900d2
...
...
@@ -56,7 +56,6 @@ KInfoCenter::KInfoCenter() : KXmlGuiWindow( 0, Qt::WindowContextHelpButtonHint )
setCentralWidget
(
m_cWidget
);
QVBoxLayout
*
cLayout
=
new
QVBoxLayout
(
m_cWidget
);
Q_UNUSED
(
cLayout
);
cLayout
->
setSpacing
(
0
);
cLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
...
...
infokcmmodel.cpp
View file @
653900d2
...
...
@@ -45,24 +45,24 @@ void InfoKcmModel::createTreeItems()
{
const
KService
::
List
categoryList
=
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"KInfoCenterCategory"
));
for
each
(
const
KService
::
Ptr
&
categoryModule
,
categoryList
)
{
for
(
const
KService
::
Ptr
&
categoryModule
:
categoryList
)
{
m_root
->
addChild
(
new
KcmCategoryItem
(
categoryModule
,
m_root
));
}
KService
::
List
moduleList
=
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"KCModule"
),
QStringLiteral
(
"[X-KDE-ParentApp] == 'kinfocenter'"
));
const
KService
::
List
moduleList
=
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"KCModule"
),
QStringLiteral
(
"[X-KDE-ParentApp] == 'kinfocenter'"
));
for
each
(
const
KService
::
Ptr
&
kcmModule
,
moduleList
)
{
for
(
const
KService
::
Ptr
&
kcmModule
:
moduleList
)
{
if
(
kcmModule
->
isType
(
KST_KService
)
==
true
)
{
QString
category
=
kcmModule
->
property
(
QStringLiteral
(
"X-KDE-KInfoCenter-Category"
)).
toString
().
trimmed
();
if
(
!
category
.
isEmpty
()
||
!
category
.
isNull
())
{
KcmTreeItem
*
item
=
m_root
->
containsCategory
(
category
);
if
(
item
!=
NULL
)
{
if
(
item
!=
nullptr
)
{
item
->
addChild
(
new
KcmTreeItem
(
kcmModule
,
item
));
}
else
{
KcmTreeItem
*
lost
=
m_root
->
containsCategory
(
QStringLiteral
(
"lost_and_found"
));
if
(
lost
!=
NULL
)
{
if
(
lost
!=
nullptr
)
{
lost
->
addChild
(
new
KcmTreeItem
(
kcmModule
,
lost
));
}
else
{
qWarning
()
<<
"Lost and found category not found, unable to display lost Kcontrol modules"
;
...
...
kcmtreeitem.cpp
View file @
653900d2
...
...
@@ -48,7 +48,7 @@ KcmTreeItem *KcmTreeItem::child(const int row)
if
(
childCount
()
>
row
)
{
return
m_children
.
value
(
row
);
}
return
NULL
;
return
nullptr
;
}
int
KcmTreeItem
::
childCount
()
...
...
@@ -112,7 +112,7 @@ KcmTreeItem *KcmTreeItem::containsCategory(const QString& category)
}
}
}
return
NULL
;
return
nullptr
;
}
KCModuleInfo
KcmTreeItem
::
kcm
()
const
...
...
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