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
81934884
Commit
81934884
authored
Oct 21, 2017
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modernize code
parent
0c48f07b
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
35 additions
and
45 deletions
+35
-45
CMakeLists.txt
CMakeLists.txt
+3
-3
Modules/about-distro/src/Module.cpp
Modules/about-distro/src/Module.cpp
+0
-8
Modules/devinfo/devicelisting.cpp
Modules/devinfo/devicelisting.cpp
+1
-1
Modules/devinfo/infopanel.cpp
Modules/devinfo/infopanel.cpp
+4
-4
Modules/devinfo/infopanel.h
Modules/devinfo/infopanel.h
+4
-4
Modules/energy/statisticsprovider.cpp
Modules/energy/statisticsprovider.cpp
+1
-0
Modules/usbview/usbdevices.cpp
Modules/usbview/usbdevices.cpp
+1
-1
ToolTips/tooltipmanager.cpp
ToolTips/tooltipmanager.cpp
+4
-10
infocenter.cpp
infocenter.cpp
+2
-2
infokcmmodel.cpp
infokcmmodel.cpp
+4
-2
kcmcategoryitem.cpp
kcmcategoryitem.cpp
+1
-1
kcmcategoryitem.h
kcmcategoryitem.h
+1
-1
kcmcontainer.cpp
kcmcontainer.cpp
+4
-4
kcmtreeitem.cpp
kcmtreeitem.cpp
+1
-1
main.cpp
main.cpp
+2
-2
sidepanel.cpp
sidepanel.cpp
+2
-1
No files found.
CMakeLists.txt
View file @
81934884
...
...
@@ -2,9 +2,10 @@ project(kinfocenter)
set
(
PROJECT_VERSION
"5.11.90"
)
cmake_minimum_required
(
VERSION 2.8.12 FATAL_ERROR
)
set
(
QT_MIN_VERSION
"5.
4
.0"
)
set
(
QT_MIN_VERSION
"5.
7
.0"
)
find_package
(
ECM 1.2.0 REQUIRED NO_MODULE
)
set
(
KF5_MIN_VERSION
"5.30"
)
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED NO_MODULE
)
set
(
CMAKE_MODULE_PATH
${
ECM_MODULE_PATH
}
${
ECM_KDE_MODULE_DIR
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake
)
include
(
KDEInstallDirs
)
...
...
@@ -14,7 +15,6 @@ include(FeatureSummary)
find_package
(
Qt5
${
QT_MIN_VERSION
}
CONFIG REQUIRED COMPONENTS Core Gui Widgets
)
set
(
KF5_MIN_VERSION
"5.30"
)
find_package
(
KF5
${
KF5_MIN_VERSION
}
REQUIRED COMPONENTS
Completion
Config
...
...
Modules/about-distro/src/Module.cpp
View file @
81934884
...
...
@@ -24,11 +24,8 @@
#include <QIcon>
#include <QStandardPaths>
#include <kcoreaddons_version.h>
#include <KAboutData>
#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5,20,0)
#include <KCoreAddons>
#endif
#include <KConfig>
#include <KConfigGroup>
#include <KDesktopFile>
...
...
@@ -182,12 +179,7 @@ void Module::loadSoftware()
ui
->
qtLabel
->
setText
(
qVersion
());
#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5,20,0)
ui
->
frameworksLabel
->
setText
(
KCoreAddons
::
versionString
());
#else
ui
->
frameworksLabelKey
->
setVisible
(
false
);
ui
->
frameworksLabel
->
setVisible
(
false
);
#endif
}
void
Module
::
loadHardware
()
...
...
Modules/devinfo/devicelisting.cpp
View file @
81934884
...
...
@@ -186,7 +186,7 @@ void DeviceListing::deviceAddedSlot(const QString udi)
void
DeviceListing
::
deviceRemovedSlot
(
const
QString
udi
)
{
const
QTreeWidgetItem
*
item
=
getTreeWidgetItemFromUdi
(
this
,
udi
);
if
(
item
==
NULL
)
return
;
if
(
item
==
nullptr
)
return
;
delete
item
;
}
...
...
Modules/devinfo/infopanel.cpp
View file @
81934884
...
...
@@ -66,7 +66,7 @@ void InfoPanel::setDefaultText()
lay
->
addWidget
(
defaultText
,
0
,
Qt
::
AlignHCenter
);
}
void
InfoPanel
::
setTopWidgetLayout
(
const
bool
&
isInit
)
void
InfoPanel
::
setTopWidgetLayout
(
bool
isInit
)
{
if
(
!
isInit
)
delete
top
;
top
=
new
QWidget
(
this
);
...
...
@@ -76,7 +76,7 @@ void InfoPanel::setTopWidgetLayout(const bool &isInit)
top
->
setLayout
(
setAlignedLayout
(
top
));
}
QVBoxLayout
*
InfoPanel
::
setAlignedLayout
(
QWidget
*
parent
,
const
int
&
spacingHeight
)
QVBoxLayout
*
InfoPanel
::
setAlignedLayout
(
QWidget
*
parent
,
int
spacingHeight
)
{
QVBoxLayout
*
lay
=
new
QVBoxLayout
(
parent
);
lay
->
insertSpacing
(
0
,
spacingHeight
);
...
...
@@ -85,7 +85,7 @@ QVBoxLayout *InfoPanel::setAlignedLayout(QWidget *parent, const int &spacingHeig
return
lay
;
}
void
InfoPanel
::
setBottomWidgetLayout
(
QVListLayout
*
lay
,
const
bool
&
isInit
)
void
InfoPanel
::
setBottomWidgetLayout
(
QVListLayout
*
lay
,
bool
isInit
)
{
if
(
!
isInit
)
delete
bottom
;
...
...
@@ -136,7 +136,7 @@ QString InfoPanel::friendlyString(const QString &input, const QString &blankName
return
input
;
}
QString
InfoPanel
::
convertTf
(
const
bool
&
b
)
QString
InfoPanel
::
convertTf
(
bool
b
)
{
if
(
b
)
return
i18n
(
"Yes"
);
return
i18n
(
"No"
);
...
...
Modules/devinfo/infopanel.h
View file @
81934884
...
...
@@ -54,17 +54,17 @@ class InfoPanel : public QGroupBox
void
setTopInfo
(
const
QIcon
&
,
Solid
::
Device
*
);
void
setBottomInfo
(
QVListLayout
*
lay
);
static
QString
friendlyString
(
const
QString
&
,
const
QString
&
=
i18nc
(
"name of something is not known"
,
"Unknown"
));
static
QString
convertTf
(
const
bool
&
);
static
QString
convertTf
(
bool
);
private:
void
setTopWidgetLayout
(
const
bool
&
=
false
);
void
setBottomWidgetLayout
(
QVListLayout
*
,
const
bool
&
=
false
);
void
setTopWidgetLayout
(
bool
=
false
);
void
setBottomWidgetLayout
(
QVListLayout
*
,
bool
=
false
);
void
setInfoPanelLayout
();
void
removeItems
(
QWidget
*
);
void
setDefaultText
();
QLabel
*
setDevicesIcon
(
const
QIcon
&
);
QVBoxLayout
*
setAlignedLayout
(
QWidget
*
parent
,
const
int
&
=
0
);
QVBoxLayout
*
setAlignedLayout
(
QWidget
*
parent
,
int
=
0
);
QWidget
*
top
;
QWidget
*
bottom
;
...
...
Modules/energy/statisticsprovider.cpp
View file @
81934884
...
...
@@ -103,6 +103,7 @@ void StatisticsProvider::componentComplete()
QVariantList
StatisticsProvider
::
asPoints
()
const
{
QVariantList
points
;
points
.
reserve
(
m_values
.
count
());
foreach
(
const
HistoryReply
&
h
,
m_values
)
{
points
.
append
(
QPointF
(
h
.
time
,
h
.
value
));
}
...
...
Modules/usbview/usbdevices.cpp
View file @
81934884
...
...
@@ -48,7 +48,7 @@ USBDevice::~USBDevice() {
}
static
QString
catFile
(
QString
fname
)
{
static
QString
catFile
(
const
QString
&
fname
)
{
char
buffer
[
256
];
QString
result
;
int
fd
=::
open
(
QFile
::
encodeName
(
fname
),
O_RDONLY
);
...
...
ToolTips/tooltipmanager.cpp
View file @
81934884
...
...
@@ -37,18 +37,12 @@
class
ToolTipManager
::
Private
{
public:
Private
()
:
view
(
0
),
timer
(
0
),
delay
(
50
)
{
}
KToolTipWidget
*
tooltip
;
QAbstractItemView
*
view
;
QTimer
*
timer
;
KToolTipWidget
*
tooltip
=
nullptr
;
QAbstractItemView
*
view
=
nullptr
;
QTimer
*
timer
=
nullptr
;
QModelIndex
item
;
QRect
itemRect
;
int
delay
;
int
delay
=
50
;
};
ToolTipManager
::
ToolTipManager
(
QAbstractItemView
*
parent
)
...
...
infocenter.cpp
View file @
81934884
...
...
@@ -103,7 +103,7 @@ KInfoCenter::~KInfoCenter()
disconnect
(
m_searchAction
,
SIGNAL
(
triggered
()),
m_searchText
,
SLOT
(
setFocus
()));
//Buttons
disconnect
(
m_moduleHelpAction
,
&
QAction
::
triggered
,
this
,
&
KInfoCenter
::
helpClickedSlot
);
disconnect
(
m_moduleHelpAction
,
&
QAction
::
triggered
,
this
,
&
KInfoCenter
::
helpClickedSlot
);
//Menu
disconnect
(
m_aboutKcm
,
&
QAction
::
triggered
,
this
,
&
KInfoCenter
::
aboutKcmSlot
);
...
...
@@ -229,7 +229,7 @@ void KInfoCenter::helpClickedSlot()
// Nicked from Ben, could not use KToolInvocation due to docpath.
QString
docPath
=
m_contain
->
helpPath
();
QUrl
url
(
"help:/"
+
docPath
);
QUrl
url
(
QStringLiteral
(
"help:/"
)
+
docPath
);
QProcess
::
startDetached
(
QStringLiteral
(
"khelpcenter"
),
QStringList
()
<<
url
.
url
());
}
...
...
infokcmmodel.cpp
View file @
81934884
...
...
@@ -29,7 +29,9 @@
#include <QDebug>
#include <KLocalizedString>
InfoKcmModel
::
InfoKcmModel
(
QObject
*
parent
)
:
QAbstractItemModel
(
parent
),
m_root
(
new
KcmCategoryItem
(
i18n
(
"Information Modules"
)))
InfoKcmModel
::
InfoKcmModel
(
QObject
*
parent
)
:
QAbstractItemModel
(
parent
),
m_root
(
new
KcmCategoryItem
(
i18n
(
"Information Modules"
)))
{
createTreeItems
();
}
...
...
@@ -41,7 +43,7 @@ InfoKcmModel::~InfoKcmModel()
void
InfoKcmModel
::
createTreeItems
()
{
KService
::
List
categoryList
=
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"KInfoCenterCategory"
));
const
KService
::
List
categoryList
=
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"KInfoCenterCategory"
));
foreach
(
const
KService
::
Ptr
&
categoryModule
,
categoryList
)
{
m_root
->
addChild
(
new
KcmCategoryItem
(
categoryModule
,
m_root
));
...
...
kcmcategoryitem.cpp
View file @
81934884
...
...
@@ -22,7 +22,7 @@
#include "kcmcategoryitem.h"
KcmCategoryItem
::
KcmCategoryItem
(
const
KService
::
Ptr
module
,
KcmTreeItem
*
parent
)
:
KcmCategoryItem
::
KcmCategoryItem
(
const
KService
::
Ptr
&
module
,
KcmTreeItem
*
parent
)
:
KcmTreeItem
(
module
,
parent
)
{
}
...
...
kcmcategoryitem.h
View file @
81934884
...
...
@@ -39,7 +39,7 @@ class KcmCategoryItem : public KcmTreeItem
* @param module pointer to KCM module
* @param parent objects parent
*/
explicit
KcmCategoryItem
(
const
KService
::
Ptr
module
,
KcmTreeItem
*
parent
=
0
);
explicit
KcmCategoryItem
(
const
KService
::
Ptr
&
module
,
KcmTreeItem
*
parent
=
nullptr
);
/**
* Category Tree Item for InfoKcmModel. Holds information about a Category
...
...
kcmcontainer.cpp
View file @
81934884
...
...
@@ -29,8 +29,8 @@
#include <QVBoxLayout>
#include <QStyle>
KcmContainer
::
KcmContainer
(
QWidget
*
parent
)
:
QScrollArea
(
parent
),
m_titleLabel
(
NULL
),
m_centerWidget
(
NULL
),
m_mod
(
NULL
),
m_kcmTopEdge
(
-
1
)
KcmContainer
::
KcmContainer
(
QWidget
*
parent
)
:
QScrollArea
(
parent
),
m_titleLabel
(
nullptr
),
m_centerWidget
(
nullptr
),
m_mod
(
nullptr
),
m_kcmTopEdge
(
-
1
)
{
setWidgetResizable
(
true
);
setFrameStyle
(
QFrame
::
NoFrame
);
...
...
@@ -51,7 +51,7 @@ void KcmContainer::setContainerLayout()
return
;
}
m_mod
=
NULL
;
// will be deleted on the line below
m_mod
=
nullptr
;
// will be deleted on the line below
delete
m_centerWidget
;
m_centerWidget
=
new
QWidget
(
this
);
m_centerWidget
->
setContentsMargins
(
0
,
0
,
0
,
0
);
...
...
@@ -107,7 +107,7 @@ void KcmContainer::setKcmTitle(const KCModuleInfo &info)
QString
KcmContainer
::
helpPath
()
const
{
if
(
m_mod
==
NULL
)
{
if
(
m_mod
==
nullptr
)
{
return
QString
();
}
return
m_modInfo
.
docPath
();
...
...
kcmtreeitem.cpp
View file @
81934884
...
...
@@ -28,7 +28,7 @@ KcmTreeItem::KcmTreeItem(const KService::Ptr module, KcmTreeItem *parent) : m_pa
{
}
KcmTreeItem
::
KcmTreeItem
()
:
m_parent
(
NULL
),
m_moduleInfo
(
new
KCModuleInfo
())
KcmTreeItem
::
KcmTreeItem
()
:
m_parent
(
nullptr
),
m_moduleInfo
(
new
KCModuleInfo
())
{
}
...
...
main.cpp
View file @
81934884
...
...
@@ -41,7 +41,7 @@ KicApp::KicApp(int &argc, char **argv)
const
auto
displayName
=
i18n
(
"Info Center"
);
KAboutData
aboutData
(
QStringLiteral
(
"kinfocenter"
),
displayName
,
PROJECT_VERSION
,
displayName
,
KAboutLicense
::
GPL
,
i18n
(
"Copyright 2009-201
6
KDE"
));
i18n
(
"Copyright 2009-201
7
KDE"
));
aboutData
.
addAuthor
(
i18n
(
"David Hubner"
),
i18n
(
"Current Maintainer"
),
QStringLiteral
(
"hubnerd@ntlworld.com"
));
aboutData
.
addAuthor
(
i18n
(
"Helge Deller"
),
i18n
(
"Previous Maintainer"
),
QStringLiteral
(
"deller@kde.org"
));
...
...
@@ -63,7 +63,7 @@ KicApp::KicApp(int &argc, char **argv)
display
=
new
KInfoCenter
();
display
->
show
();
KDBusService
*
service
=
new
KDBusService
(
KDBusService
::
Unique
,
this
);
(
void
)
new
KDBusService
(
KDBusService
::
Unique
,
this
);
}
int
main
(
int
argc
,
char
*
argv
[])
...
...
sidepanel.cpp
View file @
81934884
...
...
@@ -31,7 +31,8 @@
#include <QRegExp>
#include <QMenu>
SidePanel
::
SidePanel
(
QWidget
*
parent
)
:
QTreeView
(
parent
)
SidePanel
::
SidePanel
(
QWidget
*
parent
)
:
QTreeView
(
parent
)
{
setHeaderHidden
(
true
);
setSortingEnabled
(
true
);
...
...
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