Use nullptr

parent 2a86d5be
......@@ -34,7 +34,7 @@ public:
DeviceFullNameRole = BluezQt::DevicesModel::LastRole + 11,
};
explicit DevicesProxyModel(QObject *parent = Q_NULLPTR);
explicit DevicesProxyModel(QObject *parent = nullptr);
QHash<int, QByteArray> roleNames() const override;
QVariant data(const QModelIndex &index, int role) const override;
......
......@@ -29,7 +29,7 @@ class LaunchApp : public QObject
Q_OBJECT
public:
explicit LaunchApp(QObject *parent = Q_NULLPTR);
explicit LaunchApp(QObject *parent = nullptr);
public Q_SLOTS:
bool runCommand(const QString &exe, const QStringList &args = QStringList());
......
......@@ -31,7 +31,7 @@ class Notify : public QObject
Q_OBJECT
public:
explicit Notify(QObject *parent = Q_NULLPTR);
explicit Notify(QObject *parent = nullptr);
public Q_SLOTS:
void connectionFailed(const QString &title, const QString &text);
......
......@@ -122,7 +122,7 @@ void SendFileItemAction::loadMenu(QMenu *menu)
QAction *action = new QAction(icon, device.value(QStringLiteral("name")), this);
connect(action, &QAction::triggered, this, &SendFileItemAction::deviceTriggered);
action->setData(device.value(QStringLiteral("UBI")));
menu->insertAction(0, action);
menu->insertAction(nullptr, action);
}
}
......
......@@ -262,8 +262,8 @@ void AdapterSettings::slotSettingsChanged()
KCMBlueDevilAdapters::KCMBlueDevilAdapters(QWidget *parent, const QVariantList&)
: KCModule(parent)
, m_noAdaptersMessage(0)
, m_systemCheck(0)
, m_noAdaptersMessage(nullptr)
, m_systemCheck(nullptr)
{
KAboutData *ab = new KAboutData(QStringLiteral("kcmbluedeviladapters"),
i18n("Bluetooth Adapters"),
......
......@@ -39,12 +39,12 @@ SystemCheck::SystemCheck(BluezQt::Manager *manager, QWidget *parent)
: QObject(parent)
, m_parent(parent)
, m_manager(manager)
, m_blockedError(0)
, m_noAdaptersError(0)
, m_noKdedRunningError(0)
, m_noUsableAdapterError(0)
, m_disabledNotificationsError(0)
, m_notDiscoverableAdapterError(0)
, m_blockedError(nullptr)
, m_noAdaptersError(nullptr)
, m_noKdedRunningError(nullptr)
, m_noUsableAdapterError(nullptr)
, m_disabledNotificationsError(nullptr)
, m_notDiscoverableAdapterError(nullptr)
{
m_kded = new org::kde::kded5(QStringLiteral("org.kde.kded5"), QStringLiteral("/kded"), QDBusConnection::sessionBus(), this);
......
......@@ -35,7 +35,7 @@ class DeviceDetails : public QWidget
Q_OBJECT
public:
explicit DeviceDetails(QWidget *parent = Q_NULLPTR);
explicit DeviceDetails(QWidget *parent = nullptr);
void setDevice(BluezQt::DevicePtr device);
......
......@@ -106,9 +106,9 @@ bool DevicesProxyModel::duplicateIndexAddress(const QModelIndex &idx) const
KCMBlueDevilDevices::KCMBlueDevilDevices(QWidget *parent, const QVariantList&)
: KCModule(parent)
, m_ui(new Ui::Devices)
, m_devicesModel(Q_NULLPTR)
, m_proxyModel(Q_NULLPTR)
, m_systemCheck(Q_NULLPTR)
, m_devicesModel(nullptr)
, m_proxyModel(nullptr)
, m_systemCheck(nullptr)
{
KAboutData *ab = new KAboutData(QStringLiteral("kcmbluedevildevices"),
i18n("Bluetooth Devices"),
......
......@@ -46,7 +46,7 @@ class DevicesProxyModel : public QSortFilterProxyModel
Q_OBJECT
public:
explicit DevicesProxyModel(QObject *parent = Q_NULLPTR);
explicit DevicesProxyModel(QObject *parent = nullptr);
QVariant data(const QModelIndex &index, int role) const override;
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
......
......@@ -43,7 +43,7 @@ K_PLUGIN_FACTORY_WITH_JSON(BlueDevilFactory,
KCMBlueDevilGlobal::KCMBlueDevilGlobal(QWidget *parent, const QVariantList&)
: KCModule(parent)
, m_systemCheck(Q_NULLPTR)
, m_systemCheck(nullptr)
{
KAboutData *ab = new KAboutData(QStringLiteral("kcmbluedevilglobal"),
i18n("Bluetooth Advanced Settings"),
......
......@@ -38,7 +38,7 @@ public:
AcceptAndTrust
};
explicit RequestAuthorization(BluezQt::DevicePtr device, QObject *parent = Q_NULLPTR);
explicit RequestAuthorization(BluezQt::DevicePtr device, QObject *parent = nullptr);
Q_SIGNALS:
void done(Result result);
......
......@@ -37,7 +37,7 @@ public:
Accept
};
explicit RequestConfirmation(BluezQt::DevicePtr device, const QString &pin, QObject *parent = Q_NULLPTR);
explicit RequestConfirmation(BluezQt::DevicePtr device, const QString &pin, QObject *parent = nullptr);
Q_SIGNALS:
void done(Result result);
......
......@@ -35,7 +35,7 @@
RequestPin::RequestPin(BluezQt::DevicePtr device, bool numeric, QObject *parent)
: QObject(parent)
, m_dialogWidget(0)
, m_dialogWidget(nullptr)
, m_device(device)
, m_numeric(numeric)
{
......
......@@ -39,7 +39,7 @@ class RequestPin : public QObject
Q_OBJECT
public:
explicit RequestPin(BluezQt::DevicePtr device, bool numeric = false, QObject *parent = Q_NULLPTR);
explicit RequestPin(BluezQt::DevicePtr device, bool numeric = false, QObject *parent = nullptr);
Q_SIGNALS:
void done(const QString &result);
......
......@@ -220,7 +220,7 @@ void ReceiveFileJob::statusChanged(BluezQt::ObexTransfer::Status status)
case BluezQt::ObexTransfer::Complete: {
qCDebug(BLUEDAEMON) << "ReceiveFileJob-Transfer Complete";
KIO::CopyJob *job = KIO::move(QUrl::fromLocalFile(m_tempPath), m_targetPath, KIO::HideProgressInfo);
job->setUiDelegate(0);
job->setUiDelegate(nullptr);
connect(job, &KIO::CopyJob::finished, this, &ReceiveFileJob::moveFinished);
break;
}
......
......@@ -76,7 +76,7 @@ static bool urlIsRoot(const QUrl &url)
KioFtp::KioFtp(const QByteArray &pool, const QByteArray &app)
: SlaveBase(QByteArrayLiteral("obexftp"), pool, app)
, m_transfer(0)
, m_transfer(nullptr)
{
m_kded = new org::kde::BlueDevil::ObexFtp(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/bluedevil"),
QDBusConnection::sessionBus(), this);
......@@ -122,7 +122,7 @@ bool KioFtp::createSession(const QString &target)
if (reply.isError() || sessionPath.isEmpty()) {
qCDebug(OBEXFTP) << "Create session error" << reply.error().name() << reply.error().message();
delete m_transfer;
m_transfer = 0;
m_transfer = nullptr;
m_sessionPath.clear();
return false;
}
......
......@@ -32,7 +32,7 @@ class TransferFileJob : public KJob
Q_OBJECT
public:
explicit TransferFileJob(BluezQt::ObexTransferPtr transfer, KioFtp *parent = 0);
explicit TransferFileJob(BluezQt::ObexTransferPtr transfer, KioFtp *parent = nullptr);
void start() override;
......
......@@ -58,7 +58,7 @@ private:
DevicesProxyModel::DevicesProxyModel(QObject *parent)
: QSortFilterProxyModel(parent)
, m_devicesModel(0)
, m_devicesModel(nullptr)
{
setDynamicSortFilter(true);
sort(0, Qt::DescendingOrder);
......@@ -100,7 +100,7 @@ BluezQt::DevicePtr DevicesProxyModel::device(const QModelIndex &index) const
DiscoverWidget::DiscoverWidget(BluezQt::Manager *manager, QWidget* parent)
: QWidget(parent)
, m_manager(manager)
, m_warningWidget(0)
, m_warningWidget(nullptr)
{
setupUi(this);
......@@ -134,7 +134,7 @@ void DiscoverWidget::checkAdapters()
}
delete m_warningWidget;
m_warningWidget = 0;
m_warningWidget = nullptr;
if (!error && !m_manager->isBluetoothBlocked()) {
return;
......
......@@ -38,7 +38,7 @@ class DiscoverWidget : public QWidget, public Ui::Discover
Q_OBJECT
public:
explicit DiscoverWidget(BluezQt::Manager *manager, QWidget *parent = 0);
explicit DiscoverWidget(BluezQt::Manager *manager, QWidget *parent = nullptr);
Q_SIGNALS:
void deviceSelected(BluezQt::DevicePtr device);
......
......@@ -36,7 +36,7 @@ class ConnectingPage : public QWizardPage, public Ui::Connecting
Q_OBJECT
public:
explicit ConnectingPage(SendFileWizard *wizard = Q_NULLPTR);
explicit ConnectingPage(SendFileWizard *wizard = nullptr);
void initializePage() override;
bool isComplete() const override;
......
......@@ -33,7 +33,7 @@ class FailPage : public QWizardPage, Ui::FailPage
Q_OBJECT
public:
explicit FailPage(SendFileWizard *parent = Q_NULLPTR);
explicit FailPage(SendFileWizard *parent = nullptr);
void initializePage() override;
......
......@@ -32,7 +32,7 @@ class SelectFilesPage : public QWizardPage
Q_OBJECT
public:
explicit SelectFilesPage(QWidget *parent = 0);
explicit SelectFilesPage(QWidget *parent = nullptr);
void initializePage() override;
bool isComplete() const override;
......
......@@ -42,7 +42,7 @@ class SendFilesJob : public KJob
Q_OBJECT
public:
explicit SendFilesJob(const QStringList &files, BluezQt::DevicePtr device, const QDBusObjectPath &session, QObject *parent = Q_NULLPTR);
explicit SendFilesJob(const QStringList &files, BluezQt::DevicePtr device, const QDBusObjectPath &session, QObject *parent = nullptr);
void start() override;
bool doKill() override;
......
......@@ -48,7 +48,7 @@ SendFileWizard::SendFileWizard(const QString &device, const QStringList &files)
: QWizard()
, m_deviceUrl(device)
, m_files(files)
, m_job(0)
, m_job(nullptr)
{
setOption(NoCancelButton, false);
setButton(QWizard::NextButton, new QPushButton(QIcon::fromTheme(QStringLiteral("document-export")), i18n("Send Files")));
......
......@@ -39,7 +39,7 @@ class ConnectPage : public QWizardPage, Ui::Connect
Q_OBJECT
public:
explicit ConnectPage(BlueWizard *parent = 0);
explicit ConnectPage(BlueWizard *parent = nullptr);
int nextId() const override;
void initializePage() override;
......
......@@ -56,7 +56,7 @@ private:
DevicesProxyModel::DevicesProxyModel(QObject *parent)
: QSortFilterProxyModel(parent)
, m_devicesModel(0)
, m_devicesModel(nullptr)
{
setDynamicSortFilter(true);
sort(0, Qt::DescendingOrder);
......@@ -110,9 +110,9 @@ BluezQt::DevicePtr DevicesProxyModel::device(const QModelIndex &index) const
DiscoverPage::DiscoverPage(BlueWizard *parent)
: QWizardPage(parent)
, m_wizard(parent)
, m_model(0)
, m_manager(0)
, m_warningWidget(0)
, m_model(nullptr)
, m_manager(nullptr)
, m_warningWidget(nullptr)
{
setupUi(this);
setTitle(i18n("Select a device"));
......@@ -261,7 +261,7 @@ void DiscoverPage::checkAdapters()
}
delete m_warningWidget;
m_warningWidget = 0;
m_warningWidget = nullptr;
if (!error && !m_manager->isBluetoothBlocked()) {
return;
......
......@@ -34,7 +34,7 @@ class DiscoverPage : public QWizardPage, public Ui::Discover
Q_OBJECT
public:
explicit DiscoverPage(BlueWizard *parent = 0);
explicit DiscoverPage(BlueWizard *parent = nullptr);
void initializePage() override;
bool isComplete() const override;
......
......@@ -34,7 +34,7 @@ class FailPage : public QWizardPage, Ui::Fail
Q_OBJECT
public:
explicit FailPage(BlueWizard *parent = 0);
explicit FailPage(BlueWizard *parent = nullptr);
void initializePage() override;
......
......@@ -36,7 +36,7 @@ class PairingPage : public QWizardPage, Ui::Pairing
Q_OBJECT
public:
explicit PairingPage(BlueWizard *parent = Q_NULLPTR);
explicit PairingPage(BlueWizard *parent = nullptr);
int nextId() const override;
void initializePage() override;
......
......@@ -35,7 +35,7 @@ class SuccessPage : public QWizardPage, Ui::Success
Q_OBJECT
public:
explicit SuccessPage(BlueWizard *parent = 0);
explicit SuccessPage(BlueWizard *parent = nullptr);
int nextId() const override;
void initializePage() override;
......
......@@ -28,7 +28,7 @@ class WizardAgent : public BluezQt::Agent
Q_OBJECT
public:
explicit WizardAgent(QObject *parent = 0);
explicit WizardAgent(QObject *parent = nullptr);
QString pin();
void setPin(const QString &pin);
......
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