Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kleopatra
Commits
6ca23e05
Commit
6ca23e05
authored
May 18, 2021
by
Ingo Klöcker
Browse files
Modernize code
GnuPG-bug-id: 4876
parent
85f4b7bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/view/smartcardwidget.cpp
View file @
6ca23e05
...
...
@@ -44,7 +44,7 @@ class PlaceHolderWidget: public QWidget
Q_OBJECT
public:
explicit
PlaceHolderWidget
(
QWidget
*
parent
=
nullptr
)
:
QWidget
(
parent
)
:
QWidget
{
parent
}
{
auto
lay
=
new
QVBoxLayout
;
lay
->
addStretch
(
-
1
);
...
...
@@ -88,14 +88,14 @@ private:
private:
SmartCardWidget
*
const
q
;
QMap
<
std
::
pair
<
std
::
string
,
std
::
string
>
,
QPointer
<
QWidget
>
>
mCardWidgets
;
QMap
<
std
::
pair
<
std
::
string
,
std
::
string
>
,
QPointer
<
QWidget
>>
mCardWidgets
;
PlaceHolderWidget
*
mPlaceHolderWidget
;
QStackedWidget
*
mStack
;
QTabWidget
*
mTabWidget
;
};
SmartCardWidget
::
Private
::
Private
(
SmartCardWidget
*
qq
)
:
q
(
qq
)
:
q
{
qq
}
{
auto
vLay
=
new
QVBoxLayout
(
q
);
...
...
@@ -185,12 +185,14 @@ void SmartCardWidget::Private::cardRemoved(const std::string &serialNumber, cons
}
}
SmartCardWidget
::
SmartCardWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
),
d
(
new
Private
(
this
)
)
SmartCardWidget
::
SmartCardWidget
(
QWidget
*
parent
)
:
QWidget
{
parent
}
,
d
{
std
::
make_unique
<
Private
>
(
this
)
}
{
}
Kleo
::
SmartCardWidget
::~
SmartCardWidget
()
=
default
;
void
SmartCardWidget
::
reload
()
{
ReaderStatus
::
mutableInstance
()
->
updateStatus
();
...
...
src/view/smartcardwidget.h
View file @
6ca23e05
#pragma once
/* view/smartcardwidget.h
This file is part of Kleopatra, the KDE keymanager
...
...
@@ -7,25 +6,29 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
#include <memory>
namespace
Kleo
{
/* SmartCardWidget a generic widget to interact with smartcards */
class
SmartCardWidget
:
public
QWidget
{
Q_OBJECT
public:
explicit
SmartCardWidget
(
QWidget
*
parent
=
nullptr
);
~
SmartCardWidget
()
override
;
public
Q_SLOTS
:
void
reload
();
private:
class
Private
;
std
::
shared
_ptr
<
Private
>
d
;
std
::
unique
_ptr
<
Private
>
d
;
};
}
// namespace Kleo
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