Commit fd046f01 authored by Kevin Funk's avatar Kevin Funk

clang-tidy: modernize-use-nullptr

parent 58022184
......@@ -95,7 +95,7 @@ void HostPreferencesList::configureHost()
qCDebug(KRDC) << "Configure host: " << urlString;
HostPreferences* prefs = 0;
HostPreferences* prefs = nullptr;
const QList<RemoteViewFactory *> remoteViewFactories(m_mainWindow->remoteViewFactoriesList());
foreach(RemoteViewFactory *factory, remoteViewFactories) {
......
......@@ -30,7 +30,7 @@ class ConnectionDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit ConnectionDelegate(QObject *parent = 0);
explicit ConnectionDelegate(QObject *parent = nullptr);
QString displayText(const QVariant &value, const QLocale& locale) const override;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
......
......@@ -39,8 +39,8 @@ HostPreferences::HostPreferences(KConfigGroup configGroup, QObject *parent)
: QObject(parent),
m_configGroup(configGroup),
m_connected(false),
showAgainCheckBox(0),
walletSupportCheckBox(0)
showAgainCheckBox(nullptr),
walletSupportCheckBox(nullptr)
{
m_hostConfigured = m_configGroup.hasKey("showConfigAgain");
}
......
......@@ -39,7 +39,7 @@ RemoteView::RemoteView(QWidget *parent)
m_scale(false),
m_keyboardIsGrabbed(false),
#ifndef QTONLY
m_wallet(0),
m_wallet(nullptr),
#endif
m_dotCursorState(CursorOff)
{
......
......@@ -377,7 +377,7 @@ Q_SIGNALS:
void mouseStateChanged(int x, int y, int buttonMask);
protected:
RemoteView(QWidget *parent = 0);
RemoteView(QWidget *parent = nullptr);
void focusInEvent(QFocusEvent *event) override;
void focusOutEvent(QFocusEvent *event) override;
......
......@@ -85,7 +85,7 @@ protected:
/**
* Protected constructor so it cannot be instantiated.
*/
RemoteViewFactory(QObject *parent = 0);
RemoteViewFactory(QObject *parent = nullptr);
};
......
......@@ -447,7 +447,7 @@ QPoint FloatingToolBarPrivate::getOuterPoint() const
void FloatingToolBar::animate()
{
if (style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) {
if (style()->styleHint(QStyle::SH_Widget_Animate, nullptr, this)) {
// move currentPosition towards endPosition
int dX = d->endPosition.x() - d->currentPosition.x();
int dY = d->endPosition.y() - d->currentPosition.y();
......
......@@ -72,15 +72,15 @@
MainWindow::MainWindow(QWidget *parent)
: KXmlGuiWindow(parent),
m_fullscreenWindow(0),
m_protocolInput(0),
m_addressInput(0),
m_toolBar(0),
m_fullscreenWindow(nullptr),
m_protocolInput(nullptr),
m_addressInput(nullptr),
m_toolBar(nullptr),
m_currentRemoteView(-1),
m_systemTrayIcon(0),
m_dockWidgetTableView(0),
m_newConnectionTableView(0),
m_newConnectionWidget(0)
m_systemTrayIcon(nullptr),
m_dockWidgetTableView(nullptr),
m_newConnectionTableView(nullptr),
m_newConnectionWidget(nullptr)
{
loadAllPlugins();
......@@ -212,7 +212,7 @@ void MainWindow::loadAllPlugins()
const bool enabled = info.isPluginEnabled();
if (enabled) {
RemoteViewFactory *component = createPluginFromInfo(info);
if (component != 0) {
if (component != nullptr) {
const int sorting = info.property(QStringLiteral("X-KDE-KRDC-Sorting")).toInt();
m_remoteViewFactories.insert(sorting, component);
} else {
......@@ -227,7 +227,7 @@ void MainWindow::loadAllPlugins()
RemoteViewFactory *MainWindow::createPluginFromInfo(const KPluginInfo &info)
{
RemoteViewFactory *plugin = 0;
RemoteViewFactory *plugin = nullptr;
KPluginLoader loader(info.libraryPath());
KPluginFactory *factory = loader.factory();
if (factory) {
......@@ -279,7 +279,7 @@ void MainWindow::newConnection(const QUrl &newUrl, bool switchFullscreenWhenConn
m_addressInput->setText(url.authority());
}
RemoteView *view = 0;
RemoteView *view = nullptr;
KConfigGroup configGroup = Settings::self()->config()->group(QStringLiteral("hostpreferences")).group(url.toDisplayString(QUrl::StripTrailingSlash));
foreach(RemoteViewFactory *factory, m_remoteViewFactories) {
......@@ -463,7 +463,7 @@ void MainWindow::switchFullscreen()
if (m_fullscreenWindow) {
// Leaving full screen mode
m_fullscreenWindow->setWindowState(0);
m_fullscreenWindow->setWindowState(nullptr);
m_fullscreenWindow->hide();
m_tabWidget->tabBar()->setHidden(m_tabWidget->count() <= 1 && !Settings::showTabBar());
......@@ -481,7 +481,7 @@ void MainWindow::switchFullscreen()
if (m_toolBar) {
m_toolBar->hideAndDestroy();
m_toolBar->deleteLater();
m_toolBar = 0;
m_toolBar = nullptr;
}
actionCollection()->action(QStringLiteral("switch_fullscreen"))->setIcon(QIcon::fromTheme(QStringLiteral("view-fullscreen")));
......@@ -489,7 +489,7 @@ void MainWindow::switchFullscreen()
actionCollection()->action(QStringLiteral("switch_fullscreen"))->setIconText(i18n("Full Screen"));
m_fullscreenWindow->deleteLater();
m_fullscreenWindow = 0;
m_fullscreenWindow = nullptr;
} else {
// Entering full screen mode
m_fullscreenWindow = new QWidget(this, Qt::Window);
......@@ -629,7 +629,7 @@ void MainWindow::openTabSettings(int index)
void MainWindow::showSettingsDialog(const QString &url)
{
HostPreferences *prefs = 0;
HostPreferences *prefs = nullptr;
foreach(RemoteViewFactory *factory, remoteViewFactoriesList()) {
if (factory->supportsUrl(QUrl(url))) {
......@@ -838,7 +838,7 @@ void MainWindow::updateActionStatus()
if (m_tabWidget->currentWidget() == m_newConnectionWidget)
enabled = false;
RemoteView* view = (m_currentRemoteView >= 0 && enabled) ? currentRemoteView() : 0;
RemoteView* view = (m_currentRemoteView >= 0 && enabled) ? currentRemoteView() : nullptr;
actionCollection()->action(QStringLiteral("take_screenshot"))->setEnabled(enabled);
actionCollection()->action(QStringLiteral("disconnect"))->setEnabled(enabled);
......@@ -904,7 +904,7 @@ void MainWindow::updateConfiguration()
if(m_fullscreenWindow) m_systemTrayIcon->setAssociatedWidget(m_fullscreenWindow);
} else if (m_systemTrayIcon) {
delete m_systemTrayIcon;
m_systemTrayIcon = 0;
m_systemTrayIcon = nullptr;
}
// update the scroll areas background color
......@@ -1162,7 +1162,7 @@ RemoteView* MainWindow::currentRemoteView() const
if (m_currentRemoteView >= 0) {
return m_remoteViewMap.value(m_tabWidget->widget(m_currentRemoteView));
} else {
return 0;
return nullptr;
}
}
......
......@@ -56,7 +56,7 @@ class MainWindow : public KXmlGuiWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow() override;
QMap<QWidget *, RemoteView *> remoteViewList() const;
......
......@@ -33,7 +33,7 @@ class RdpHostPreferences : public HostPreferences
Q_OBJECT
public:
explicit RdpHostPreferences(KConfigGroup configGroup, QObject *parent = 0);
explicit RdpHostPreferences(KConfigGroup configGroup, QObject *parent = nullptr);
~RdpHostPreferences() override;
void setResolution(int resolution);
......
......@@ -33,7 +33,7 @@ class RdpPreferences : public KCModule
Q_OBJECT
public:
explicit RdpPreferences(QWidget *parent = 0, const QVariantList &args = QVariantList());
explicit RdpPreferences(QWidget *parent = nullptr, const QVariantList &args = QVariantList());
~RdpPreferences() override;
void save() override;
......
......@@ -44,7 +44,7 @@ RdpView::RdpView(QWidget *parent,
m_user(user),
m_password(password),
m_quitFlag(false),
m_process(NULL)
m_process(nullptr)
{
m_url = url;
m_host = url.host();
......@@ -416,7 +416,7 @@ void RdpView::connectionClosed(CloseType closeType)
void RdpView::connectionError(const QString &text, const QString &caption)
{
m_quitFlag = true;
KMessageBox::error(0, text, caption);
KMessageBox::error(nullptr, text, caption);
emit disconnectedError();
connectionClosed(ForceClose);
}
......@@ -457,7 +457,7 @@ void RdpView::receivedStandardError()
i18n("RDP Failure"));
return;
} else if(line.contains(QLatin1String("connection failure"))) {
KMessageBox::error(0, i18n("Connection failed. You might have passed a wrong address or username."),
KMessageBox::error(nullptr, i18n("Connection failed. You might have passed a wrong address or username."),
i18n("RDP Failure"));
return;
}
......
......@@ -43,7 +43,7 @@ class RdpView : public RemoteView
Q_OBJECT
public:
explicit RdpView(QWidget *parent = 0,
explicit RdpView(QWidget *parent = nullptr,
const QUrl &url = QUrl(),
KConfigGroup configGroup = KConfigGroup(),
const QString &user = QString(),
......
......@@ -69,7 +69,7 @@ int RemoteDesktopsModel::rowCount(const QModelIndex &) const
Qt::ItemFlags RemoteDesktopsModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
return 0;
return nullptr;
if (index.column() == RemoteDesktopsModel::Favorite) {
return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
}
......
......@@ -54,7 +54,7 @@ class TabbedViewWidget : public QTabWidget
{
Q_OBJECT
public:
explicit TabbedViewWidget(QWidget *parent = 0);
explicit TabbedViewWidget(QWidget *parent = nullptr);
~TabbedViewWidget() override;
TabbedViewWidgetModel* getModel();
int addTab(QWidget *page, const QString &label);
......
......@@ -36,7 +36,7 @@ class TestView : public RemoteView
Q_OBJECT
public:
explicit TestView(QWidget *parent = 0, const QUrl &url = QUrl(), KConfigGroup configGroup = KConfigGroup());
explicit TestView(QWidget *parent = nullptr, const QUrl &url = QUrl(), KConfigGroup configGroup = KConfigGroup());
~TestView() override;
......@@ -65,11 +65,11 @@ class TestHostPreferences : public HostPreferences
{
Q_OBJECT
public:
explicit TestHostPreferences(KConfigGroup configGroup, QObject *parent = 0)
explicit TestHostPreferences(KConfigGroup configGroup, QObject *parent = nullptr)
: HostPreferences(configGroup, parent) {}
protected:
QWidget* createProtocolSpecificConfigPage() override { return 0; };
QWidget* createProtocolSpecificConfigPage() override { return nullptr; };
};
#endif // TESTVIEW_H
......@@ -54,7 +54,7 @@ HostPreferences *TestViewFactory::createHostPreferences(KConfigGroup configGroup
Q_UNUSED(configGroup);
Q_UNUSED(parent);
return 0;
return nullptr;
}
QString TestViewFactory::scheme() const
......
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