[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kde-cli-tools] /: Use nullptr
From: Friedrich W. H. Kossebau <null () kde ! org>
Date: 2018-02-10 13:54:40
Message-ID: E1ekVc0-0005eB-2k () code ! kde ! org
[Download RAW message or body]
Git commit 64f02d16fed5429893d56a17dc60209443429ddf by Friedrich W. H. Kossebau.
Committed on 10/02/2018 at 13:31.
Pushed by kossebau into branch 'master'.
Use nullptr
M +1 -1 kcmshell/main.cpp
M +1 -1 kcmshell/main.h
M +4 -4 kdesu/kdesu.cpp
M +1 -1 kdesu/sudlg.cpp
M +1 -1 keditfiletype/filegroupdetails.h
M +2 -2 keditfiletype/filetypedetails.cpp
M +2 -2 keditfiletype/filetypedetails.h
M +1 -1 keditfiletype/filetypesview.cpp
M +2 -2 keditfiletype/keditfiletype.cpp
M +2 -2 keditfiletype/kservicelistwidget.cpp
M +1 -1 keditfiletype/kservicelistwidget.h
M +1 -1 keditfiletype/kserviceselectdlg.h
M +10 -10 kioclient/kioclient.cpp
M +3 -3 kstart/kstart.cpp
https://commits.kde.org/kde-cli-tools/64f02d16fed5429893d56a17dc60209443429ddf
diff --git a/kcmshell/main.cpp b/kcmshell/main.cpp
index aaee9dc..67e12e8 100644
--- a/kcmshell/main.cpp
+++ b/kcmshell/main.cpp
@@ -297,7 +297,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int _argc, char *_argv[])
}
for (KService::List::ConstIterator it = modules.constBegin(); it != \
modules.constEnd(); ++it) {
- dlg->addModule(*it, 0, moduleArgs);
+ dlg->addModule(*it, nullptr, moduleArgs);
}
if (parser.isSet("icon")) {
diff --git a/kcmshell/main.h b/kcmshell/main.h
index b2c4860..7e17753 100644
--- a/kcmshell/main.h
+++ b/kcmshell/main.h
@@ -89,7 +89,7 @@ public:
* Constructor. Parameter @p dialogFace is passed to KCMultiDialog
* unchanged.
*/
- explicit KCMShellMultiDialog(KPageDialog::FaceType dialogFace, QWidget *parent = \
0); + explicit KCMShellMultiDialog(KPageDialog::FaceType dialogFace, QWidget \
*parent = nullptr);
public Q_SLOTS:
diff --git a/kdesu/kdesu.cpp b/kdesu/kdesu.cpp
index 15e863c..043c96f 100644
--- a/kdesu/kdesu.cpp
+++ b/kdesu/kdesu.cpp
@@ -160,11 +160,11 @@ int main(int argc, char *argv[])
if (result == 127)
{
- KMessageBox::sorry(0, i18n("Cannot execute command '%1'.", \
QString::fromLocal8Bit(command))); + KMessageBox::sorry(nullptr, i18n("Cannot \
execute command '%1'.", QString::fromLocal8Bit(command))); }
if (result == -2)
{
- KMessageBox::sorry(0, i18n("Cannot execute command '%1'. It contains invalid \
characters.", QString::fromLocal8Bit(command))); + KMessageBox::sorry(nullptr, \
i18n("Cannot execute command '%1'. It contains invalid characters.", \
QString::fromLocal8Bit(command))); }
return result;
@@ -202,7 +202,7 @@ static int startApp(QCommandLineParser& p)
QByteArray user = p.value("u").toLocal8Bit();
QByteArray auth_user = user;
struct passwd *pw = getpwnam(user);
- if (pw == 0L)
+ if (pw == nullptr)
{
qCCritical(category) << "User " << user << " does not exist\n";
p.showHelp(1);
@@ -382,7 +382,7 @@ static int startApp(QCommandLineParser& p)
if (needpw < 0)
{
QString err = i18n("Su returned with an error.\n");
- KMessageBox::error(0L, err);
+ KMessageBox::error(nullptr, err);
p.showHelp(1);
}
if (needpw == 0)
diff --git a/kdesu/sudlg.cpp b/kdesu/sudlg.cpp
index 37f9340..6b190c4 100644
--- a/kdesu/sudlg.cpp
+++ b/kdesu/sudlg.cpp
@@ -13,7 +13,7 @@
#include <qstyle.h>
KDEsuDialog::KDEsuDialog(QByteArray user, QByteArray authUser, bool enableKeep, \
const QString& icon, bool withIgnoreButton)
- : KPasswordDialog(0, enableKeep ? ShowKeepPassword : NoFlags)
+ : KPasswordDialog(nullptr, enableKeep ? ShowKeepPassword : NoFlags)
{
if ( !icon.isEmpty() ) {
setPixmap(QIcon::fromTheme(icon).pixmap(style()->pixelMetric(QStyle::PM_LargeIconSize)));
diff --git a/keditfiletype/filegroupdetails.h b/keditfiletype/filegroupdetails.h
index e99449c..d553388 100644
--- a/keditfiletype/filegroupdetails.h
+++ b/keditfiletype/filegroupdetails.h
@@ -32,7 +32,7 @@ class FileGroupDetails : public QWidget
{
Q_OBJECT
public:
- FileGroupDetails(QWidget *parent = 0);
+ FileGroupDetails(QWidget *parent = nullptr);
void setMimeTypeData( MimeTypeData * mimeTypeData );
diff --git a/keditfiletype/filetypedetails.cpp b/keditfiletype/filetypedetails.cpp
index 4d363c9..45edaaa 100644
--- a/keditfiletype/filetypedetails.cpp
+++ b/keditfiletype/filetypedetails.cpp
@@ -46,7 +46,7 @@
#include "typeslistitem.h"
FileTypeDetails::FileTypeDetails( QWidget * parent )
- : QWidget( parent ), m_mimeTypeData(0), m_item(0)
+ : QWidget( parent ), m_mimeTypeData(nullptr), m_item(nullptr)
{
QVBoxLayout* topLayout = new QVBoxLayout(this);
@@ -72,7 +72,7 @@ FileTypeDetails::FileTypeDetails( QWidget * parent )
iconButton->setWhatsThis( i18n("This button displays the icon associated"
" with the selected file type. Click on it to \
choose a different icon.") ); iconButton->setFixedSize(70, 70);
- iconLabel = 0;
+ iconLabel = nullptr;
hBox->addWidget(iconButton);
QGroupBox *gb = new QGroupBox(i18n("Filename Patterns"), firstWidget);
diff --git a/keditfiletype/filetypedetails.h b/keditfiletype/filetypedetails.h
index a050642..fd9ef8a 100644
--- a/keditfiletype/filetypedetails.h
+++ b/keditfiletype/filetypedetails.h
@@ -45,13 +45,13 @@ class FileTypeDetails : public QWidget
{
Q_OBJECT
public:
- FileTypeDetails(QWidget *parent = 0);
+ FileTypeDetails(QWidget *parent = nullptr);
/**
* Set a non-gui "mimetype data" to work on,
* and optionally a gui "treeview item", to update its icon if set.
*/
- void setMimeTypeData( MimeTypeData * mimeTypeData, TypesListItem* item = 0 );
+ void setMimeTypeData( MimeTypeData * mimeTypeData, TypesListItem* item = nullptr \
);
/**
* Called when ksycoca has changed
diff --git a/keditfiletype/filetypesview.cpp b/keditfiletype/filetypesview.cpp
index f0e09d2..daf16af 100644
--- a/keditfiletype/filetypesview.cpp
+++ b/keditfiletype/filetypesview.cpp
@@ -203,7 +203,7 @@ void FileTypesView::readFileTypes()
TypesListItem *item = new TypesListItem(groupItem, (*it2));
m_itemList.append( item );
}
- updateDisplay(0L);
+ updateDisplay(nullptr);
}
void FileTypesView::slotEmbedMajor(const QString &major, bool &embed)
diff --git a/keditfiletype/keditfiletype.cpp b/keditfiletype/keditfiletype.cpp
index 83c8f82..93ae72c 100644
--- a/keditfiletype/keditfiletype.cpp
+++ b/keditfiletype/keditfiletype.cpp
@@ -49,7 +49,7 @@
FileTypeDialog::FileTypeDialog( MimeTypeData* mime )
- : QDialog( 0 ),
+ : QDialog( nullptr ),
m_mimeTypeData(mime)
{
init();
@@ -154,7 +154,7 @@ int main(int argc, char ** argv)
QMimeDatabase db;
QString arg = parser.positionalArguments().first();
- MimeTypeData* mimeTypeData = 0;
+ MimeTypeData* mimeTypeData = nullptr;
const bool createType = arg.startsWith('*');
if ( createType ) {
QString mimeString = "application/x-kdeuser%1";
diff --git a/keditfiletype/kservicelistwidget.cpp \
b/keditfiletype/kservicelistwidget.cpp index b897abc..7600d9a 100644
--- a/keditfiletype/kservicelistwidget.cpp
+++ b/keditfiletype/kservicelistwidget.cpp
@@ -60,7 +60,7 @@ KServiceListItem::KServiceListItem( const KService::Ptr& pService, \
int kind ) KServiceListWidget::KServiceListWidget(int kind, QWidget *parent)
: QGroupBox( kind == SERVICELIST_APPLICATIONS ? i18n("Application Preference \
Order") : i18n("Services Preference Order"), parent ),
- m_kind( kind ), m_mimeTypeData( 0L )
+ m_kind( kind ), m_mimeTypeData( nullptr )
{
QHBoxLayout *lay= new QHBoxLayout(this);
@@ -271,7 +271,7 @@ void KServiceListWidget::addService()
}
servicesLB->insertItem(0, new KServiceListItem(service, m_kind));
- servicesLB->setCurrentItem(0);
+ servicesLB->setCurrentItem(nullptr);
updatePreferredServices();
diff --git a/keditfiletype/kservicelistwidget.h b/keditfiletype/kservicelistwidget.h
index fbc488a..2b3f9bf 100644
--- a/keditfiletype/kservicelistwidget.h
+++ b/keditfiletype/kservicelistwidget.h
@@ -51,7 +51,7 @@ class KServiceListWidget : public QGroupBox
Q_OBJECT
public:
enum { SERVICELIST_APPLICATIONS, SERVICELIST_SERVICES };
- explicit KServiceListWidget(int kind, QWidget *parent = 0);
+ explicit KServiceListWidget(int kind, QWidget *parent = nullptr);
void setMimeTypeData( MimeTypeData * item );
diff --git a/keditfiletype/kserviceselectdlg.h b/keditfiletype/kserviceselectdlg.h
index 1b52bba..2c1bfc4 100644
--- a/keditfiletype/kserviceselectdlg.h
+++ b/keditfiletype/kserviceselectdlg.h
@@ -38,7 +38,7 @@ public:
*/
explicit KServiceSelectDlg( const QString& serviceType,
const QString& value = QString(),
- QWidget *parent = 0L );
+ QWidget *parent = nullptr );
~KServiceSelectDlg() override;
diff --git a/kioclient/kioclient.cpp b/kioclient/kioclient.cpp
index 5a0ea7e..d10554d 100644
--- a/kioclient/kioclient.cpp
+++ b/kioclient/kioclient.cpp
@@ -197,14 +197,14 @@ static void checkArgumentCount(int count, int min, int max)
bool ClientApp::kde_open(const QUrl& url, const QString& mimeType, bool allowExec)
{
if ( mimeType.isEmpty() ) {
- KRun * run = new KRun( url, 0 );
+ KRun * run = new KRun( url, nullptr );
run->setRunExecutables(allowExec);
QObject::connect( run, SIGNAL( finished() ), this, SLOT( delayedQuit() ));
QObject::connect( run, SIGNAL( error() ), this, SLOT( delayedQuit() ));
qApp->exec();
return !krun_has_error;
} else {
- return KRun::runUrl(url, mimeType, 0);
+ return KRun::runUrl(url, mimeType, nullptr);
}
}
#endif
@@ -215,7 +215,7 @@ bool ClientApp::doCopy( const QStringList& urls )
QUrl dest = srcLst.takeLast();
KIO::Job * job = KIO::copy( srcLst, dest, s_jobFlags );
if ( !s_interactive )
- job->setUiDelegate( 0 );
+ job->setUiDelegate( nullptr );
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
qApp->exec();
return m_ok;
@@ -236,7 +236,7 @@ bool ClientApp::doList( const QStringList& urls )
QUrl dir = makeURL(urls.first());
KIO::Job * job = KIO::listDir(dir, KIO::HideProgressInfo);
if ( !s_interactive )
- job->setUiDelegate(0);
+ job->setUiDelegate(nullptr);
connect(job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)),
SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList)));
connect(job, SIGNAL(result(KJob *)), this, SLOT(slotResult(KJob *)));
@@ -250,7 +250,7 @@ bool ClientApp::doMove( const QStringList& urls )
QUrl dest = srcLst.takeLast();
KIO::Job * job = KIO::move( srcLst, dest, s_jobFlags );
if ( !s_interactive )
- job->setUiDelegate( 0 );
+ job->setUiDelegate( nullptr );
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
qApp->exec();
return m_ok;
@@ -260,7 +260,7 @@ bool ClientApp::doRemove( const QStringList& urls )
{
KIO::Job * job = KIO::del( makeUrls(urls), s_jobFlags );
if ( !s_interactive )
- job->setUiDelegate( 0 );
+ job->setUiDelegate( nullptr );
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
qApp->exec();
return m_ok;
@@ -297,7 +297,7 @@ bool ClientApp::doIt(const QCommandLineParser& parser)
{
checkArgumentCount(argc, 2, 2); // openProperties <url>
QUrl url = makeURL(parser.positionalArguments().last());
- KPropertiesDialog * p = new KPropertiesDialog(url, 0 /*no parent*/ );
+ KPropertiesDialog * p = new KPropertiesDialog(url, nullptr /*no parent*/ );
QObject::connect( p, SIGNAL( destroyed() ), qApp, SLOT( quit() ));
QObject::connect( p, SIGNAL( canceled() ), this, SLOT( slotDialogCanceled() \
)); p->show();
@@ -312,7 +312,7 @@ bool ClientApp::doIt(const QCommandLineParser& parser)
QUrl url = makeURL(parser.positionalArguments().last());
KIO::TransferJob* job = KIO::get(url, KIO::NoReload, s_jobFlags);
if ( !s_interactive )
- job->setUiDelegate( 0 );
+ job->setUiDelegate( nullptr );
connect(job, SIGNAL(data(KIO::Job*,QByteArray) ), this, \
SLOT(slotPrintData(KIO::Job*,QByteArray)));
connect(job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) \
); qApp->exec();
@@ -336,13 +336,13 @@ bool ClientApp::doIt(const QCommandLineParser& parser)
if (srcLst.isEmpty())
return m_ok;
- QUrl dsturl = QFileDialog::getSaveFileUrl(0, i18n("Destination where to \
download the files"), (!srcLst.isEmpty()) ? QUrl() : srcLst.first() ); + QUrl \
dsturl = QFileDialog::getSaveFileUrl(nullptr, i18n("Destination where to download the \
files"), (!srcLst.isEmpty()) ? QUrl() : srcLst.first() );
if (dsturl.isEmpty()) // canceled
return m_ok; // AK - really okay?
KIO::Job * job = KIO::copy( srcLst, dsturl, s_jobFlags );
if ( !s_interactive )
- job->setUiDelegate( 0 );
+ job->setUiDelegate( nullptr );
connect( job, SIGNAL( result( KJob * ) ), qApp, SLOT( slotResult( KJob * ) ) \
); qApp->exec();
return m_ok;
diff --git a/kstart/kstart.cpp b/kstart/kstart.cpp
index 0075db4..5b37e8a 100644
--- a/kstart/kstart.cpp
+++ b/kstart/kstart.cpp
@@ -52,7 +52,7 @@
// some globals
-static KProcess* proc = 0;
+static KProcess* proc = nullptr;
static QString exe;
static QString url;
static QString windowtitle;
@@ -61,8 +61,8 @@ static int desktop = 0;
static bool activate = false;
static bool iconify = false;
static bool fullscreen = false;
-static NET::States state = 0;
-static NET::States mask = 0;
+static NET::States state = {};
+static NET::States mask = {};
static NET::WindowType windowtype = NET::Unknown;
KStart::KStart()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic