Commit c6948476 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to nullptr

parent e5a17d20
......@@ -121,7 +121,7 @@ void CreateNewNoteJob::slotFetchCollection(KJob *job)
{
if (job->error()) {
qCDebug(NOTESHARED_LOG) << " Error during fetch: " << job->errorString();
if (KMessageBox::Yes == KMessageBox::warningYesNo(0, i18n("An error occurred during fetching. Do you want select a new default collection?"))) {
if (KMessageBox::Yes == KMessageBox::warningYesNo(nullptr, i18n("An error occurred during fetching. Do you want select a new default collection?"))) {
Q_EMIT selectNewCollection();
} else {
deleteLater();
......@@ -131,7 +131,7 @@ void CreateNewNoteJob::slotFetchCollection(KJob *job)
Akonadi::CollectionFetchJob *fetchCollection = qobject_cast<Akonadi::CollectionFetchJob *>(job);
if (fetchCollection->collections().isEmpty()) {
qCDebug(NOTESHARED_LOG) << "No collection fetched";
if (KMessageBox::Yes == KMessageBox::warningYesNo(0, i18n("An error occurred during fetching. Do you want select a new default collection?"))) {
if (KMessageBox::Yes == KMessageBox::warningYesNo(nullptr, i18n("An error occurred during fetching. Do you want select a new default collection?"))) {
Q_EMIT selectNewCollection();
} else {
deleteLater();
......@@ -141,7 +141,7 @@ void CreateNewNoteJob::slotFetchCollection(KJob *job)
Akonadi::Collection col = fetchCollection->collections().at(0);
if (col.isValid()) {
if (!col.hasAttribute<NoteShared::ShowFolderNotesAttribute>()) {
if (KMessageBox::Yes == KMessageBox::warningYesNo(0, i18n("Collection is hidden. New note will stored but not displaying. Do you want to show collection?"))) {
if (KMessageBox::Yes == KMessageBox::warningYesNo(nullptr, i18n("Collection is hidden. New note will stored but not displaying. Do you want to show collection?"))) {
col.addAttribute(new NoteShared::ShowFolderNotesAttribute());
Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob(col);
connect(job, &Akonadi::CollectionModifyJob::result, this, &CreateNewNoteJob::slotCollectionModifyFinished);
......
......@@ -92,7 +92,7 @@ void NotesNetworkSender::slotWritten(qint64)
void NotesNetworkSender::slotError()
{
KMessageBox::sorry(0, i18n("Communication error: %1",
KMessageBox::sorry(nullptr, i18n("Communication error: %1",
m_socket->errorString()));
slotClosed();
}
......
......@@ -25,7 +25,7 @@
Application::Application(int &argc, char **argv[])
: KontactInterface::PimUniqueApplication(argc, argv),
mMainWindow(0)
mMainWindow(nullptr)
{
}
......
......@@ -196,7 +196,7 @@ KNotesApp::KNotesApp()
Akonadi::Session *session = new Akonadi::Session("KNotes Session", this);
mNoteRecorder = new NoteShared::NotesChangeRecorder(this);
mNoteRecorder->changeRecorder()->setSession(session);
mTray = new KNotesAkonadiTray(0);
mTray = new KNotesAkonadiTray(nullptr);
connect(mTray, &KStatusNotifierItem::activateRequested, this, &KNotesApp::slotActivateRequested);
connect(mTray, &KStatusNotifierItem::secondaryActivateRequested, this, &KNotesApp::slotSecondaryActivateRequested);
......@@ -224,7 +224,7 @@ KNotesApp::~KNotesApp()
qDeleteAll(mNotes);
mNotes.clear();
delete m_publisher;
m_publisher = 0;
m_publisher = nullptr;
}
void KNotesApp::slotDeleteSelectedNotes()
......@@ -407,7 +407,7 @@ void KNotesApp::newNoteFromTextFile()
void KNotesApp::updateNetworkListener()
{
delete m_publisher;
m_publisher = 0;
m_publisher = nullptr;
if (NoteShared::NoteSharedGlobalConfig::receiveNotes()) {
// create the socket and start listening for connections
......@@ -582,7 +582,7 @@ void KNotesApp::slotConfigureAccels()
{
QPointer<KNotesKeyDialog> keys = new KNotesKeyDialog(actionCollection(), this);
KActionCollection *actionCollection = 0;
KActionCollection *actionCollection = nullptr;
if (!mNotes.isEmpty()) {
actionCollection = mNotes.begin().value()->actionCollection();
keys->insert(actionCollection);
......
......@@ -84,7 +84,7 @@ void remove_sm_from_client_leader()
int format, status;
unsigned long nitems = 0;
unsigned long extra = 0;
unsigned char *data = 0;
unsigned char *data = nullptr;
Atom atoms[ 2 ];
char *atom_names[ 2 ] = { (char *) "WM_CLIENT_LEADER",
......
......@@ -34,12 +34,12 @@
KNoteDisplayConfigWidget::KNoteDisplayConfigWidget(bool defaults, QWidget *parent)
: QWidget(parent),
kcfg_FgColor(0),
kcfg_BgColor(0),
kcfg_ShowInTaskbar(0),
kcfg_RememberDesktop(0),
kcfg_Width(0),
kcfg_Height(0)
kcfg_FgColor(nullptr),
kcfg_BgColor(nullptr),
kcfg_ShowInTaskbar(nullptr),
kcfg_RememberDesktop(nullptr),
kcfg_Width(nullptr),
kcfg_Height(nullptr)
{
QGridLayout *layout = new QGridLayout(this);
layout->setMargin(0);
......
......@@ -47,7 +47,7 @@ static const short ICON_SIZE = 10;
KNoteEdit::KNoteEdit(KActionCollection *actions, QWidget *parent)
: KTextEdit(parent),
m_note(0),
m_note(nullptr),
m_actions(actions)
{
setAcceptDrops(true);
......
......@@ -39,7 +39,7 @@
#include <QPushButton>
KNoteEditDialog::KNoteEditDialog(bool readOnly, QWidget *parent)
: QDialog(parent), mOkButton(0)
: QDialog(parent), mOkButton(nullptr)
{
init(readOnly);
}
......
......@@ -513,9 +513,9 @@ void KNote::print(bool preview)
void KNote::slotSaveAs()
{
// TODO: where to put pdf file support? In the printer??!??!
QCheckBox *convert = 0;
QCheckBox *convert = nullptr;
if (m_editor->acceptRichText()) {
convert = new QCheckBox(0);
convert = new QCheckBox(nullptr);
convert->setText(i18n("Save note as plain text"));
}
QUrl url;
......
......@@ -41,7 +41,7 @@ void KNotesGrantleePrintTest::shouldDefaultValue()
KNoteGrantleePrint *grantleePrint = new KNoteGrantleePrint;
QVERIFY(grantleePrint);
grantleePrint->deleteLater();
grantleePrint = 0;
grantleePrint = nullptr;
}
void KNotesGrantleePrintTest::shouldReturnEmptyStringWhenNotContentAndNoNotes()
......@@ -51,7 +51,7 @@ void KNotesGrantleePrintTest::shouldReturnEmptyStringWhenNotContentAndNoNotes()
const QString result = grantleePrint->notesToHtml(lst);
QVERIFY(result.isEmpty());
grantleePrint->deleteLater();
grantleePrint = 0;
grantleePrint = nullptr;
}
void KNotesGrantleePrintTest::shouldReturnEmptyStringWhenAddContentWithoutNotes()
......@@ -62,7 +62,7 @@ void KNotesGrantleePrintTest::shouldReturnEmptyStringWhenAddContentWithoutNotes(
const QString result = grantleePrint->notesToHtml(lst);
QVERIFY(result.isEmpty());
grantleePrint->deleteLater();
grantleePrint = 0;
grantleePrint = nullptr;
}
void KNotesGrantleePrintTest::shouldDisplayNoteInfo_data()
......@@ -100,7 +100,7 @@ void KNotesGrantleePrintTest::shouldDisplayNoteInfo()
const QString html = grantleePrint->notesToHtml(lst);
QCOMPARE(html, result);
grantleePrint->deleteLater();
grantleePrint = 0;
grantleePrint = nullptr;
}
QTEST_MAIN(KNotesGrantleePrintTest)
......@@ -40,7 +40,7 @@
KNotePrinter::KNotePrinter(QObject *parent)
: QObject(parent),
mGrantleePrint(0)
mGrantleePrint(nullptr)
{
}
......@@ -64,7 +64,7 @@ void KNotePrinter::doPrintPreview(const QString &htmlText)
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setCollateCopies(true);
PimCommon::KPimPrintPreviewDialog previewdlg(&printer, 0);
PimCommon::KPimPrintPreviewDialog previewdlg(&printer, nullptr);
connect(&previewdlg, &QPrintPreviewDialog::paintRequested, this, &KNotePrinter::slotPrinterPage);
previewdlg.exec();
......@@ -141,7 +141,7 @@ void KNotePrinter::printNotes(const QList<KNotePrintObject *> &lst, const QStrin
doPrint(htmlText, dialogCaption);
}
} else {
KMessageBox::error(0, i18n("Printing theme was not found."), i18n("Printing error"));
KMessageBox::error(nullptr, i18n("Printing theme was not found."), i18n("Printing error"));
}
}
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