Commit 6ca23e05 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Modernize code

GnuPG-bug-id: 4876
parent 85f4b7bf
......@@ -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();
......
#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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment