Commit 6bfec59d authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use nullptr

parent 111ac65a
......@@ -68,7 +68,7 @@ KCMNetworkmanagement::KCMNetworkmanagement(QWidget *parent, const QVariantList &
QWidget *mainWidget = new QWidget(this);
m_ui->setupUi(mainWidget);
m_quickView = new QQuickView(0);
m_quickView = new QQuickView(nullptr);
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(m_quickView->engine());
kdeclarative.setTranslationDomain(QStringLiteral(TRANSLATION_DOMAIN));
......
......@@ -79,7 +79,7 @@ void BluetoothMonitor::addBluetoothConnection(const QString &bdAddr, const QStri
}
if (service != QLatin1String("dun") && service != QLatin1String("nap")) {
KMessageBox::sorry(0, i18n("Only 'dun' and 'nap' services are supported."));
KMessageBox::sorry(nullptr, i18n("Only 'dun' and 'nap' services are supported."));
return;
}
......
......@@ -165,7 +165,7 @@ void ModemMonitor::requestPin(MMModemLock lock)
return;
}
QDBusPendingCallWatcher *watcher = 0;
QDBusPendingCallWatcher *watcher = nullptr;
PinDialog::Type type = d->dialog.data()->type();
......@@ -201,7 +201,7 @@ void ModemMonitor::onSendPinArrived(QDBusPendingCallWatcher * watcher)
// Automatically enabling this for cell phones with expensive data plans is not a good idea.
//NetworkManager::setWwanEnabled(true);
} else {
KMessageBox::error(0, i18nc("Text in GSM PIN/PUK unlock error dialog", "Error unlocking modem: %1", reply.error().message()),
KMessageBox::error(nullptr, i18nc("Text in GSM PIN/PUK unlock error dialog", "Error unlocking modem: %1", reply.error().message()),
i18nc("Title for GSM PIN/PUK unlock error dialog", "PIN/PUK unlock error"));
}
......
......@@ -36,7 +36,7 @@ class Notification : public QObject
{
Q_OBJECT
public:
explicit Notification(QObject *parent = 0);
explicit Notification(QObject *parent = nullptr);
private Q_SLOTS:
void deviceAdded(const QString &uni);
......
......@@ -41,13 +41,13 @@ using namespace NetworkManager;
PasswordDialog::PasswordDialog(const NetworkManager::ConnectionSettings::Ptr &connectionSettings, SecretAgent::GetSecretsFlags flags,
const QString &setting_name, QWidget *parent) :
QDialog(parent),
m_ui(0),
m_ui(nullptr),
m_hasError(false),
m_settingName(setting_name),
m_connectionSettings(connectionSettings),
m_error(SecretAgent::NoSecrets),
m_flags(flags),
m_vpnWidget(0)
m_vpnWidget(nullptr)
{
setWindowIcon(QIcon::fromTheme(QStringLiteral("dialog-password")));
......
......@@ -40,7 +40,7 @@ public:
explicit PasswordDialog(const NetworkManager::ConnectionSettings::Ptr &connectionSettings,
NetworkManager::SecretAgent::GetSecretsFlags flags,
const QString &setting_name,
QWidget *parent = 0);
QWidget *parent = nullptr);
~PasswordDialog() override;
bool hasError() const;
......
......@@ -56,7 +56,7 @@ public:
};
enum ErrorCode {PinCodeTooShort, PinCodesDoNotMatch, PukCodeTooShort};
explicit PinDialog(ModemManager::Modem *modem, const Type type = SimPin, QWidget *parent=0);
explicit PinDialog(ModemManager::Modem *modem, const Type type = SimPin, QWidget *parent = nullptr);
~PinDialog() override;
Type type() const;
......
......@@ -46,8 +46,8 @@
SecretAgent::SecretAgent(QObject* parent)
: NetworkManager::SecretAgent("org.kde.plasma.networkmanagement", parent)
, m_openWalletFailed(false)
, m_wallet(0)
, m_dialog(0)
, m_wallet(nullptr)
, m_dialog(nullptr)
{
connect(NetworkManager::notifier(), &NetworkManager::Notifier::serviceDisappeared, this, &SecretAgent::killDialogs);
......@@ -142,7 +142,7 @@ void SecretAgent::CancelGetSecrets(const QDBusObjectPath &connection_path, const
SecretsRequest request = m_calls.at(i);
if (request.type == SecretsRequest::GetSecrets && callId == request.callId) {
if (m_dialog == request.dialog) {
m_dialog = 0;
m_dialog = nullptr;
}
delete request.dialog;
sendError(SecretAgent::AgentCanceled,
......@@ -256,7 +256,7 @@ void SecretAgent::dialogAccepted()
}
m_dialog->deleteLater();
m_dialog = 0;
m_dialog = nullptr;
processNext();
}
......@@ -275,7 +275,7 @@ void SecretAgent::dialogRejected()
}
m_dialog->deleteLater();
m_dialog = 0;
m_dialog = nullptr;
processNext();
}
......@@ -299,7 +299,7 @@ void SecretAgent::walletOpened(bool success)
if (!success) {
m_openWalletFailed = true;
m_wallet->deleteLater();
m_wallet = 0;
m_wallet = nullptr;
} else {
m_openWalletFailed = false;
}
......@@ -312,7 +312,7 @@ void SecretAgent::walletClosed()
if (m_wallet) {
m_wallet->deleteLater();
}
m_wallet = 0;
m_wallet = nullptr;
}
void SecretAgent::processNext()
......@@ -391,7 +391,7 @@ bool SecretAgent::processGetSecrets(SecretsRequest &request) const
m_dialog->errorMessage(),
request.message);
delete m_dialog;
m_dialog = 0;
m_dialog = nullptr;
return true;
} else {
request.dialog = m_dialog;
......@@ -525,7 +525,7 @@ bool SecretAgent::useWallet() const
}
} else if (m_wallet) {
m_wallet->deleteLater();
m_wallet = 0;
m_wallet = nullptr;
}
return false;
......
......@@ -42,7 +42,7 @@ public:
type(_type),
flags(NetworkManager::SecretAgent::None),
saveSecretsWithoutReply(false),
dialog(0)
dialog(nullptr)
{}
inline bool operator==(const QString &other) const {
return callId == other;
......@@ -69,7 +69,7 @@ class Q_DECL_EXPORT SecretAgent : public NetworkManager::SecretAgent
{
Q_OBJECT
public:
explicit SecretAgent(QObject* parent = 0);
explicit SecretAgent(QObject* parent = nullptr);
~SecretAgent() override;
public Q_SLOTS:
......
......@@ -47,7 +47,7 @@ Q_PROPERTY(bool modemDeviceAvailable READ isModemDeviceAvailable NOTIFY modemDev
Q_PROPERTY(bool bluetoothDeviceAvailable READ isBluetoothDeviceAvailable NOTIFY bluetoothDeviceAvailableChanged)
Q_OBJECT
public:
explicit AvailableDevices(QObject* parent = 0);
explicit AvailableDevices(QObject* parent = nullptr);
~AvailableDevices() override;
public Q_SLOTS:
......
......@@ -39,13 +39,13 @@
ConnectionIcon::ConnectionIcon(QObject* parent)
: QObject(parent)
, m_signal(0)
, m_wirelessNetwork(0)
, m_wirelessNetwork(nullptr)
, m_connecting(false)
, m_limited(false)
, m_vpn(false)
, m_airplaneMode(false)
#if WITH_MODEMMANAGER_SUPPORT
, m_modemNetwork(0)
, m_modemNetwork(nullptr)
#endif
{
connect(NetworkManager::notifier(), &NetworkManager::Notifier::primaryConnectionChanged, this, &ConnectionIcon::primaryConnectionChanged);
......@@ -303,12 +303,12 @@ void ConnectionIcon::setIcons()
m_signal = 0;
#if WITH_MODEMMANAGER_SUPPORT
if (m_modemNetwork) {
disconnect(m_modemNetwork.data(), 0, this, 0);
disconnect(m_modemNetwork.data(), nullptr, this, nullptr);
m_modemNetwork.clear();
}
#endif
if (m_wirelessNetwork) {
disconnect(m_wirelessNetwork.data(), 0, this, 0);
disconnect(m_wirelessNetwork.data(), nullptr, this, nullptr);
m_wirelessNetwork.clear();
}
......
......@@ -38,7 +38,7 @@ Q_PROPERTY(QString connectionTooltipIcon READ connectionTooltipIcon NOTIFY conne
Q_PROPERTY(bool airplaneMode READ airplaneMode WRITE setAirplaneMode NOTIFY airplaneModeChanged)
Q_OBJECT
public:
explicit ConnectionIcon(QObject* parent = 0);
explicit ConnectionIcon(QObject* parent = nullptr);
~ConnectionIcon() override;
bool connecting() const;
......
......@@ -49,7 +49,7 @@ Q_PROPERTY(bool wwanEnabled READ isWwanEnabled NOTIFY wwanEnabled)
Q_PROPERTY(bool wwanHwEnabled READ isWwanHwEnabled NOTIFY wwanHwEnabled)
Q_OBJECT
public:
explicit EnabledConnections(QObject* parent = 0);
explicit EnabledConnections(QObject* parent = nullptr);
~EnabledConnections() override;
bool isNetworkingEnabled() const;
......
......@@ -31,7 +31,7 @@ Q_ENUMS(ConnectionType)
Q_ENUMS(SecurityType)
public:
explicit Enums(QObject* parent = 0);
explicit Enums(QObject* parent = nullptr);
~Enums() override;
enum ConnectionStatus {
......
......@@ -52,7 +52,7 @@ public:
static SortedConnectionType connectionTypeToSortedType(NetworkManager::ConnectionSettings::ConnectionType type);
explicit NetworkStatus(QObject* parent = 0);
explicit NetworkStatus(QObject* parent = nullptr);
~NetworkStatus() override;
QString activeConnections() const;
......
......@@ -242,7 +242,7 @@ void ConnectionEditorBase::initialize()
addSettingWidget(teamWidget, i18n("Team"));
} else if (type == NetworkManager::ConnectionSettings::Vpn) { // VPN
QString error;
VpnUiPlugin *vpnPlugin = 0;
VpnUiPlugin *vpnPlugin = nullptr;
NetworkManager::VpnSetting::Ptr vpnSetting =
m_connection->setting(NetworkManager::Setting::Vpn).staticCast<NetworkManager::VpnSetting>();
if (!vpnSetting) {
......
......@@ -40,7 +40,7 @@ class Q_DECL_EXPORT BondWidget : public SettingWidget
Q_OBJECT
public:
explicit BondWidget(const QString & masterUuid, const NetworkManager::Setting::Ptr &setting = NetworkManager::Setting::Ptr(),
QWidget* parent = 0, Qt::WindowFlags f = 0);
QWidget* parent = nullptr, Qt::WindowFlags f = {});
~BondWidget() override;
void loadConfig(const NetworkManager::Setting::Ptr &setting) override;
......
......@@ -40,7 +40,7 @@ class Q_DECL_EXPORT BridgeWidget : public SettingWidget
Q_OBJECT
public:
explicit BridgeWidget(const QString & masterUuid, const NetworkManager::Setting::Ptr &setting = NetworkManager::Setting::Ptr(),
QWidget* parent = 0, Qt::WindowFlags f = 0);
QWidget* parent = nullptr, Qt::WindowFlags f = {});
~BridgeWidget() override;
void loadConfig(const NetworkManager::Setting::Ptr &setting) override;
......
......@@ -36,7 +36,7 @@ class Q_DECL_EXPORT BtWidget : public SettingWidget
{
Q_OBJECT
public:
explicit BtWidget(const NetworkManager::Setting::Ptr &setting = NetworkManager::Setting::Ptr(), QWidget* parent = 0, Qt::WindowFlags f = 0);
explicit BtWidget(const NetworkManager::Setting::Ptr &setting = NetworkManager::Setting::Ptr(), QWidget* parent = nullptr, Qt::WindowFlags f = {});
~BtWidget() override;
void loadConfig(const NetworkManager::Setting::Ptr &setting) override;
......
......@@ -36,7 +36,7 @@ class Q_DECL_EXPORT CdmaWidget : public SettingWidget
{
Q_OBJECT
public:
explicit CdmaWidget(const NetworkManager::Setting::Ptr &setting = NetworkManager::Setting::Ptr(), QWidget *parent = 0, Qt::WindowFlags f = 0);
explicit CdmaWidget(const NetworkManager::Setting::Ptr &setting = NetworkManager::Setting::Ptr(), QWidget *parent = nullptr, Qt::WindowFlags f = {});
~CdmaWidget() override;
void loadConfig(const NetworkManager::Setting::Ptr &setting) override;
......
Supports Markdown
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