Commit 64f02d16 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use nullptr

parent 33658d84
......@@ -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")) {
......
......@@ -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:
......
......@@ -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)
......
......@@ -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)));
......
......@@ -32,7 +32,7 @@ class FileGroupDetails : public QWidget
{
Q_OBJECT
public:
FileGroupDetails(QWidget *parent = 0);
FileGroupDetails(QWidget *parent = nullptr);
void setMimeTypeData( MimeTypeData * mimeTypeData );
......
......@@ -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);
......
......@@ -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
......
......@@ -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)
......
......@@ -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";
......
......@@ -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();
......
......@@ -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 );
......
......@@ -38,7 +38,7 @@ public:
*/
explicit KServiceSelectDlg( const QString& serviceType,
const QString& value = QString(),
QWidget *parent = 0L );
QWidget *parent = nullptr );
~KServiceSelectDlg() override;
......
......@@ -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;
......
......@@ -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()
......
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