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
P
Plasma Mobile Settings
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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 Mobile
Plasma Mobile Settings
Commits
99779f88
Verified
Commit
99779f88
authored
Sep 25, 2020
by
Jonah Brüchert
🌳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
info: Move copy to clipboard function to c++
parent
70fa38fb
Pipeline
#35556
passed with stage
in 21 minutes and 17 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
71 deletions
+52
-71
modules/info/distroinfo.h
modules/info/distroinfo.h
+19
-35
modules/info/hardwareinfo.h
modules/info/hardwareinfo.h
+4
-5
modules/info/info.cpp
modules/info/info.cpp
+20
-2
modules/info/info.h
modules/info/info.h
+1
-1
modules/info/package/contents/ui/main.qml
modules/info/package/contents/ui/main.qml
+2
-19
modules/info/softwareinfo.cpp
modules/info/softwareinfo.cpp
+1
-0
modules/info/softwareinfo.h
modules/info/softwareinfo.h
+5
-9
No files found.
modules/info/distroinfo.h
View file @
99779f88
...
...
@@ -32,62 +32,46 @@ class DistroInfo : public QObject
Q_OBJECT
Q_PROPERTY
(
QString
name
READ
name
CONSTANT
)
PROPERTY
(
QString
,
name
)
Q_PROPERTY
(
QString
version
READ
version
CONSTANT
)
PROPERTY
(
QString
,
version
)
Q_PROPERTY
(
QString
id
READ
id
CONSTANT
)
PROPERTY
(
QString
,
id
)
Q_PROPERTY
(
QStringList
idLike
READ
idLike
CONSTANT
)
PROPERTY
(
QStringList
,
idLike
)
Q_PROPERTY
(
QString
versionCodename
READ
versionCodename
CONSTANT
)
PROPERTY
(
QString
,
versionCodename
)
Q_PROPERTY
(
QString
versionId
READ
versionId
CONSTANT
)
PROPERTY
(
QString
,
versionId
)
Q_PROPERTY
(
QString
prettyName
READ
prettyName
CONSTANT
)
PROPERTY
(
QString
,
prettyName
)
Q_PROPERTY
(
QString
ansiColor
READ
ansiColor
CONSTANT
)
PROPERTY
(
QString
,
ansiColor
)
Q_PROPERTY
(
QString
cpeName
READ
cpeName
CONSTANT
)
PROPERTY
(
QString
,
cpeName
)
Q_PROPERTY
(
QString
homeUrl
READ
homeUrl
CONSTANT
)
PROPERTY
(
QString
,
homeUrl
)
Q_PROPERTY
(
QString
documentationUrl
READ
documentationUrl
CONSTANT
)
PROPERTY
(
QString
,
documentationUrl
)
Q_PROPERTY
(
QString
supportUrl
READ
supportUrl
CONSTANT
)
PROPERTY
(
QString
,
supportUrl
)
Q_PROPERTY
(
QString
bugReportUrl
READ
bugReportUrl
CONSTANT
)
PROPERTY
(
QString
,
bugReportUrl
)
Q_PROPERTY
(
QString
privacyPolicyUrl
READ
privacyPolicyUrl
CONSTANT
)
PROPERTY
(
QString
,
privacyPolicyUrl
)
Q_PROPERTY
(
QString
buildId
READ
buildId
CONSTANT
)
PROPERTY
(
QString
,
buildId
)
Q_PROPERTY
(
QString
variant
READ
variant
CONSTANT
)
PROPERTY
(
QString
,
variant
)
Q_PROPERTY
(
QString
variantId
READ
variantId
CONSTANT
)
PROPERTY
(
QString
,
variantId
)
Q_PROPERTY
(
QString
logo
READ
logo
CONSTANT
)
PROPERTY
(
QString
,
logo
)
public:
DistroInfo
(
QObject
*
parent
=
nullptr
);
PROPERTY
(
QString
,
name
)
PROPERTY
(
QString
,
version
)
PROPERTY
(
QString
,
id
)
PROPERTY
(
QStringList
,
idLike
)
PROPERTY
(
QString
,
versionCodename
)
PROPERTY
(
QString
,
versionId
)
PROPERTY
(
QString
,
prettyName
)
PROPERTY
(
QString
,
ansiColor
)
PROPERTY
(
QString
,
cpeName
)
PROPERTY
(
QString
,
homeUrl
)
PROPERTY
(
QString
,
documentationUrl
)
PROPERTY
(
QString
,
supportUrl
)
PROPERTY
(
QString
,
bugReportUrl
)
PROPERTY
(
QString
,
privacyPolicyUrl
)
PROPERTY
(
QString
,
buildId
)
PROPERTY
(
QString
,
variant
)
PROPERTY
(
QString
,
variantId
)
PROPERTY
(
QString
,
logo
)
private:
KOSRelease
m_osrelease
;
...
...
modules/info/hardwareinfo.h
View file @
99779f88
...
...
@@ -28,16 +28,15 @@ class HardwareInfo : public QObject
Q_OBJECT
Q_PROPERTY
(
QString
processors
READ
processors
CONSTANT
)
QString
processors
()
const
;
Q_PROPERTY
(
QString
processorCount
READ
processorCount
CONSTANT
)
int
processorCount
()
const
;
Q_PROPERTY
(
QString
memory
READ
memory
CONSTANT
)
QString
memory
()
const
;
public:
HardwareInfo
(
QObject
*
parent
=
nullptr
);
QString
processors
()
const
;
int
processorCount
()
const
;
QString
memory
()
const
;
};
#endif // HARDWAREINFO_H
modules/info/info.cpp
View file @
99779f88
...
...
@@ -45,9 +45,27 @@ Info::Info(QObject *parent, const QVariantList &args)
}
void
Info
::
copy
ToClipboard
(
const
QString
&
text
)
const
void
Info
::
copy
InfoToClipboard
(
)
const
{
QGuiApplication
::
clipboard
()
->
setText
(
text
);
const
QString
clipboardText
=
QStringLiteral
(
"Operating System: %1
\n
"
"KDE Plasma Version: %2
\n
"
"KDE Frameworks Version: %3
\n
"
"Qt Version: %4
\n
"
"Kernel Version: %5
\n
"
"OS-Type: %6
\n
"
"Processor: %7
\n
"
"Memory: %8
\n
"
).
arg
(
distroInfo
()
->
name
(),
softwareInfo
()
->
plasmaVersion
(),
softwareInfo
()
->
frameworksVersion
(),
softwareInfo
()
->
qtVersion
(),
softwareInfo
()
->
kernelRelease
(),
softwareInfo
()
->
osType
(),
hardwareInfo
()
->
processors
(),
hardwareInfo
()
->
memory
()
);
QGuiApplication
::
clipboard
()
->
setText
(
clipboardText
);
}
DistroInfo
*
Info
::
distroInfo
()
const
...
...
modules/info/info.h
View file @
99779f88
...
...
@@ -40,7 +40,7 @@ class Info : public KQuickAddons::ConfigModule {
public:
Info
(
QObject
*
parent
,
const
QVariantList
&
args
);
Q_INVOKABLE
void
copy
ToClipboard
(
const
QString
&
text
)
const
;
Q_INVOKABLE
void
copy
InfoToClipboard
(
)
const
;
Q_SIGNALS:
void
distroInfoChanged
();
...
...
modules/info/package/contents/ui/main.qml
View file @
99779f88
...
...
@@ -14,27 +14,10 @@ KCM.SimpleKCM {
Kirigami.Action
{
text
:
i18n
(
"
Copy to clipboard
"
)
icon.name
:
"
edit-copy
"
onTriggered
:
copyInfoToClipboard
()
onTriggered
:
kcm
.
copyInfoToClipboard
()
}
]
function
copyInfoToClipboard
()
{
var
clipboardText
=
""
clipboardText
+=
"
Operating System
"
+
kcm
.
distroInfo
.
name
+
"
\n
"
clipboardText
+=
"
KDE Plasma Version:
"
+
kcm
.
softwareInfo
.
plasmaVersion
+
"
\n
"
clipboardText
+=
"
KDE Frameworks Version:
"
+
kcm
.
softwareInfo
.
frameworksVersion
+
"
\n
"
clipboardText
+=
"
Qt Version:
"
+
kcm
.
softwareInfo
.
qtVersion
+
"
\n
"
clipboardText
+=
"
Kernel Version:
"
+
kcm
.
softwareInfo
.
kernelRelease
+
"
\n
"
clipboardText
+=
"
OS-Type:
"
+
kcm
.
softwareInfo
.
osType
+
"
-bit
\n
"
clipboardText
+=
"
Processor:
"
+
kcm
.
hardwareInfo
.
processors
+
"
\n
"
clipboardText
+=
"
Memory:
"
+
kcm
.
hardwareInfo
.
memory
+
"
\n
"
kcm
.
copyToClipboard
(
clipboardText
)
}
ColumnLayout
{
width
:
parent
.
width
spacing
:
Kirigami
.
Units
.
largeSpacing
...
...
@@ -121,6 +104,6 @@ KCM.SimpleKCM {
text
:
i18n
(
"
Copy to clipboard
"
)
icon.name
:
"
edit-copy
"
onClicked
:
copyInfoToClipboard
()
onClicked
:
kcm
.
copyInfoToClipboard
()
}
}
modules/info/softwareinfo.cpp
View file @
99779f88
...
...
@@ -38,6 +38,7 @@ QString SoftwareInfo::kernelRelease() const
{
struct
utsname
utsName
{};
uname
(
&
utsName
);
return
QString
::
fromLatin1
(
utsName
.
release
);
}
...
...
modules/info/softwareinfo.h
View file @
99779f88
...
...
@@ -28,22 +28,18 @@ class SoftwareInfo : public QObject
Q_OBJECT
Q_PROPERTY
(
QString
kernelRelease
READ
kernelRelease
CONSTANT
)
QString
kernelRelease
()
const
;
Q_PROPERTY
(
QString
frameworksVersion
READ
frameworksVersion
CONSTANT
)
QString
frameworksVersion
()
const
;
Q_PROPERTY
(
QString
qtVersion
READ
qtVersion
CONSTANT
)
QString
qtVersion
()
const
;
Q_PROPERTY
(
QString
plasmaVersion
READ
plasmaVersion
CONSTANT
)
QString
plasmaVersion
()
const
;
Q_PROPERTY
(
QString
osType
READ
osType
CONSTANT
)
QString
osType
()
const
;
public:
SoftwareInfo
(
QObject
*
parent
=
nullptr
);
QString
kernelRelease
()
const
;
QString
frameworksVersion
()
const
;
QString
qtVersion
()
const
;
QString
plasmaVersion
()
const
;
QString
osType
()
const
;
};
#endif // SOFTWAREINFO_H
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