aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Funk <[email protected]>2017-09-08 23:25:30 +0200
committerKevin Funk <[email protected]>2017-09-15 11:08:30 +0200
commit0c076fb7e6db2e896df741db9ad3c1979b043cf3 (patch)
tree3b17318ed79ce4ac1a5f5cb349fd1c39ec428423
parentb767a96e1d58abdee193dffdb3f9bf80a2249650 (diff)
clang-tidy: use-modernize-nullptr run
-rw-r--r--addons/backtracebrowser/katebacktracebrowser.cpp6
-rw-r--r--addons/backtracebrowser/katebacktracebrowser.h8
-rw-r--r--addons/close-except-like/close_confirm_dialog.h2
-rw-r--r--addons/close-except-like/close_except_plugin.h2
-rw-r--r--addons/filebrowser/katebookmarkhandler.h2
-rw-r--r--addons/filebrowser/katefilebrowser.cpp2
-rw-r--r--addons/filebrowser/katefilebrowser.h4
-rw-r--r--addons/filebrowser/katefilebrowserconfig.cpp4
-rw-r--r--addons/filebrowser/katefilebrowserconfig.h2
-rw-r--r--addons/filebrowser/katefilebrowserplugin.cpp2
-rw-r--r--addons/filebrowser/katefilebrowserplugin.h4
-rw-r--r--addons/filetree/autotests/document_dummy.h4
-rw-r--r--addons/filetree/katefiletree.cpp4
-rw-r--r--addons/filetree/katefiletreeconfigpage.h2
-rw-r--r--addons/filetree/katefiletreemodel.cpp36
-rw-r--r--addons/filetree/katefiletreeplugin.cpp2
-rw-r--r--addons/filetree/katefiletreeplugin.h4
-rw-r--r--addons/filetree/katefiletreeproxymodel.h2
-rw-r--r--addons/gdbplugin/advanced_settings.h2
-rw-r--r--addons/gdbplugin/configview.cpp14
-rw-r--r--addons/gdbplugin/debugview.cpp4
-rw-r--r--addons/gdbplugin/ioview.h2
-rw-r--r--addons/gdbplugin/localsview.h2
-rw-r--r--addons/gdbplugin/plugin_kategdb.cpp6
-rw-r--r--addons/gdbplugin/plugin_kategdb.h2
-rw-r--r--addons/kate-ctags/ctagskinds.cpp54
-rw-r--r--addons/kate-ctags/kate_ctags_plugin.cpp6
-rw-r--r--addons/kate-ctags/kate_ctags_plugin.h6
-rw-r--r--addons/kate-ctags/kate_ctags_view.cpp6
-rw-r--r--addons/katebuild-plugin/SelectTargetView.cpp2
-rw-r--r--addons/katebuild-plugin/SelectTargetView.h2
-rw-r--r--addons/katebuild-plugin/TargetModel.cpp2
-rw-r--r--addons/katebuild-plugin/TargetModel.h2
-rw-r--r--addons/katebuild-plugin/plugin_katebuild.cpp24
-rw-r--r--addons/katebuild-plugin/plugin_katebuild.h2
-rw-r--r--addons/katebuild-plugin/targets.h2
-rw-r--r--addons/katesql/cachedsqlquerymodel.h2
-rw-r--r--addons/katesql/connectionmodel.h2
-rw-r--r--addons/katesql/connectionwizard.h10
-rw-r--r--addons/katesql/dataoutputmodel.h2
-rw-r--r--addons/katesql/dataoutputview.h2
-rw-r--r--addons/katesql/exportwizard.h4
-rw-r--r--addons/katesql/katesqlconfigpage.h2
-rw-r--r--addons/katesql/katesqlplugin.cpp2
-rw-r--r--addons/katesql/katesqlplugin.h4
-rw-r--r--addons/katesql/outputstylewidget.h2
-rw-r--r--addons/katesql/sqlmanager.cpp4
-rw-r--r--addons/katesql/sqlmanager.h2
-rw-r--r--addons/katesql/textoutputwidget.h2
-rw-r--r--addons/konsole/kateconsole.cpp8
-rw-r--r--addons/konsole/kateconsole.h8
-rw-r--r--addons/lumen/lumen.h2
-rw-r--r--addons/openheader/plugin_kateopenheader.h2
-rw-r--r--addons/project/ctags/readtags.c98
-rw-r--r--addons/project/kateprojectcompletion.cpp2
-rw-r--r--addons/project/kateprojectindex.cpp4
-rw-r--r--addons/project/kateprojectinfoviewcodeanalysis.cpp6
-rw-r--r--addons/project/kateprojectinfoviewindex.cpp2
-rw-r--r--addons/project/kateprojectinfoviewterminal.cpp4
-rw-r--r--addons/project/kateprojectplugin.cpp2
-rw-r--r--addons/project/kateprojectplugin.h4
-rw-r--r--addons/replicode/replicodeconfig.h2
-rw-r--r--addons/replicode/replicodeconfigpage.h2
-rw-r--r--addons/replicode/replicodeplugin.h4
-rw-r--r--addons/replicode/replicodesettings.cpp2
-rw-r--r--addons/replicode/replicodesettings.h2
-rw-r--r--addons/replicode/replicodeview.cpp2
-rw-r--r--addons/rustcompletion/kterustcompletion.cpp2
-rw-r--r--addons/rustcompletion/kterustcompletionplugin.cpp2
-rw-r--r--addons/rustcompletion/kterustcompletionplugin.h4
-rw-r--r--addons/search/FolderFilesList.h2
-rw-r--r--addons/search/SearchDiskFiles.h2
-rw-r--r--addons/search/plugin_search.cpp26
-rw-r--r--addons/search/plugin_search.h4
-rw-r--r--addons/search/replace_matches.cpp8
-rw-r--r--addons/search/replace_matches.h2
-rw-r--r--addons/search/search_open_files.h2
-rw-r--r--addons/sessionapplet/engine/katesessionsjob.h2
-rw-r--r--addons/snippets/editrepository.cpp2
-rw-r--r--addons/snippets/editrepository.h2
-rw-r--r--addons/snippets/editsnippet.h2
-rw-r--r--addons/snippets/katesnippetglobal.cpp4
-rw-r--r--addons/snippets/katesnippets.cpp2
-rw-r--r--addons/snippets/katesnippets.h2
-rw-r--r--addons/snippets/snippet.cpp2
-rw-r--r--addons/snippets/snippetcompletionmodel.cpp4
-rw-r--r--addons/snippets/snippetrepository.cpp2
-rw-r--r--addons/snippets/snippetstore.cpp8
-rw-r--r--addons/snippets/snippetview.cpp8
-rw-r--r--addons/snippets/snippetview.h2
-rw-r--r--addons/symbolviewer/bash_parser.cpp6
-rw-r--r--addons/symbolviewer/cpp_parser.cpp6
-rw-r--r--addons/symbolviewer/ecma_parser.cpp16
-rw-r--r--addons/symbolviewer/fortran_parser.cpp6
-rw-r--r--addons/symbolviewer/perl_parser.cpp6
-rw-r--r--addons/symbolviewer/php_parser.cpp10
-rw-r--r--addons/symbolviewer/plugin_katesymbolviewer.cpp12
-rw-r--r--addons/symbolviewer/plugin_katesymbolviewer.h6
-rw-r--r--addons/symbolviewer/python_parser.cpp6
-rw-r--r--addons/symbolviewer/ruby_parser.cpp6
-rw-r--r--addons/symbolviewer/tcl_parser.cpp6
-rw-r--r--addons/symbolviewer/xslt_parser.cpp6
-rw-r--r--addons/tabswitcher/tabswitcher.cpp2
-rw-r--r--addons/tabswitcher/tabswitcher.h2
-rw-r--r--addons/textfilter/plugin_katetextfilter.cpp2
-rw-r--r--addons/textfilter/plugin_katetextfilter.h2
-rw-r--r--addons/xmlcheck/plugin_katexmlcheck.cpp10
-rw-r--r--addons/xmlcheck/plugin_katexmlcheck.h2
-rw-r--r--addons/xmltools/plugin_katexmltools.cpp10
-rw-r--r--addons/xmltools/plugin_katexmltools.h2
-rw-r--r--addons/xmltools/pseudo_dtd.cpp4
-rw-r--r--kate/kateapp.cpp14
-rw-r--r--kate/kateapp.h2
-rw-r--r--kate/kateconfigplugindialogpage.h2
-rw-r--r--kate/katedocmanager.cpp14
-rw-r--r--kate/katemainwindow.cpp28
-rw-r--r--kate/katemainwindow.h8
-rw-r--r--kate/katemdi.cpp14
-rw-r--r--kate/katemdi.h2
-rw-r--r--kate/katemwmodonhddialog.cpp16
-rw-r--r--kate/katemwmodonhddialog.h2
-rw-r--r--kate/katepluginmanager.cpp10
-rw-r--r--kate/katepluginmanager.h4
-rw-r--r--kate/katetabbar.cpp2
-rw-r--r--kate/katetabbar.h2
-rw-r--r--kate/katetabbutton.cpp14
-rw-r--r--kate/katetabbutton.h4
-rw-r--r--kate/kateviewmanager.cpp14
-rw-r--r--kate/kateviewmanager.h6
-rw-r--r--kate/kateviewspace.cpp2
-rw-r--r--kate/kateviewspace.h2
-rw-r--r--kate/main.cpp2
-rw-r--r--kate/session/katesession.cpp2
-rw-r--r--kate/session/katesession.h2
-rw-r--r--kate/session/katesessionchooser.cpp2
-rw-r--r--kate/session/katesessionmanagedialog.cpp4
-rw-r--r--kate/session/katesessionmanager.cpp12
-rw-r--r--kate/session/katesessionmanager.h2
-rw-r--r--kate/session/katesessionsaction.h2
-rw-r--r--kwrite/kwrite.cpp16
-rw-r--r--kwrite/kwrite.h2
-rw-r--r--kwrite/main.cpp4
142 files changed, 432 insertions, 432 deletions
diff --git a/addons/backtracebrowser/katebacktracebrowser.cpp b/addons/backtracebrowser/katebacktracebrowser.cpp
index d0e5a3e..9ce9dce 100644
--- a/addons/backtracebrowser/katebacktracebrowser.cpp
+++ b/addons/backtracebrowser/katebacktracebrowser.cpp
@@ -45,7 +45,7 @@
K_PLUGIN_FACTORY_WITH_JSON(KateBtBrowserFactory, "katebacktracebrowserplugin.json", registerPlugin<KateBtBrowserPlugin>();)
-KateBtBrowserPlugin *KateBtBrowserPlugin::s_self = 0L;
+KateBtBrowserPlugin *KateBtBrowserPlugin::s_self = nullptr;
static QStringList fileExtensions =
QStringList() << QStringLiteral("*.cpp") << QStringLiteral("*.cxx") <<
QStringLiteral("*.c") << QStringLiteral("*.cc") << QStringLiteral("*.h") <<
@@ -72,7 +72,7 @@ KateBtBrowserPlugin::~KateBtBrowserPlugin()
QDir().mkpath(path);
db.saveToFile(path + QStringLiteral("/backtracedatabase.db"));
- s_self = 0;
+ s_self = nullptr;
}
KateBtBrowserPlugin &KateBtBrowserPlugin::self()
@@ -120,7 +120,7 @@ KTextEditor::ConfigPage *KateBtBrowserPlugin::configPage(int number, QWidget *pa
return new KateBtConfigWidget(parent);
}
- return 0L;
+ return nullptr;
}
diff --git a/addons/backtracebrowser/katebacktracebrowser.h b/addons/backtracebrowser/katebacktracebrowser.h
index 0cf2bdf..1280990 100644
--- a/addons/backtracebrowser/katebacktracebrowser.h
+++ b/addons/backtracebrowser/katebacktracebrowser.h
@@ -41,7 +41,7 @@ class KateBtBrowserPlugin : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KateBtBrowserPlugin(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
+ explicit KateBtBrowserPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
virtual ~KateBtBrowserPlugin();
static KateBtBrowserPlugin &self();
@@ -58,7 +58,7 @@ Q_SIGNALS:
public:
int configPages() const Q_DECL_OVERRIDE;
- KTextEditor::ConfigPage *configPage(int number, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage(int number, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
//
// private data
@@ -116,7 +116,7 @@ class KateBtConfigWidget : public KTextEditor::ConfigPage, private Ui::BtConfigW
{
Q_OBJECT
public:
- explicit KateBtConfigWidget(QWidget *parent = 0);
+ explicit KateBtConfigWidget(QWidget *parent = nullptr);
virtual ~KateBtConfigWidget();
QString name() const Q_DECL_OVERRIDE;
@@ -141,7 +141,7 @@ class KateBtConfigDialog : public QDialog
{
Q_OBJECT
public:
- KateBtConfigDialog(QWidget *parent = 0);
+ KateBtConfigDialog(QWidget *parent = nullptr);
~KateBtConfigDialog();
private:
diff --git a/addons/close-except-like/close_confirm_dialog.h b/addons/close-except-like/close_confirm_dialog.h
index b38092f..6eebed7 100644
--- a/addons/close-except-like/close_confirm_dialog.h
+++ b/addons/close-except-like/close_confirm_dialog.h
@@ -51,7 +51,7 @@ class CloseConfirmDialog : public QDialog, public Ui::CloseConfirmDialog
Q_OBJECT
public:
/// Default constructor
- explicit CloseConfirmDialog(QList<KTextEditor::Document*>&, KToggleAction*, QWidget* const = 0);
+ explicit CloseConfirmDialog(QList<KTextEditor::Document*>&, KToggleAction*, QWidget* const = nullptr);
~CloseConfirmDialog();
private Q_SLOTS:
diff --git a/addons/close-except-like/close_except_plugin.h b/addons/close-except-like/close_except_plugin.h
index 452387f..9326b5c 100644
--- a/addons/close-except-like/close_except_plugin.h
+++ b/addons/close-except-like/close_except_plugin.h
@@ -119,7 +119,7 @@ class CloseExceptPlugin : public KTextEditor::Plugin, public KTextEditor::Sessio
Q_INTERFACES(KTextEditor::SessionConfigInterface)
public:
/// Default constructor
- CloseExceptPlugin(QObject* = 0, const QList<QVariant>& = QList<QVariant>());
+ CloseExceptPlugin(QObject* = nullptr, const QList<QVariant>& = QList<QVariant>());
/// Destructor
virtual ~CloseExceptPlugin() {}
/// Create a new view of this plugin for the given main window
diff --git a/addons/filebrowser/katebookmarkhandler.h b/addons/filebrowser/katebookmarkhandler.h
index 3848787..0d7a309 100644
--- a/addons/filebrowser/katebookmarkhandler.h
+++ b/addons/filebrowser/katebookmarkhandler.h
@@ -33,7 +33,7 @@ class KateBookmarkHandler : public QObject, public KBookmarkOwner
Q_OBJECT
public:
- explicit KateBookmarkHandler( KateFileBrowser *parent, QMenu *kpopupmenu = 0 );
+ explicit KateBookmarkHandler( KateFileBrowser *parent, QMenu *kpopupmenu = nullptr );
~KateBookmarkHandler();
// KBookmarkOwner interface:
diff --git a/addons/filebrowser/katefilebrowser.cpp b/addons/filebrowser/katefilebrowser.cpp
index 9155d37..75741b5 100644
--- a/addons/filebrowser/katefilebrowser.cpp
+++ b/addons/filebrowser/katefilebrowser.cpp
@@ -138,7 +138,7 @@ void KateFileBrowser::setupToolbar()
// now add all actions to the toolbar
foreach (const QString& it, actions)
{
- QAction *ac = 0;
+ QAction *ac = nullptr;
if (it.isEmpty()) continue;
if (it == QStringLiteral("bookmarks") || it == QStringLiteral("sync_dir") || it == QStringLiteral("configure"))
ac = actionCollection()->action(it);
diff --git a/addons/filebrowser/katefilebrowser.h b/addons/filebrowser/katefilebrowser.h
index 590da64..50c13d2 100644
--- a/addons/filebrowser/katefilebrowser.h
+++ b/addons/filebrowser/katefilebrowser.h
@@ -55,8 +55,8 @@ class KateFileBrowser : public QWidget
Q_OBJECT
public:
- explicit KateFileBrowser( KTextEditor::MainWindow *mainWindow = 0,
- QWidget * parent = 0);
+ explicit KateFileBrowser( KTextEditor::MainWindow *mainWindow = nullptr,
+ QWidget * parent = nullptr);
~KateFileBrowser();
void readSessionConfig (const KConfigGroup& config);
diff --git a/addons/filebrowser/katefilebrowserconfig.cpp b/addons/filebrowser/katefilebrowserconfig.cpp
index 12297f1..a6b88f7 100644
--- a/addons/filebrowser/katefilebrowserconfig.cpp
+++ b/addons/filebrowser/katefilebrowserconfig.cpp
@@ -46,7 +46,7 @@
class ActionLBItem : public QListWidgetItem
{
public:
- ActionLBItem( QListWidget *lb = 0,
+ ActionLBItem( QListWidget *lb = nullptr,
const QIcon &pm = QIcon(),
const QString &text = QString(),
const QString &str = QString() ) :
@@ -156,7 +156,7 @@ void KateFileBrowserConfigPage::init()
<< QStringLiteral("show hidden") /*<< QStringLiteral("view menu") << QStringLiteral("properties")*/
<< QStringLiteral("bookmarks") << QStringLiteral("sync_dir") << QStringLiteral("configure");
QRegExp re(QStringLiteral ("&(?=[^&])"));
- QAction *ac = 0;
+ QAction *ac = nullptr;
QListWidget *lb;
for ( QStringList::Iterator it = allActions.begin(); it != allActions.end(); ++it )
{
diff --git a/addons/filebrowser/katefilebrowserconfig.h b/addons/filebrowser/katefilebrowserconfig.h
index c9c9b64..1d153b9 100644
--- a/addons/filebrowser/katefilebrowserconfig.h
+++ b/addons/filebrowser/katefilebrowserconfig.h
@@ -33,7 +33,7 @@ class KateFileBrowserConfigPage : public KTextEditor::ConfigPage
Q_OBJECT
public:
- explicit KateFileBrowserConfigPage( QWidget* parent = 0, KateFileBrowser *kfb = 0);
+ explicit KateFileBrowserConfigPage( QWidget* parent = nullptr, KateFileBrowser *kfb = nullptr);
virtual ~KateFileBrowserConfigPage()
{}
diff --git a/addons/filebrowser/katefilebrowserplugin.cpp b/addons/filebrowser/katefilebrowserplugin.cpp
index e4efe30..df0cdcc 100644
--- a/addons/filebrowser/katefilebrowserplugin.cpp
+++ b/addons/filebrowser/katefilebrowserplugin.cpp
@@ -62,7 +62,7 @@ int KateFileBrowserPlugin::configPages() const
KTextEditor::ConfigPage *KateFileBrowserPlugin::configPage (int number, QWidget *parent)
{
if (number != 0)
- return 0;
+ return nullptr;
return new KateFileBrowserConfigPage(parent, m_views[0]->m_fileBrowser);
}
//END KateFileBrowserPlugin
diff --git a/addons/filebrowser/katefilebrowserplugin.h b/addons/filebrowser/katefilebrowserplugin.h
index 1425da5..77e8df2 100644
--- a/addons/filebrowser/katefilebrowserplugin.h
+++ b/addons/filebrowser/katefilebrowserplugin.h
@@ -37,14 +37,14 @@ class KateFileBrowserPlugin: public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KateFileBrowserPlugin( QObject* parent = 0, const QList<QVariant>& = QList<QVariant>() );
+ explicit KateFileBrowserPlugin( QObject* parent = nullptr, const QList<QVariant>& = QList<QVariant>() );
virtual ~KateFileBrowserPlugin()
{}
QObject *createView (KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
int configPages() const Q_DECL_OVERRIDE;
- KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
public Q_SLOTS:
void viewDestroyed(QObject* view);
diff --git a/addons/filetree/autotests/document_dummy.h b/addons/filetree/autotests/document_dummy.h
index 67c3cd8..db9ae11 100644
--- a/addons/filetree/autotests/document_dummy.h
+++ b/addons/filetree/autotests/document_dummy.h
@@ -41,8 +41,8 @@ class DummyDocument : public KTextEditor::Document
DummyDocument (const char *url) : DummyDocument(QString::fromLatin1(url)) {}
virtual ~DummyDocument () {}
- KTextEditor::View *createView ( QWidget *, KTextEditor::MainWindow * = nullptr ) Q_DECL_OVERRIDE { return 0; }
- virtual KTextEditor::View *activeView() const { return 0; }
+ KTextEditor::View *createView ( QWidget *, KTextEditor::MainWindow * = nullptr ) Q_DECL_OVERRIDE { return nullptr; }
+ virtual KTextEditor::View *activeView() const { return nullptr; }
QList<KTextEditor::View*> views() const Q_DECL_OVERRIDE { return m_views; }
QString documentName() const Q_DECL_OVERRIDE { return m_name; }
diff --git a/addons/filetree/katefiletree.cpp b/addons/filetree/katefiletree.cpp
index c3bcd91..a366042 100644
--- a/addons/filetree/katefiletree.cpp
+++ b/addons/filetree/katefiletree.cpp
@@ -231,7 +231,7 @@ void KateFileTree::contextMenuEvent(QContextMenuEvent *event)
m_sortByOpeningOrder->setChecked(sortRole == KateFileTreeModel::OpeningOrderRole);
KTextEditor::Document *doc = m_indexContextMenu.data(KateFileTreeModel::DocumentRole).value<KTextEditor::Document *>();
- const bool isFile = (0 != doc);
+ const bool isFile = (nullptr != doc);
QMenu menu;
menu.addAction(m_filelistReloadDocument);
@@ -292,7 +292,7 @@ void KateFileTree::slotFixOpenWithMenu()
QMimeDatabase db;
QMimeType mime = db.mimeTypeForName(doc->mimeType());
- QAction *a = 0;
+ QAction *a = nullptr;
KService::List offers = KMimeTypeTrader::self()->query(mime.name(), QLatin1String("Application"));
// for each one, insert a menu item...
for (KService::List::Iterator it = offers.begin(); it != offers.end(); ++it) {
diff --git a/addons/filetree/katefiletreeconfigpage.h b/addons/filetree/katefiletreeconfigpage.h
index d875e35..35453e6 100644
--- a/addons/filetree/katefiletreeconfigpage.h
+++ b/addons/filetree/katefiletreeconfigpage.h
@@ -33,7 +33,7 @@ class KateFileTreeConfigPage : public KTextEditor::ConfigPage
{
Q_OBJECT
public:
- explicit KateFileTreeConfigPage(QWidget *parent = 0, KateFileTreePlugin *plug = 0);
+ explicit KateFileTreeConfigPage(QWidget *parent = nullptr, KateFileTreePlugin *plug = nullptr);
~KateFileTreeConfigPage() {}
QString name() const Q_DECL_OVERRIDE;
diff --git a/addons/filetree/katefiletreemodel.cpp b/addons/filetree/katefiletreemodel.cpp
index a6afeb1..48c1765 100644
--- a/addons/filetree/katefiletreemodel.cpp
+++ b/addons/filetree/katefiletreemodel.cpp
@@ -47,7 +47,7 @@ public:
enum Flag { None = 0, Dir = 1, Modified = 2, ModifiedExternally = 4, DeletedExternally = 8, Empty = 16, ShowFullPath = 32, Host = 64 };
Q_DECLARE_FLAGS(Flags, Flag)
- ProxyItem(const QString &n, ProxyItemDir *p = 0, Flags f = ProxyItem::None);
+ ProxyItem(const QString &n, ProxyItemDir *p = nullptr, Flags f = ProxyItem::None);
~ProxyItem();
int addChild(ProxyItem *p);
@@ -125,7 +125,7 @@ QDebug operator<<(QDebug dbg, ProxyItem *item)
class ProxyItemDir : public ProxyItem
{
public:
- ProxyItemDir(QString n, ProxyItemDir *p = 0) : ProxyItem(n, p) {
+ ProxyItemDir(QString n, ProxyItemDir *p = nullptr) : ProxyItem(n, p) {
setFlag(ProxyItem::Dir);
updateDisplay();
@@ -152,7 +152,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(ProxyItem::Flags)
//BEGIN ProxyItem
ProxyItem::ProxyItem(const QString &d, ProxyItemDir *p, ProxyItem::Flags f)
- : m_path(d), m_parent(Q_NULLPTR), m_row(-1), m_flags(f), m_doc(0)
+ : m_path(d), m_parent(Q_NULLPTR), m_row(-1), m_flags(f), m_doc(nullptr)
{
updateDisplay();
@@ -218,7 +218,7 @@ void ProxyItem::remChild(ProxyItem *item)
m_children[i]->m_row = i;
}
- item->m_parent = 0;
+ item->m_parent = nullptr;
}
ProxyItemDir *ProxyItem::parent() const
@@ -364,7 +364,7 @@ void ProxyItem::updateDocumentName()
KateFileTreeModel::KateFileTreeModel(QObject *p)
: QAbstractItemModel(p)
- , m_root(new ProxyItemDir(QLatin1String("m_root"), 0))
+ , m_root(new ProxyItemDir(QLatin1String("m_root"), nullptr))
{
// setup default settings
// session init will set these all soon
@@ -450,7 +450,7 @@ void KateFileTreeModel::clearModel()
beginRemoveRows(QModelIndex(), 0, qMax(m_root->childCount() - 1, 0));
delete m_root;
- m_root = new ProxyItemDir(QLatin1String("m_root"), 0);
+ m_root = new ProxyItemDir(QLatin1String("m_root"), nullptr);
m_docmap.clear();
m_viewHistory.clear();
@@ -485,7 +485,7 @@ Qt::ItemFlags KateFileTreeModel::flags(const QModelIndex &index) const
Qt::ItemFlags flags = Qt::ItemIsEnabled;
if (!index.isValid()) {
- return 0;
+ return nullptr;
}
const ProxyItem *item = static_cast<ProxyItem *>(index.internalPointer());
@@ -646,7 +646,7 @@ QModelIndex KateFileTreeModel::parent(const QModelIndex &index) const
QModelIndex KateFileTreeModel::index(int row, int column, const QModelIndex &parent) const
{
- const ProxyItem *p = 0;
+ const ProxyItem *p = nullptr;
if (column != 0) {
return QModelIndex();
}
@@ -915,7 +915,7 @@ void KateFileTreeModel::updateBackgrounds(bool force)
void KateFileTreeModel::handleEmptyParents(ProxyItemDir *item)
{
- Q_ASSERT(item != 0);
+ Q_ASSERT(item != nullptr);
if (!item->parent()) {
return;
@@ -1029,16 +1029,16 @@ ProxyItemDir *KateFileTreeModel::findRootNode(const QString &name, const int r)
}
}
- return 0;
+ return nullptr;
}
ProxyItemDir *KateFileTreeModel::findChildNode(const ProxyItemDir *parent, const QString &name) const
{
- Q_ASSERT(parent != 0);
+ Q_ASSERT(parent != nullptr);
Q_ASSERT(!name.isEmpty());
if (!parent->childCount()) {
- return 0;
+ return nullptr;
}
foreach(ProxyItem * item, parent->children()) {
@@ -1051,13 +1051,13 @@ ProxyItemDir *KateFileTreeModel::findChildNode(const ProxyItemDir *parent, const
}
}
- return 0;
+ return nullptr;
}
void KateFileTreeModel::insertItemInto(ProxyItemDir *root, ProxyItem *item)
{
- Q_ASSERT(root != 0);
- Q_ASSERT(item != 0);
+ Q_ASSERT(root != nullptr);
+ Q_ASSERT(item != nullptr);
QString tail = item->path();
tail.remove(0, root->path().length());
@@ -1093,7 +1093,7 @@ void KateFileTreeModel::insertItemInto(ProxyItemDir *root, ProxyItem *item)
void KateFileTreeModel::handleInsert(ProxyItem *item)
{
- Q_ASSERT(item != 0);
+ Q_ASSERT(item != nullptr);
if (m_listMode || item->flag(ProxyItem::Empty)) {
beginInsertRows(QModelIndex(), m_root->childCount(), m_root->childCount());
@@ -1238,7 +1238,7 @@ void KateFileTreeModel::handleDuplicitRootDisplay(ProxyItemDir *init)
void KateFileTreeModel::handleNameChange(ProxyItem *item)
{
- Q_ASSERT(item != 0);
+ Q_ASSERT(item != nullptr);
Q_ASSERT(item->parent());
updateItemPathAndHost(item);
@@ -1300,7 +1300,7 @@ void KateFileTreeModel::updateItemPathAndHost(ProxyItem *item) const
void KateFileTreeModel::setupIcon(ProxyItem *item) const
{
- Q_ASSERT(item != 0);
+ Q_ASSERT(item != nullptr);
QString icon_name;
diff --git a/addons/filetree/katefiletreeplugin.cpp b/addons/filetree/katefiletreeplugin.cpp
index f776e04..caf9435 100644
--- a/addons/filetree/katefiletreeplugin.cpp
+++ b/addons/filetree/katefiletreeplugin.cpp
@@ -83,7 +83,7 @@ int KateFileTreePlugin::configPages() const
KTextEditor::ConfigPage *KateFileTreePlugin::configPage(int number, QWidget *parent)
{
if (number != 0) {
- return 0;
+ return nullptr;
}
KateFileTreeConfigPage *page = new KateFileTreeConfigPage(parent, this);
diff --git a/addons/filetree/katefiletreeplugin.h b/addons/filetree/katefiletreeplugin.h
index 3e2728d..4bce7c5 100644
--- a/addons/filetree/katefiletreeplugin.h
+++ b/addons/filetree/katefiletreeplugin.h
@@ -46,13 +46,13 @@ class KateFileTreePlugin: public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KateFileTreePlugin(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
+ explicit KateFileTreePlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
virtual ~KateFileTreePlugin();
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
int configPages() const Q_DECL_OVERRIDE;
- KTextEditor::ConfigPage *configPage(int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage(int number = 0, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
const KateFileTreePluginSettings &settings();
diff --git a/addons/filetree/katefiletreeproxymodel.h b/addons/filetree/katefiletreeproxymodel.h
index 6182ded..fb092fe 100644
--- a/addons/filetree/katefiletreeproxymodel.h
+++ b/addons/filetree/katefiletreeproxymodel.h
@@ -32,7 +32,7 @@ class KateFileTreeProxyModel : public QSortFilterProxyModel
Q_OBJECT
public:
- KateFileTreeProxyModel(QObject *p = 0);
+ KateFileTreeProxyModel(QObject *p = nullptr);
QModelIndex docIndex(const KTextEditor::Document *) const;
bool isDir(const QModelIndex &i) const;
void setSourceModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
diff --git a/addons/gdbplugin/advanced_settings.h b/addons/gdbplugin/advanced_settings.h
index 163a5a1..f2658ca 100644
--- a/addons/gdbplugin/advanced_settings.h
+++ b/addons/gdbplugin/advanced_settings.h
@@ -38,7 +38,7 @@ public:
CustomStartIndex
};
- AdvancedGDBSettings(QWidget *parent = 0);
+ AdvancedGDBSettings(QWidget *parent = nullptr);
~AdvancedGDBSettings();
const QStringList configs() const;
diff --git a/addons/gdbplugin/configview.cpp b/addons/gdbplugin/configview.cpp
index cb50d56..6abe744 100644
--- a/addons/gdbplugin/configview.cpp
+++ b/addons/gdbplugin/configview.cpp
@@ -105,13 +105,13 @@ ConfigView::ConfigView(QWidget* parent, KTextEditor::MainWindow* mainWin)
m_advancedSettings = new QPushButton(i18n("Advanced Settings"));
- m_checBoxLayout = 0;
+ m_checBoxLayout = nullptr;
// first false then true to make sure a layout is set
m_useBottomLayout = false;
- resizeEvent(0);
+ resizeEvent(nullptr);
m_useBottomLayout = true;
- resizeEvent(0);
+ resizeEvent(nullptr);
m_advanced = new AdvancedGDBSettings(this);
m_advanced->hide();
@@ -352,7 +352,7 @@ void ConfigView::resizeEvent(QResizeEvent *)
if (m_useBottomLayout && size().height() > size().width()) {
// Set layout for the side
delete m_checBoxLayout;
- m_checBoxLayout = 0;
+ m_checBoxLayout = nullptr;
delete layout();
QGridLayout* layout = new QGridLayout(this);
@@ -464,11 +464,11 @@ void ConfigView::slotBrowseExec()
// try current document dir
KTextEditor::View* view = m_mainWindow->activeView();
- if (view != NULL) {
+ if (view != nullptr) {
exe = view->document()->url().toLocalFile();
}
}
- m_executable->setText(QFileDialog::getOpenFileName((QWidget *)0, QString(), exe, QStringLiteral("application/x-executable")));
+ m_executable->setText(QFileDialog::getOpenFileName((QWidget *)nullptr, QString(), exe, QStringLiteral("application/x-executable")));
}
void ConfigView::slotBrowseDir()
@@ -479,7 +479,7 @@ void ConfigView::slotBrowseDir()
// try current document dir
KTextEditor::View* view = m_mainWindow->activeView();
- if (view != NULL) {
+ if (view != nullptr) {
dir = view->document()->url().toLocalFile();
}
}
diff --git a/addons/gdbplugin/debugview.cpp b/addons/gdbplugin/debugview.cpp
index a6acd3e..eebe2bc 100644
--- a/addons/gdbplugin/debugview.cpp
+++ b/addons/gdbplugin/debugview.cpp
@@ -38,7 +38,7 @@ static const QString PromptStr = QStringLiteral("(prompt)");
DebugView::DebugView(QObject* parent)
: QObject(parent),
- m_debugProcess(0),
+ m_debugProcess(nullptr),
m_state(none),
m_subState(normal),
m_debugLocationChanged(true),
@@ -146,7 +146,7 @@ void DebugView::toggleBreakpoint(QUrl const& url, int line)
void DebugView::slotError()
{
- KMessageBox::sorry(NULL, i18n("Could not start debugger process"));
+ KMessageBox::sorry(nullptr, i18n("Could not start debugger process"));
}
void DebugView::slotReadDebugStdOut()
diff --git a/addons/gdbplugin/ioview.h b/addons/gdbplugin/ioview.h
index 33340f7..685d434 100644
--- a/addons/gdbplugin/ioview.h
+++ b/addons/gdbplugin/ioview.h
@@ -34,7 +34,7 @@ class IOView : public QWidget
{
Q_OBJECT
public:
- IOView(QWidget *parent = 0);
+ IOView(QWidget *parent = nullptr);
~IOView();
const QString stdinFifo();
diff --git a/addons/gdbplugin/localsview.h b/addons/gdbplugin/localsview.h
index 34ef613..557385c 100644
--- a/addons/gdbplugin/localsview.h
+++ b/addons/gdbplugin/localsview.h
@@ -28,7 +28,7 @@ class LocalsView : public QTreeWidget
{
Q_OBJECT
public:
- LocalsView(QWidget *parent = 0);
+ LocalsView(QWidget *parent = nullptr);
~LocalsView();
public Q_SLOTS:
diff --git a/addons/gdbplugin/plugin_kategdb.cpp b/addons/gdbplugin/plugin_kategdb.cpp
index 5efcb74..2546098 100644
--- a/addons/gdbplugin/plugin_kategdb.cpp
+++ b/addons/gdbplugin/plugin_kategdb.cpp
@@ -156,7 +156,7 @@ KatePluginGDBView::KatePluginGDBView(KTextEditor::Plugin *plugin, KTextEditor::M
locStackSplitter->setOrientation(Qt::Vertical);
// config page
- m_configView = new ConfigView(NULL, mainWin);
+ m_configView = new ConfigView(nullptr, mainWin);
m_ioView = new IOView();
connect(m_configView, SIGNAL(showIO(bool)),
@@ -323,8 +323,8 @@ void KatePluginGDBView::writeSessionConfig(KConfigGroup& config)
void KatePluginGDBView::slotDebug()
{
- disconnect(m_ioView, SIGNAL(stdOutText(QString)), 0, 0);
- disconnect(m_ioView, SIGNAL(stdErrText(QString)), 0, 0);
+ disconnect(m_ioView, SIGNAL(stdOutText(QString)), nullptr, nullptr);
+ disconnect(m_ioView, SIGNAL(stdErrText(QString)), nullptr, nullptr);
if (m_configView->showIOTab()) {
connect(m_ioView, SIGNAL(stdOutText(QString)), m_ioView, SLOT(addStdOutText(QString)));
connect(m_ioView, SIGNAL(stdErrText(QString)), m_ioView, SLOT(addStdErrText(QString)));
diff --git a/addons/gdbplugin/plugin_kategdb.h b/addons/gdbplugin/plugin_kategdb.h
index 600dff2..b175f7a 100644
--- a/addons/gdbplugin/plugin_kategdb.h
+++ b/addons/gdbplugin/plugin_kategdb.h
@@ -47,7 +47,7 @@ class KatePluginGDB : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KatePluginGDB(QObject* parent = NULL, const VariantList& = VariantList());
+ explicit KatePluginGDB(QObject* parent = nullptr, const VariantList& = VariantList());
virtual ~KatePluginGDB();
QObject* createView(KTextEditor::MainWindow* mainWindow) Q_DECL_OVERRIDE;
diff --git a/addons/kate-ctags/ctagskinds.cpp b/addons/kate-ctags/ctagskinds.cpp
index 8d76592..d53fd4a 100644
--- a/addons/kate-ctags/ctagskinds.cpp
+++ b/addons/kate-ctags/ctagskinds.cpp
@@ -29,20 +29,20 @@ static CTagsKindMapping kindMappingAsm[] = {
{ 'd', I18N_NOOP2("Tag Type", "define") },
{ 'l', I18N_NOOP2("Tag Type", "label") },
{ 'm', I18N_NOOP2("Tag Type", "macro") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingAsp[] = {
{ 'f', I18N_NOOP2("Tag Type", "function") },
{ 's', I18N_NOOP2("Tag Type", "subroutine") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingAwk[] = {
{ 'f', I18N_NOOP2("Tag Type", "function") },
- { 0 , 0 }
+ { 0 , nullptr }
};
@@ -51,7 +51,7 @@ static CTagsKindMapping kindMappingBeta[] = {
{ 'p', I18N_NOOP2("Tag Type", "any pattern") },
{ 's', I18N_NOOP2("Tag Type", "slot") },
{ 'v', I18N_NOOP2("Tag Type", "pattern") },
- { 0 , 0 }
+ { 0 , nullptr }
};
@@ -69,13 +69,13 @@ static CTagsKindMapping kindMappingC[] = {
{ 'u', I18N_NOOP2("Tag Type", "union") },
{ 'v', I18N_NOOP2("Tag Type", "variable") },
{ 'x', I18N_NOOP2("Tag Type", "external variable") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingCobol[] = {
{ 'p', I18N_NOOP2("Tag Type", "paragraph") },
- { 0 , 0 }
+ { 0 , nullptr }
};
@@ -83,7 +83,7 @@ static CTagsKindMapping kindMappingEiffel[] = {
{ 'c', I18N_NOOP2("Tag Type", "class") },
{ 'f', I18N_NOOP2("Tag Type", "feature") },
{ 'l', I18N_NOOP2("Tag Type", "local entity") },
- { 0 , 0 }
+ { 0 , nullptr }
};
@@ -102,7 +102,7 @@ static CTagsKindMapping kindMappingFortran[] = {
{ 's', I18N_NOOP2("Tag Type", "subroutine") },
{ 't', I18N_NOOP2("Tag Type", "type") },
{ 'v', I18N_NOOP2("Tag Type", "variable") },
- { 0 , 0 }
+ { 0 , nullptr }
};
@@ -112,52 +112,52 @@ static CTagsKindMapping kindMappingJava[] = {
{ 'i', I18N_NOOP2("Tag Type", "interface") },
{ 'm', I18N_NOOP2("Tag Type", "method") },
{ 'p', I18N_NOOP2("Tag Type", "package") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingLisp[] = {
{ 'f', I18N_NOOP2("Tag Type", "function") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingMake[] = {
{ 'm', I18N_NOOP2("Tag Type", "macro") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingPascal[] = {
{ 'f', I18N_NOOP2("Tag Type", "function") },
{ 'p', I18N_NOOP2("Tag Type", "procedure") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingPerl[] = {
{ 's', I18N_NOOP2("Tag Type", "subroutine") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingPHP[] = {
{ 'c', I18N_NOOP2("Tag Type", "class") },
{ 'f', I18N_NOOP2("Tag Type", "function") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingPython[] = {
{ 'c', I18N_NOOP2("Tag Type", "class") },
{ 'f', I18N_NOOP2("Tag Type", "function") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingRexx[] = {
{ 's', I18N_NOOP2("Tag Type", "subroutine") },
- { 0 , 0 }
+ { 0 , nullptr }
};
@@ -165,39 +165,39 @@ static CTagsKindMapping kindMappingRuby[] = {
{ 'c', I18N_NOOP2("Tag Type", "class") },
{ 'f', I18N_NOOP2("Tag Type", "function") },
{ 'm', I18N_NOOP2("Tag Type", "mixin") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingScheme[] = {
{ 'f', I18N_NOOP2("Tag Type", "function") },
{ 's', I18N_NOOP2("Tag Type", "set") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingSh[] = {
{ 'f', I18N_NOOP2("Tag Type", "function") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingSlang[] = {
{ 'f', I18N_NOOP2("Tag Type", "function") },
{ 'n', I18N_NOOP2("Tag Type", "namespace") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingTcl[] = {
{ 'p', I18N_NOOP2("Tag Type", "procedure") },
- { 0 , 0 }
+ { 0 , nullptr }
};
static CTagsKindMapping kindMappingVim[] = {
{ 'f', I18N_NOOP2("Tag Type", "function") },
- { 0 , 0 }
+ { 0 , nullptr }
};
@@ -268,7 +268,7 @@ static CTagsExtensionMapping extensionMapping[] = {
{ "tcl", kindMappingTcl },
{ "wish", kindMappingTcl },
{ "vim", kindMappingVim },
- { 0 , 0 }
+ { nullptr , nullptr }
};
@@ -277,24 +277,24 @@ static CTagsKindMapping *findKindMapping(const QString &extension)
const char *pextension = extension.toLocal8Bit().constData();
CTagsExtensionMapping *pem = extensionMapping;
- while (pem->extension != 0) {
+ while (pem->extension != nullptr) {
if (strcmp(pem->extension, pextension) == 0)
return pem->kinds;
++pem;
}
- return 0;
+ return nullptr;
}
QString CTagsKinds::findKind( const char * kindChar, const QString &extension )
{
- if ( kindChar == 0 ) return QString();
+ if ( kindChar == nullptr ) return QString();
CTagsKindMapping *kindMapping = findKindMapping(extension);
if (kindMapping) {
CTagsKindMapping *pkm = kindMapping;
- while (pkm->verbose != 0) {
+ while (pkm->verbose != nullptr) {
if (pkm->abbrev == *kindChar)
return i18nc("Tag Type", pkm->verbose);
++pkm;
diff --git a/addons/kate-ctags/kate_ctags_plugin.cpp b/addons/kate-ctags/kate_ctags_plugin.cpp
index 817cf6c..8035abf 100644
--- a/addons/kate-ctags/kate_ctags_plugin.cpp
+++ b/addons/kate-ctags/kate_ctags_plugin.cpp
@@ -42,7 +42,7 @@ K_PLUGIN_FACTORY_WITH_JSON (KateCTagsPluginFactory, "katectagsplugin.json", regi
/******************************************************************/
KateCTagsPlugin::KateCTagsPlugin(QObject* parent, const QList<QVariant>&):
-KTextEditor::Plugin (parent), m_view(0)
+KTextEditor::Plugin (parent), m_view(nullptr)
{
// FIXME KF5
//KGlobal::locale()->insertCatalog("kate-ctags-plugin");
@@ -59,7 +59,7 @@ QObject *KateCTagsPlugin::createView(KTextEditor::MainWindow *mainWindow)
/******************************************************************/
KTextEditor::ConfigPage *KateCTagsPlugin::configPage (int number, QWidget *parent)
{
- if (number != 0) return 0;
+ if (number != 0) return nullptr;
return new KateCTagsConfigPage(parent, this);
}
@@ -232,7 +232,7 @@ void KateCTagsConfigPage::updateGlobalDB()
m_proc.start(command);
if(!m_proc.waitForStarted(500)) {
- KMessageBox::error(0, i18n("Failed to run \"%1\". exitStatus = %2", command, m_proc.exitStatus()));
+ KMessageBox::error(nullptr, i18n("Failed to run \"%1\". exitStatus = %2", command, m_proc.exitStatus()));
return;
}
m_confUi.updateDB->setDisabled(true);
diff --git a/addons/kate-ctags/kate_ctags_plugin.h b/addons/kate-ctags/kate_ctags_plugin.h
index 5d9b6ee..16bd3e5 100644
--- a/addons/kate-ctags/kate_ctags_plugin.h
+++ b/addons/kate-ctags/kate_ctags_plugin.h
@@ -39,13 +39,13 @@ class KateCTagsPlugin : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KateCTagsPlugin(QObject* parent = 0, const QList<QVariant> & = QList<QVariant>());
+ explicit KateCTagsPlugin(QObject* parent = nullptr, const QList<QVariant> & = QList<QVariant>());
virtual ~KateCTagsPlugin() {}
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
int configPages() const Q_DECL_OVERRIDE { return 1; };
- KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
void readConfig();
KateCTagsView *m_view;
@@ -55,7 +55,7 @@ class KateCTagsPlugin : public KTextEditor::Plugin
class KateCTagsConfigPage : public KTextEditor::ConfigPage {
Q_OBJECT
public:
- explicit KateCTagsConfigPage( QWidget* parent = 0, KateCTagsPlugin *plugin = 0 );
+ explicit KateCTagsConfigPage( QWidget* parent = nullptr, KateCTagsPlugin *plugin = nullptr );
~KateCTagsConfigPage() {}
QString name() const Q_DECL_OVERRIDE;
diff --git a/addons/kate-ctags/kate_ctags_view.cpp b/addons/kate-ctags/kate_ctags_view.cpp
index ce1fe0e..c08b2fc 100644
--- a/addons/kate-ctags/kate_ctags_view.cpp
+++ b/addons/kate-ctags/kate_ctags_view.cpp
@@ -38,7 +38,7 @@
/******************************************************************/
KateCTagsView::KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWin)
: QObject(mainWin)
-, m_proc(0)
+, m_proc(nullptr)
{
KXMLGUIClient::setComponentName (QLatin1String("katectags"), i18n ("Kate CTag"));
setXMLFile( QLatin1String("ui.rc") );
@@ -506,7 +506,7 @@ void KateCTagsView::updateSessionDB()
}
if (targets.isEmpty()) {
- KMessageBox::error(0, i18n("No folders or files to index"));
+ KMessageBox::error(nullptr, i18n("No folders or files to index"));
QFile::remove(m_ctagsUi.tagsFile->text());
return;
}
@@ -517,7 +517,7 @@ void KateCTagsView::updateSessionDB()
m_proc.start(command);
if(!m_proc.waitForStarted(500)) {
- KMessageBox::error(0, i18n("Failed to run \"%1\". exitStatus = %2", command, m_proc.exitStatus()));
+ KMessageBox::error(nullptr, i18n("Failed to run \"%1\". exitStatus = %2", command, m_proc.exitStatus()));
return;
}
QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
diff --git a/addons/katebuild-plugin/SelectTargetView.cpp b/addons/katebuild-plugin/SelectTargetView.cpp
index 0efbe8a..3422c36 100644
--- a/addons/katebuild-plugin/SelectTargetView.cpp
+++ b/addons/katebuild-plugin/SelectTargetView.cpp
@@ -61,7 +61,7 @@ public:
Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE
{
if (!index.isValid()) {
- return 0;
+ return nullptr;
}
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
diff --git a/addons/katebuild-plugin/SelectTargetView.h b/addons/katebuild-plugin/SelectTargetView.h
index fcf8492..0ca1f5b 100644
--- a/addons/katebuild-plugin/SelectTargetView.h
+++ b/addons/katebuild-plugin/SelectTargetView.h
@@ -29,7 +29,7 @@ class SelectTargetView : public QDialog, public Ui::SelectTargetUi
{
Q_OBJECT
public:
- SelectTargetView(QAbstractItemModel *model, QWidget *parent = 0);
+ SelectTargetView(QAbstractItemModel *model, QWidget *parent = nullptr);
const QModelIndex currentIndex() const;
void setCurrentIndex(const QModelIndex &index);
diff --git a/addons/katebuild-plugin/TargetModel.cpp b/addons/katebuild-plugin/TargetModel.cpp
index c5fc124..d352b26 100644
--- a/addons/katebuild-plugin/TargetModel.cpp
+++ b/addons/katebuild-plugin/TargetModel.cpp
@@ -413,7 +413,7 @@ bool TargetModel::setData(const QModelIndex &index, const QVariant &value, int r
Qt::ItemFlags TargetModel::flags(const QModelIndex &index) const
{
if (!index.isValid()) {
- return 0;
+ return nullptr;
}
if (index.internalId() != InvalidIndex && index.column() == 0) {
diff --git a/addons/katebuild-plugin/TargetModel.h b/addons/katebuild-plugin/TargetModel.h
index fce553f..b0eebfa 100644
--- a/addons/katebuild-plugin/TargetModel.h
+++ b/addons/katebuild-plugin/TargetModel.h
@@ -37,7 +37,7 @@ public:
QList<QPair<QString, QString> > commands;
};
- TargetModel(QObject *parent = 0);
+ TargetModel(QObject *parent = nullptr);
~TargetModel();
/** This function sets the default command for a target set */
diff --git a/addons/katebuild-plugin/plugin_katebuild.cpp b/addons/katebuild-plugin/plugin_katebuild.cpp
index d085d2e..0254b4e 100644
--- a/addons/katebuild-plugin/plugin_katebuild.cpp
+++ b/addons/katebuild-plugin/plugin_katebuild.cpp
@@ -81,7 +81,7 @@ QObject *KateBuildPlugin::createView (KTextEditor::MainWindow *mainWindow)
KateBuildView::KateBuildView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mw)
: QObject (mw)
, m_win(mw)
- , m_buildWidget(0)
+ , m_buildWidget(nullptr)
, m_outputWidgetWidth(0)
, m_proc(this)
, m_stdOut()
@@ -316,9 +316,9 @@ void KateBuildView::slotNext()
}
QTreeWidgetItem *item = m_buildUi.errTreeWidget->currentItem();
- if (item && item->isHidden()) item = 0;
+ if (item && item->isHidden()) item = nullptr;
- int i = (item == 0) ? -1 : m_buildUi.errTreeWidget->indexOfTopLevelItem(item);
+ int i = (item == nullptr) ? -1 : m_buildUi.errTreeWidget->indexOfTopLevelItem(item);
while (++i < itemCount) {
item = m_buildUi.errTreeWidget->topLevelItem(i);
@@ -340,9 +340,9 @@ void KateBuildView::slotPrev()
}
QTreeWidgetItem *item = m_buildUi.errTreeWidget->currentItem();
- if (item && item->isHidden()) item = 0;
+ if (item && item->isHidden()) item = nullptr;
- int i = (item == 0) ? itemCount : m_buildUi.errTreeWidget->indexOfTopLevelItem(item);
+ int i = (item == nullptr) ? itemCount : m_buildUi.errTreeWidget->indexOfTopLevelItem(item);
while (--i >= 0) {
item = m_buildUi.errTreeWidget->topLevelItem(i);
@@ -450,11 +450,11 @@ QUrl KateBuildView::docUrl()
bool KateBuildView::checkLocal(const QUrl &dir)
{
if (dir.path().isEmpty()) {
- KMessageBox::sorry(0, i18n("There is no file or directory specified for building."));
+ KMessageBox::sorry(nullptr, i18n("There is no file or directory specified for building."));
return false;
}
else if (!dir.isLocalFile()) {
- KMessageBox::sorry(0, i18n("The file \"%1\" is not a local file. "
+ KMessageBox::sorry(nullptr, i18n("The file \"%1\" is not a local file. "
"Non-local files cannot be compiled.", dir.path()));
return false;
}
@@ -500,7 +500,7 @@ bool KateBuildView::startProcess(const QString &dir, const QString &command)
m_proc.start();
if(!m_proc.waitForStarted(500)) {
- KMessageBox::error(0, i18n("Failed to run \"%1\". exitStatus = %2", command, m_proc.exitStatus()));
+ KMessageBox::error(nullptr, i18n("Failed to run \"%1\". exitStatus = %2", command, m_proc.exitStatus()));
return false;
}
@@ -569,7 +569,7 @@ void KateBuildView::slotSelectTarget() {
buildCurrentTarget();
}
delete dialog;
- dialog = 0;
+ dialog = nullptr;
}
@@ -586,7 +586,7 @@ bool KateBuildView::buildCurrentTarget()
QModelIndex ind = m_targetsUi->targetsView->currentIndex();
m_previousIndex = ind;
if (!ind.isValid()) {
- KMessageBox::sorry(0, i18n("No target available for building."));
+ KMessageBox::sorry(nullptr, i18n("No target available for building."));
return false;
}
@@ -599,7 +599,7 @@ bool KateBuildView::buildCurrentTarget()
if (workDir.isEmpty()) {
dir = docFInfo.absolutePath();
if (dir.isEmpty()) {
- KMessageBox::sorry(0, i18n("There is no local file or directory specified for building."));
+ KMessageBox::sorry(nullptr, i18n("There is no local file or directory specified for building."));
return false;
}
}
@@ -925,7 +925,7 @@ void KateBuildView::slotPluginViewDeleted (const QString &name, QObject *)
{
// remove view
if (name == QLatin1String("kateprojectplugin")) {
- m_projectPluginView = 0;
+ m_projectPluginView = nullptr;
m_targetsUi->targetsModel.deleteTargetSet(i18n("Project Plugin Targets"));
}
}
diff --git a/addons/katebuild-plugin/plugin_katebuild.h b/addons/katebuild-plugin/plugin_katebuild.h
index f5cf9e6..5d73bd5 100644
--- a/addons/katebuild-plugin/plugin_katebuild.h
+++ b/addons/katebuild-plugin/plugin_katebuild.h
@@ -172,7 +172,7 @@ class KateBuildPlugin : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KateBuildPlugin(QObject* parent = 0, const VariantList& = VariantList());
+ explicit KateBuildPlugin(QObject* parent = nullptr, const VariantList& = VariantList());
virtual ~KateBuildPlugin() {}
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
diff --git a/addons/katebuild-plugin/targets.h b/addons/katebuild-plugin/targets.h
index 75ba6f9..3c6b4d9 100644
--- a/addons/katebuild-plugin/targets.h
+++ b/addons/katebuild-plugin/targets.h
@@ -34,7 +34,7 @@ class TargetsUi: public QWidget
Q_OBJECT
public:
- TargetsUi(QObject *view, QWidget *parent = 0);
+ TargetsUi(QObject *view, QWidget *parent = nullptr);
QLabel *targetLabel;
QComboBox *targetCombo;
diff --git a/addons/katesql/cachedsqlquerymodel.h b/addons/katesql/cachedsqlquerymodel.h
index c95a8b6..95fec50 100644
--- a/addons/katesql/cachedsqlquerymodel.h
+++ b/addons/katesql/cachedsqlquerymodel.h
@@ -27,7 +27,7 @@ class CachedSqlQueryModel : public QSqlQueryModel
{
Q_OBJECT
public:
- explicit CachedSqlQueryModel(QObject *parent = 0, int cacheCapacity = 1000);
+ explicit CachedSqlQueryModel(QObject *parent = nullptr, int cacheCapacity = 1000);
QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
QSqlRecord record(int row) const;
diff --git a/addons/katesql/connectionmodel.h b/addons/katesql/connectionmodel.h
index eaaa429..8fa6298 100644
--- a/addons/katesql/connectionmodel.h
+++ b/addons/katesql/connectionmodel.h
@@ -31,7 +31,7 @@ class ConnectionModel : public QAbstractListModel
Q_OBJECT
public:
- ConnectionModel(QObject *parent = 0);
+ ConnectionModel(QObject *parent = nullptr);
virtual ~ConnectionModel();
int rowCount ( const QModelIndex & parent = QModelIndex() ) const Q_DECL_OVERRIDE;
diff --git a/addons/katesql/connectionwizard.h b/addons/katesql/connectionwizard.h
index 9d90d1b..3bf9217 100644
--- a/addons/katesql/connectionwizard.h
+++ b/addons/katesql/connectionwizard.h
@@ -42,7 +42,7 @@ class ConnectionWizard : public QWizard
Page_Save
};
- ConnectionWizard(SQLManager *manager, Connection *conn, QWidget *parent=0, Qt::WindowFlags flags = 0);
+ ConnectionWizard(SQLManager *manager, Connection *conn, QWidget *parent=nullptr, Qt::WindowFlags flags = nullptr);
~ConnectionWizard();
SQLManager *manager() { return m_manager; }
@@ -57,7 +57,7 @@ class ConnectionWizard : public QWizard
class ConnectionDriverPage : public QWizardPage
{
public:
- ConnectionDriverPage(QWidget *parent=0);
+ ConnectionDriverPage(QWidget *parent=nullptr);
void initializePage() Q_DECL_OVERRIDE;
int nextId() const Q_DECL_OVERRIDE;
@@ -68,7 +68,7 @@ class ConnectionDriverPage : public QWizardPage
class ConnectionStandardServerPage : public QWizardPage
{
public:
- ConnectionStandardServerPage(QWidget *parent=0);
+ ConnectionStandardServerPage(QWidget *parent=nullptr);
~ConnectionStandardServerPage();
void initializePage() Q_DECL_OVERRIDE;
bool validatePage() Q_DECL_OVERRIDE;
@@ -86,7 +86,7 @@ class ConnectionStandardServerPage : public QWizardPage
class ConnectionSQLiteServerPage : public QWizardPage
{
public:
- ConnectionSQLiteServerPage(QWidget *parent=0);
+ ConnectionSQLiteServerPage(QWidget *parent=nullptr);
void initializePage() Q_DECL_OVERRIDE;
bool validatePage() Q_DECL_OVERRIDE;
int nextId() const Q_DECL_OVERRIDE;
@@ -101,7 +101,7 @@ class ConnectionSQLiteServerPage : public QWizardPage
class ConnectionSavePage : public QWizardPage
{
public:
- ConnectionSavePage(QWidget *parent=0);
+ ConnectionSavePage(QWidget *parent=nullptr);
void initializePage() Q_DECL_OVERRIDE;
bool validatePage() Q_DECL_OVERRIDE;
int nextId() const Q_DECL_OVERRIDE;
diff --git a/addons/katesql/dataoutputmodel.h b/addons/katesql/dataoutputmodel.h
index 4887bde..cbcb7f6 100644
--- a/addons/katesql/dataoutputmodel.h
+++ b/addons/katesql/dataoutputmodel.h
@@ -33,7 +33,7 @@ class DataOutputModel : public CachedSqlQueryModel
Q_OBJECT
public:
- DataOutputModel(QObject *parent = 0);
+ DataOutputModel(QObject *parent = nullptr);
~DataOutputModel();
bool useSystemLocale() const;
diff --git a/addons/katesql/dataoutputview.h b/addons/katesql/dataoutputview.h
index f4e580a..42407ea 100644
--- a/addons/katesql/dataoutputview.h
+++ b/addons/katesql/dataoutputview.h
@@ -26,7 +26,7 @@ class DataOutputView : public QTableView
Q_OBJECT
public:
- DataOutputView(QWidget *parent = 0);
+ DataOutputView(QWidget *parent = nullptr);
private Q_SLOTS:
void slotCustomContextMenuRequested(const QPoint &pos);
diff --git a/addons/katesql/exportwizard.h b/addons/katesql/exportwizard.h
index 8315094..8ece665 100644
--- a/addons/katesql/exportwizard.h
+++ b/addons/katesql/exportwizard.h
@@ -39,7 +39,7 @@ class ExportWizard : public QWizard
class ExportOutputPage : public QWizardPage
{
public:
- ExportOutputPage(QWidget *parent=0);
+ ExportOutputPage(QWidget *parent=nullptr);
void initializePage() Q_DECL_OVERRIDE;
bool validatePage() Q_DECL_OVERRIDE;
@@ -54,7 +54,7 @@ class ExportOutputPage : public QWizardPage
class ExportFormatPage : public QWizardPage
{
public:
- ExportFormatPage(QWidget *parent=0);
+ ExportFormatPage(QWidget *parent=nullptr);
void initializePage() Q_DECL_OVERRIDE;
bool validatePage() Q_DECL_OVERRIDE;
diff --git a/addons/katesql/katesqlconfigpage.h b/addons/katesql/katesqlconfigpage.h
index 90349fe..194e84c 100644
--- a/addons/katesql/katesqlconfigpage.h
+++ b/addons/katesql/katesqlconfigpage.h
@@ -33,7 +33,7 @@ class KateSQLConfigPage : public KTextEditor::ConfigPage
Q_OBJECT
public:
- explicit KateSQLConfigPage( QWidget* parent = 0 );
+ explicit KateSQLConfigPage( QWidget* parent = nullptr );
virtual ~KateSQLConfigPage();
QString name() const Q_DECL_OVERRIDE;
diff --git a/addons/katesql/katesqlplugin.cpp b/addons/katesql/katesqlplugin.cpp
index 9d2e7fe..7dbfe30 100644
--- a/addons/katesql/katesqlplugin.cpp
+++ b/addons/katesql/katesqlplugin.cpp
@@ -55,7 +55,7 @@ QObject *KateSQLPlugin::createView (KTextEditor::MainWindow *mainWindow)
KTextEditor::ConfigPage* KateSQLPlugin::configPage(int number, QWidget *parent)
{
if (number != 0)
- return 0;
+ return nullptr;
KateSQLConfigPage *page = new KateSQLConfigPage(parent);
diff --git a/addons/katesql/katesqlplugin.h b/addons/katesql/katesqlplugin.h
index 34167a8..24f8b3e 100644
--- a/addons/katesql/katesqlplugin.h
+++ b/addons/katesql/katesqlplugin.h
@@ -31,14 +31,14 @@ class KateSQLPlugin : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KateSQLPlugin(QObject* parent = 0, const QList<QVariant>& = QList<QVariant>());
+ explicit KateSQLPlugin(QObject* parent = nullptr, const QList<QVariant>& = QList<QVariant>());
virtual ~KateSQLPlugin();
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
int configPages() const Q_DECL_OVERRIDE { return 1; };
- KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
QString configPageName (int number = 0) const;
QString configPageFullName (int number = 0) const;
QIcon configPageIcon (int number = 0) const;
diff --git a/addons/katesql/outputstylewidget.h b/addons/katesql/outputstylewidget.h
index c1f7ce7..14f1bd7 100644
--- a/addons/katesql/outputstylewidget.h
+++ b/addons/katesql/outputstylewidget.h
@@ -27,7 +27,7 @@ class OutputStyleWidget : public QTreeWidget
Q_OBJECT
public:
- OutputStyleWidget(QWidget *parent = 0);
+ OutputStyleWidget(QWidget *parent = nullptr);
~OutputStyleWidget();
QTreeWidgetItem* addContext(const QString &key, const QString &name);
diff --git a/addons/katesql/sqlmanager.cpp b/addons/katesql/sqlmanager.cpp
index a4dbb26..0be5709 100644
--- a/addons/katesql/sqlmanager.cpp
+++ b/addons/katesql/sqlmanager.cpp
@@ -34,7 +34,7 @@ using KWallet::Wallet;
SQLManager::SQLManager(QObject *parent)
: QObject(parent)
, m_model(new ConnectionModel(this))
-, m_wallet(0)
+, m_wallet(nullptr)
{
}
@@ -190,7 +190,7 @@ Wallet *SQLManager::openWallet()
m_wallet = Wallet::openWallet(KWallet::Wallet::NetworkWallet(), 0);
if (!m_wallet)
- return 0;
+ return nullptr;
QString folder (QLatin1String ("SQL Connections"));
diff --git a/addons/katesql/sqlmanager.h b/addons/katesql/sqlmanager.h
index 4e8b5f5..da46c31 100644
--- a/addons/katesql/sqlmanager.h
+++ b/addons/katesql/sqlmanager.h
@@ -31,7 +31,7 @@ class SQLManager : public QObject
Q_OBJECT
public:
- SQLManager(QObject *parent = 0);
+ SQLManager(QObject *parent = nullptr);
~SQLManager();
ConnectionModel *connectionModel();
diff --git a/addons/katesql/textoutputwidget.h b/addons/katesql/textoutputwidget.h
index 0d93193..7d0a088 100644
--- a/addons/katesql/textoutputwidget.h
+++ b/addons/katesql/textoutputwidget.h
@@ -30,7 +30,7 @@ class TextOutputWidget : public QWidget
Q_OBJECT
public:
- TextOutputWidget(QWidget *parent = 0);
+ TextOutputWidget(QWidget *parent = nullptr);
~TextOutputWidget();
public Q_SLOTS:
diff --git a/addons/konsole/kateconsole.cpp b/addons/konsole/kateconsole.cpp
index b0a6d5c..edd209f 100644
--- a/addons/konsole/kateconsole.cpp
+++ b/addons/konsole/kateconsole.cpp
@@ -59,7 +59,7 @@ KateKonsolePlugin::KateKonsolePlugin( QObject* parent, const QList<QVariant>& ):
m_previousEditorEnv=qgetenv("EDITOR");
if (!KAuthorized::authorize(QStringLiteral("shell_access")))
{
- KMessageBox::sorry(0, i18n ("You do not have enough karma to access a shell or terminal emulation"));
+ KMessageBox::sorry(nullptr, i18n ("You do not have enough karma to access a shell or terminal emulation"));
}
}
@@ -77,7 +77,7 @@ QObject *KateKonsolePlugin::createView (KTextEditor::MainWindow *mainWindow)
KTextEditor::ConfigPage *KateKonsolePlugin::configPage (int number, QWidget *parent)
{
if (number != 0)
- return 0;
+ return nullptr;
return new KateKonsoleConfigPage(parent, this);
}
@@ -116,7 +116,7 @@ void KateKonsolePluginView::readConfig()
KateConsole::KateConsole (KateKonsolePlugin* plugin, KTextEditor::MainWindow *mw, QWidget *parent)
: QWidget (parent)
- , m_part (0)
+ , m_part (nullptr)
, m_mw (mw)
, m_toolView (parent)
, m_plugin(plugin)
@@ -191,7 +191,7 @@ void KateConsole::loadConsoleIfNeeded()
void KateConsole::slotDestroyed ()
{
- m_part = 0;
+ m_part = nullptr;
m_currentPath.clear ();
// hide the dockwidget
diff --git a/addons/konsole/kateconsole.h b/addons/konsole/kateconsole.h
index dc8c390..4c25d80 100644
--- a/addons/konsole/kateconsole.h
+++ b/addons/konsole/kateconsole.h
@@ -47,13 +47,13 @@ class KateKonsolePlugin: public KTextEditor::Plugin
friend class KateKonsolePluginView;
public:
- explicit KateKonsolePlugin( QObject* parent = 0, const QList<QVariant>& = QList<QVariant>() );
+ explicit KateKonsolePlugin( QObject* parent = nullptr, const QList<QVariant>& = QList<QVariant>() );
virtual ~KateKonsolePlugin();
QObject *createView (KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
int configPages() const Q_DECL_OVERRIDE { return 1; }
- KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
void readConfig();
@@ -136,7 +136,7 @@ class KateConsole : public QWidget, public KXMLGUIClient
/**
* synchronize the konsole with the current document (cd to the directory)
*/
- void slotSync(KTextEditor::View *view = 0);
+ void slotSync(KTextEditor::View *view = nullptr);
/**
* When syncing is done by the user, also show the terminal if it is hidden
*/
@@ -194,7 +194,7 @@ class KateConsole : public QWidget, public KXMLGUIClient
class KateKonsoleConfigPage : public KTextEditor::ConfigPage {
Q_OBJECT
public:
- explicit KateKonsoleConfigPage( QWidget* parent = 0, KateKonsolePlugin *plugin = 0 );
+ explicit KateKonsoleConfigPage( QWidget* parent = nullptr, KateKonsolePlugin *plugin = nullptr );
virtual ~KateKonsoleConfigPage()
{}
diff --git a/addons/lumen/lumen.h b/addons/lumen/lumen.h
index bb03a4c..6cce7e2 100644
--- a/addons/lumen/lumen.h
+++ b/addons/lumen/lumen.h
@@ -74,7 +74,7 @@ class LumenPlugin: public Plugin
{
Q_OBJECT
public:
- explicit LumenPlugin(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
+ explicit LumenPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
virtual ~LumenPlugin();
DCD* dcd();
QObject *createView(MainWindow *mainWindow) Q_DECL_OVERRIDE;
diff --git a/addons/openheader/plugin_kateopenheader.h b/addons/openheader/plugin_kateopenheader.h
index 17fbb8c..991fc53 100644
--- a/addons/openheader/plugin_kateopenheader.h
+++ b/addons/openheader/plugin_kateopenheader.h
@@ -34,7 +34,7 @@ class PluginKateOpenHeader : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit PluginKateOpenHeader( QObject* parent = 0, const QList<QVariant>& = QList<QVariant>() );
+ explicit PluginKateOpenHeader( QObject* parent = nullptr, const QList<QVariant>& = QList<QVariant>() );
virtual ~PluginKateOpenHeader();
QObject *createView (KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
diff --git a/addons/project/ctags/readtags.c b/addons/project/ctags/readtags.c
index 558bd11..565a544 100644
--- a/addons/project/ctags/readtags.c
+++ b/addons/project/ctags/readtags.c
@@ -132,7 +132,7 @@ static int growString(vstring *s)
newLength = 2 * s->size;
newLine = (char *) realloc(s->buffer, newLength);
}
- if (newLine == NULL) {
+ if (newLine == nullptr) {
perror("string too large");
} else {
s->buffer = newLine;
@@ -147,13 +147,13 @@ static void copyName(tagFile *const file)
{
size_t length;
const char *end = strchr(file->line.buffer, '\t');
- if (end == NULL) {
+ if (end == nullptr) {
end = strchr(file->line.buffer, '\n');
- if (end == NULL) {
+ if (end == nullptr) {
end = strchr(file->line.buffer, '\r');
}
}
- if (end != NULL) {
+ if (end != nullptr) {
length = end - file->line.buffer;
} else {
length = strlen(file->line.buffer);
@@ -183,7 +183,7 @@ static int readTagLineRaw(tagFile *const file)
reReadLine = 0;
*pLastChar = '\0';
line = fgets(file->line.buffer, (int) file->line.size, file->fp);
- if (line == NULL) {
+ if (line == nullptr) {
/* read error */
if (! feof(file->fp)) {
perror("readTagLine");
@@ -225,7 +225,7 @@ static tagResult growFields(tagFile *const file)
unsigned short newCount = 2 * file->fields.max;
tagExtensionField *newFields = (tagExtensionField *)
realloc(file->fields.list, newCount * sizeof(tagExtensionField));
- if (newFields == NULL) {
+ if (newFields == nullptr) {
perror("too many extension fields");
} else {
file->fields.list = newFields;
@@ -239,7 +239,7 @@ static void parseExtensionFields(tagFile *const file, tagEntry *const entry,
char *const string)
{
char *p = string;
- while (p != NULL && *p != '\0') {
+ while (p != nullptr && *p != '\0') {
while (*p == TAB) {
*p++ = '\0';
}
@@ -247,11 +247,11 @@ static void parseExtensionFields(tagFile *const file, tagEntry *const entry,
char *colon;
char *field = p;
p = strchr(p, TAB);
- if (p != NULL) {
+ if (p != nullptr) {
*p++ = '\0';
}
colon = strchr(field, ':');
- if (colon == NULL) {
+ if (colon == nullptr) {
entry->kind = field;
} else {
const char *key = field;
@@ -283,18 +283,18 @@ static void parseTagLine(tagFile *file, tagEntry *const entry)
char *tab = strchr(p, TAB);
int fieldsPresent = 0;
- entry->fields.list = NULL;
+ entry->fields.list = nullptr;
entry->fields.count = 0;
- entry->kind = NULL;
+ entry->kind = nullptr;
entry->fileScope = 0;
entry->name = p;
- if (tab != NULL) {
+ if (tab != nullptr) {
*tab = '\0';
p = tab + 1;
entry->file = p;
tab = strchr(p, TAB);
- if (tab != NULL) {
+ if (tab != nullptr) {
*tab = '\0';
p = tab + 1;
if (*p == '/' || *p == '?') {
@@ -304,8 +304,8 @@ static void parseTagLine(tagFile *file, tagEntry *const entry)
entry->address.pattern = p;
do {
p = strchr(p + 1, delimiter);
- } while (p != NULL && *(p - 1) == '\\');
- if (p == NULL) {
+ } while (p != nullptr && *(p - 1) == '\\');
+ if (p == nullptr) {
/* invalid pattern */
} else {
++p;
@@ -320,7 +320,7 @@ static void parseTagLine(tagFile *file, tagEntry *const entry)
} else {
/* invalid pattern */
}
- if (p != NULL) {
+ if (p != nullptr) {
fieldsPresent = (strncmp(p, ";\"", 2) == 0);
*p = '\0';
if (fieldsPresent) {
@@ -333,18 +333,18 @@ static void parseTagLine(tagFile *file, tagEntry *const entry)
entry->fields.list = file->fields.list;
}
for (i = entry->fields.count ; i < file->fields.max ; ++i) {
- file->fields.list [i].key = NULL;
- file->fields.list [i].value = NULL;
+ file->fields.list [i].key = nullptr;
+ file->fields.list [i].value = nullptr;
}
}
static char *duplicate(const char *str)
{
- char *result = NULL;
- if (str != NULL) {
+ char *result = nullptr;
+ if (str != nullptr) {
result = (char *) malloc(strlen(str) + 1);
- if (result == NULL) {
- perror(NULL);
+ if (result == nullptr) {
+ perror(nullptr);
} else {
strcpy(result, str);
}
@@ -356,13 +356,13 @@ static void readPseudoTags(tagFile *const file, tagFileInfo *const info)
{
fpos_t startOfLine;
const size_t prefixLength = strlen(PseudoTagPrefix);
- if (info != NULL) {
+ if (info != nullptr) {
info->file.format = 1;
info->file.sort = TAG_UNSORTED;
- info->program.author = NULL;
- info->program.name = NULL;
- info->program.url = NULL;
- info->program.version = NULL;
+ info->program.author = nullptr;
+ info->program.name = nullptr;
+ info->program.url = nullptr;
+ info->program.version = nullptr;
}
while (1) {
fgetpos(file->fp, &startOfLine);
@@ -390,7 +390,7 @@ static void readPseudoTags(tagFile *const file, tagFileInfo *const info)
} else if (strcmp(key, "TAG_PROGRAM_VERSION") == 0) {
file->program.version = duplicate(value);
}
- if (info != NULL) {
+ if (info != nullptr) {
info->file.format = file->format;
info->file.sort = file->sortMethod;
info->program.author = file->program.author;
@@ -423,7 +423,7 @@ static void gotoFirstLogicalTag(tagFile *const file)
static tagFile *initialize(const char *const filePath, tagFileInfo *const info)
{
tagFile *result = (tagFile *) malloc(sizeof(tagFile));
- if (result != NULL) {
+ if (result != nullptr) {
memset(result, 0, sizeof(tagFile));
growString(&result->line);
growString(&result->name);
@@ -431,9 +431,9 @@ static tagFile *initialize(const char *const filePath, tagFileInfo *const info)
result->fields.list = (tagExtensionField *) malloc(
result->fields.max * sizeof(tagExtensionField));
result->fp = fopen(filePath, "r");
- if (result->fp == NULL) {
+ if (result->fp == nullptr) {
free(result);
- result = NULL;
+ result = nullptr;
info->status.error_number = errno;
} else {
fseek(result->fp, 0, SEEK_END);
@@ -455,16 +455,16 @@ static void terminate(tagFile *const file)
free(file->name.buffer);
free(file->fields.list);
- if (file->program.author != NULL) {
+ if (file->program.author != nullptr) {
free(file->program.author);
}
- if (file->program.name != NULL) {
+ if (file->program.name != nullptr) {
free(file->program.name);
}
- if (file->program.url != NULL) {
+ if (file->program.url != nullptr) {
free(file->program.url);
}
- if (file->program.version != NULL) {
+ if (file->program.version != nullptr) {
free(file->program.version);
}
@@ -476,12 +476,12 @@ static void terminate(tagFile *const file)
static tagResult readNext(tagFile *const file, tagEntry *const entry)
{
tagResult result = TagFailure;
- if (file == NULL || ! file->initialized) {
+ if (file == nullptr || ! file->initialized) {
result = TagFailure;
} else if (! readTagLine(file)) {
result = TagFailure;
} else {
- if (entry != NULL) {
+ if (entry != nullptr) {
parseTagLine(file, entry);
}
result = TagSuccess;
@@ -492,13 +492,13 @@ static tagResult readNext(tagFile *const file, tagEntry *const entry)
static const char *readFieldValue(
const tagEntry *const entry, const char *const key)
{
- const char *result = NULL;
+ const char *result = nullptr;
int i;
if (strcmp(key, "kind") == 0) {
result = entry->kind;
} else if (strcmp(key, "file") == 0) {
result = EmptyString;
- } else for (i = 0 ; i < entry->fields.count && result == NULL ; ++i)
+ } else for (i = 0 ; i < entry->fields.count && result == nullptr ; ++i)
if (strcmp(entry->fields.list [i].key, key) == 0) {
result = entry->fields.list [i].value;
}
@@ -646,7 +646,7 @@ static tagResult find(tagFile *const file, tagEntry *const entry,
file->search.pos = file->size;
} else {
file->search.pos = file->pos;
- if (entry != NULL) {
+ if (entry != nullptr) {
parseTagLine(file, entry);
}
}
@@ -664,7 +664,7 @@ static tagResult findNext(tagFile *const file, tagEntry *const entry)
}
} else {
result = findSequential(file);
- if (result == TagSuccess && entry != NULL) {
+ if (result == TagSuccess && entry != nullptr) {
parseTagLine(file, entry);
}
}
@@ -683,7 +683,7 @@ extern tagFile *tagsOpen(const char *const filePath, tagFileInfo *const info)
extern tagResult tagsSetSortType(tagFile *const file, const sortType type)
{
tagResult result = TagFailure;
- if (file != NULL && file->initialized) {
+ if (file != nullptr && file->initialized) {
file->sortMethod = type;
result = TagSuccess;
}
@@ -693,7 +693,7 @@ extern tagResult tagsSetSortType(tagFile *const file, const sortType type)
extern tagResult tagsFirst(tagFile *const file, tagEntry *const entry)
{
tagResult result = TagFailure;
- if (file != NULL && file->initialized) {
+ if (file != nullptr && file->initialized) {
gotoFirstLogicalTag(file);
result = readNext(file, entry);
}
@@ -703,7 +703,7 @@ extern tagResult tagsFirst(tagFile *const file, tagEntry *const entry)
extern tagResult tagsNext(tagFile *const file, tagEntry *const entry)
{
tagResult result = TagFailure;
- if (file != NULL && file->initialized) {
+ if (file != nullptr && file->initialized) {
result = readNext(file, entry);
}
return result;
@@ -711,8 +711,8 @@ extern tagResult tagsNext(tagFile *const file, tagEntry *const entry)
extern const char *tagsField(const tagEntry *const entry, const char *const key)
{
- const char *result = NULL;
- if (entry != NULL) {
+ const char *result = nullptr;
+ if (entry != nullptr) {
result = readFieldValue(entry, key);
}
return result;
@@ -722,7 +722,7 @@ extern tagResult tagsFind(tagFile *const file, tagEntry *const entry,
const char *const name, const int options)
{
tagResult result = TagFailure;
- if (file != NULL && file->initialized) {
+ if (file != nullptr && file->initialized) {
result = find(file, entry, name, options);
}
return result;
@@ -731,7 +731,7 @@ extern tagResult tagsFind(tagFile *const file, tagEntry *const entry,
extern tagResult tagsFindNext(tagFile *const file, tagEntry *const entry)
{
tagResult result = TagFailure;
- if (file != NULL && file->initialized) {
+ if (file != nullptr && file->initialized) {
result = findNext(file, entry);
}
return result;
@@ -740,7 +740,7 @@ extern tagResult tagsFindNext(tagFile *const file, tagEntry *const entry)
extern tagResult tagsClose(tagFile *const file)
{
tagResult result = TagFailure;
- if (file != NULL && file->initialized) {
+ if (file != nullptr && file->initialized) {
terminate(file);
result = TagSuccess;
}
diff --git a/addons/project/kateprojectcompletion.cpp b/addons/project/kateprojectcompletion.cpp
index dc4ce35..65d782e 100644
--- a/addons/project/kateprojectcompletion.cpp
+++ b/addons/project/kateprojectcompletion.cpp
@@ -27,7 +27,7 @@
#include <QIcon>
KateProjectCompletion::KateProjectCompletion(KateProjectPlugin *plugin)
- : KTextEditor::CodeCompletionModel(0)
+ : KTextEditor::CodeCompletionModel(nullptr)
, m_plugin(plugin)
{
}
diff --git a/addons/project/kateprojectindex.cpp b/addons/project/kateprojectindex.cpp
index cd4576b..436a8c3 100644
--- a/addons/project/kateprojectindex.cpp
+++ b/addons/project/kateprojectindex.cpp
@@ -30,7 +30,7 @@
KateProjectIndex::KateProjectIndex(const QStringList &files, const QVariantMap &ctagsMap)
: m_ctagsIndexFile(QDir::tempPath() + QStringLiteral("/kate.project.ctags"))
- , m_ctagsIndexHandle(0)
+ , m_ctagsIndexHandle(nullptr)
{
/**
* load ctags
@@ -45,7 +45,7 @@ KateProjectIndex::~KateProjectIndex()
*/
if (m_ctagsIndexHandle) {
tagsClose(m_ctagsIndexHandle);
- m_ctagsIndexHandle = 0;
+ m_ctagsIndexHandle = nullptr;
}
}
diff --git a/addons/project/kateprojectinfoviewcodeanalysis.cpp b/addons/project/kateprojectinfoviewcodeanalysis.cpp
index 2bb1a2c..a4fbf3b 100644
--- a/addons/project/kateprojectinfoviewcodeanalysis.cpp
+++ b/addons/project/kateprojectinfoviewcodeanalysis.cpp
@@ -32,11 +32,11 @@ KateProjectInfoViewCodeAnalysis::KateProjectInfoViewCodeAnalysis(KateProjectPlug
: QWidget()
, m_pluginView(pluginView)
, m_project(project)
- , m_messageWidget(0)
+ , m_messageWidget(nullptr)
, m_startStopAnalysis(new QPushButton(i18n("Start Analysis...")))
, m_treeView(new QTreeView())
, m_model(new QStandardItemModel(m_treeView))
- , m_analyzer(0)
+ , m_analyzer(nullptr)
{
/**
* default style
@@ -110,7 +110,7 @@ void KateProjectInfoViewCodeAnalysis::slotStartStopClicked()
if (m_messageWidget) {
delete m_messageWidget;
- m_messageWidget = 0;
+ m_messageWidget = nullptr;
}
if (!m_analyzer->waitForStarted()) {
diff --git a/addons/project/kateprojectinfoviewindex.cpp b/addons/project/kateprojectinfoviewindex.cpp
index d0d1ad5..7b38bf8 100644
--- a/addons/project/kateprojectinfoviewindex.cpp
+++ b/addons/project/kateprojectinfoviewindex.cpp
@@ -29,7 +29,7 @@ KateProjectInfoViewIndex::KateProjectInfoViewIndex(KateProjectPluginView *plugin
: QWidget()
, m_pluginView(pluginView)
, m_project(project)
- , m_messageWidget(0)
+ , m_messageWidget(nullptr)
, m_lineEdit(new QLineEdit())
, m_treeView(new QTreeView())
, m_model(new QStandardItemModel(m_treeView))
diff --git a/addons/project/kateprojectinfoviewterminal.cpp b/addons/project/kateprojectinfoviewterminal.cpp
index d9d4a10..b2e1ff9 100644
--- a/addons/project/kateprojectinfoviewterminal.cpp
+++ b/addons/project/kateprojectinfoviewterminal.cpp
@@ -30,7 +30,7 @@ KateProjectInfoViewTerminal::KateProjectInfoViewTerminal(KateProjectPluginView *
: QWidget()
, m_pluginView(pluginView)
, m_project(project)
- , m_konsolePart(0)
+ , m_konsolePart(nullptr)
{
/**
* layout widget
@@ -60,7 +60,7 @@ void KateProjectInfoViewTerminal::loadTerminal()
/**
* null in any case, if loadTerminal fails below and we are in the destroyed event
*/
- m_konsolePart = 0;
+ m_konsolePart = nullptr;
/**
* get konsole part factory
diff --git a/addons/project/kateprojectplugin.cpp b/addons/project/kateprojectplugin.cpp
index c523f3a..7a879ef 100644
--- a/addons/project/kateprojectplugin.cpp
+++ b/addons/project/kateprojectplugin.cpp
@@ -183,7 +183,7 @@ KateProject *KateProjectPlugin::projectForDir(QDir dir)
}
}
- return 0;
+ return nullptr;
}
KateProject *KateProjectPlugin::projectForUrl(const QUrl &url)
diff --git a/addons/project/kateprojectplugin.h b/addons/project/kateprojectplugin.h
index 33c2ea4..aa7c704 100644
--- a/addons/project/kateprojectplugin.h
+++ b/addons/project/kateprojectplugin.h
@@ -42,13 +42,13 @@ class KateProjectPlugin : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KateProjectPlugin(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
+ explicit KateProjectPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
virtual ~KateProjectPlugin();
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
int configPages() const Q_DECL_OVERRIDE;
- KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
/**
* Create new project for given project filename.
diff --git a/addons/replicode/replicodeconfig.h b/addons/replicode/replicodeconfig.h
index fb06146..999e55a 100644
--- a/addons/replicode/replicodeconfig.h
+++ b/addons/replicode/replicodeconfig.h
@@ -29,7 +29,7 @@ class ReplicodeConfig : public QTabWidget
{
Q_OBJECT
public:
- explicit ReplicodeConfig(QWidget *parent = 0);
+ explicit ReplicodeConfig(QWidget *parent = nullptr);
virtual ~ReplicodeConfig();
public Q_SLOTS:
diff --git a/addons/replicode/replicodeconfigpage.h b/addons/replicode/replicodeconfigpage.h
index 5d714d8..2d9d570 100644
--- a/addons/replicode/replicodeconfigpage.h
+++ b/addons/replicode/replicodeconfigpage.h
@@ -28,7 +28,7 @@ class ReplicodeConfigPage : public KTextEditor::ConfigPage
Q_OBJECT
public:
- ReplicodeConfigPage(QWidget *parent = 0);
+ ReplicodeConfigPage(QWidget *parent = nullptr);
QString name() const Q_DECL_OVERRIDE;
QString fullName() const Q_DECL_OVERRIDE;
diff --git a/addons/replicode/replicodeplugin.h b/addons/replicode/replicodeplugin.h
index a9b5622..986818a 100644
--- a/addons/replicode/replicodeplugin.h
+++ b/addons/replicode/replicodeplugin.h
@@ -29,7 +29,7 @@ class ReplicodePlugin : public KTextEditor::Plugin
public:
// Constructor
- explicit ReplicodePlugin(QObject *parent = 0, const QList<QVariant> &args = QList<QVariant>());
+ explicit ReplicodePlugin(QObject *parent = nullptr, const QList<QVariant> &args = QList<QVariant>());
// Destructor
virtual ~ReplicodePlugin();
@@ -39,7 +39,7 @@ class ReplicodePlugin : public KTextEditor::Plugin
// Config interface
int configPages () const Q_DECL_OVERRIDE { return 1; }
- KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
};
#endif
diff --git a/addons/replicode/replicodesettings.cpp b/addons/replicode/replicodesettings.cpp
index 148c42c..f575530 100644
--- a/addons/replicode/replicodesettings.cpp
+++ b/addons/replicode/replicodesettings.cpp
@@ -62,7 +62,7 @@ void ReplicodeSettings::load()
settings.beginGroup(QStringLiteral("Debug"));
debug = settings.value(QStringLiteral("Debug"), true).toBool();
debugWindows = settings.value(QStringLiteral("Debug Windows"), 1).toInt();
- traceLevels = settings.value(QStringLiteral("Trace Levels"), QStringLiteral("CC")).toString().toInt(0, 16);
+ traceLevels = settings.value(QStringLiteral("Trace Levels"), QStringLiteral("CC")).toString().toInt(nullptr, 16);
settings.endGroup();
settings.beginGroup(QStringLiteral("Resilience"));
diff --git a/addons/replicode/replicodesettings.h b/addons/replicode/replicodesettings.h
index 537d49c..c7ce2fe 100644
--- a/addons/replicode/replicodesettings.h
+++ b/addons/replicode/replicodesettings.h
@@ -28,7 +28,7 @@ class ReplicodeSettings : public QObject
{
Q_OBJECT
public:
- explicit ReplicodeSettings(QObject *parent = 0);
+ explicit ReplicodeSettings(QObject *parent = nullptr);
void load();
void save();
void setDefaults();
diff --git a/addons/replicode/replicodeview.cpp b/addons/replicode/replicodeview.cpp
index 7d07844..68b4a66 100644
--- a/addons/replicode/replicodeview.cpp
+++ b/addons/replicode/replicodeview.cpp
@@ -32,7 +32,7 @@
ReplicodeView::ReplicodeView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow* mainWindow) :
QObject(mainWindow),
m_mainWindow(mainWindow),
- m_executor(0)
+ m_executor(nullptr)
{
m_runAction = new QAction(QIcon(QStringLiteral("code-block")), i18n("Run replicode"), this);
actionCollection()->setDefaultShortcut(m_runAction, Qt::Key_F8);
diff --git a/addons/rustcompletion/kterustcompletion.cpp b/addons/rustcompletion/kterustcompletion.cpp
index 451cf95..ff6af85 100644
--- a/addons/rustcompletion/kterustcompletion.cpp
+++ b/addons/rustcompletion/kterustcompletion.cpp
@@ -31,7 +31,7 @@
#include <KTextEditor/View>
KTERustCompletion::KTERustCompletion(KTERustCompletionPlugin *plugin)
- : KTextEditor::CodeCompletionModel(0)
+ : KTextEditor::CodeCompletionModel(nullptr)
, m_plugin(plugin)
{
}
diff --git a/addons/rustcompletion/kterustcompletionplugin.cpp b/addons/rustcompletion/kterustcompletionplugin.cpp
index d196bdf..32eef5a 100644
--- a/addons/rustcompletion/kterustcompletionplugin.cpp
+++ b/addons/rustcompletion/kterustcompletionplugin.cpp
@@ -33,7 +33,7 @@ K_PLUGIN_FACTORY_WITH_JSON(KTERustCompletionPluginFactory, "kterustcompletionplu
KTERustCompletionPlugin::KTERustCompletionPlugin(QObject *parent, const QList<QVariant> &)
: KTextEditor::Plugin(parent),
m_completion(this),
- m_rustSrcWatch(0),
+ m_rustSrcWatch(nullptr),
m_configOk(false)
{
readConfig();
diff --git a/addons/rustcompletion/kterustcompletionplugin.h b/addons/rustcompletion/kterustcompletionplugin.h
index 8da86ff..ffc7c63 100644
--- a/addons/rustcompletion/kterustcompletionplugin.h
+++ b/addons/rustcompletion/kterustcompletionplugin.h
@@ -34,13 +34,13 @@ class KTERustCompletionPlugin : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KTERustCompletionPlugin(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
+ explicit KTERustCompletionPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
virtual ~KTERustCompletionPlugin();
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
int configPages() const Q_DECL_OVERRIDE;
- KTextEditor::ConfigPage *configPage(int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage(int number = 0, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
KTERustCompletion *completion();
diff --git a/addons/search/FolderFilesList.h b/addons/search/FolderFilesList.h
index 6f04766..2e5f339 100644
--- a/addons/search/FolderFilesList.h
+++ b/addons/search/FolderFilesList.h
@@ -33,7 +33,7 @@ class FolderFilesList: public QThread
Q_OBJECT
public:
- FolderFilesList(QObject *parent = 0);
+ FolderFilesList(QObject *parent = nullptr);
~FolderFilesList();
void run() Q_DECL_OVERRIDE;
diff --git a/addons/search/SearchDiskFiles.h b/addons/search/SearchDiskFiles.h
index 8694669..04a0986 100644
--- a/addons/search/SearchDiskFiles.h
+++ b/addons/search/SearchDiskFiles.h
@@ -34,7 +34,7 @@ class SearchDiskFiles: public QThread
Q_OBJECT
public:
- SearchDiskFiles(QObject *parent = 0);
+ SearchDiskFiles(QObject *parent = nullptr);
~SearchDiskFiles();
void startSearch(const QStringList &iles,
diff --git a/addons/search/plugin_search.cpp b/addons/search/plugin_search.cpp
index 707baed..6f6cfdf 100644
--- a/addons/search/plugin_search.cpp
+++ b/addons/search/plugin_search.cpp
@@ -76,7 +76,7 @@ static QAction *menuEntry(QMenu *menu,
if (menuAfter.isEmpty()) menuAfter = after;
QAction *const action = menu->addAction(menuBefore + menuAfter + QLatin1Char('\t') + desc);
- if (!action) return 0;
+ if (!action) return nullptr;
action->setData(QString(before + QLatin1Char(' ') + after));
return action;
@@ -122,7 +122,7 @@ K_PLUGIN_FACTORY_WITH_JSON (KatePluginSearchFactory, "katesearch.json", register
KatePluginSearch::KatePluginSearch(QObject* parent, const QList<QVariant>&)
: KTextEditor::Plugin (parent),
- m_searchCommand(0)
+ m_searchCommand(nullptr)
{
m_searchCommand = new KateSearchCommand(this);
}
@@ -217,12 +217,12 @@ void KatePluginSearchView::nextFocus(QWidget *currentWidget, bool *found, bool n
KatePluginSearchView::KatePluginSearchView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWin, KTextEditor::Application* application)
: QObject (mainWin),
m_kateApp(application),
-m_curResults(0),
+m_curResults(nullptr),
m_searchJustOpened(false),
m_switchToProjectModeWhenAvailable(false),
m_searchDiskFilesDone(true),
m_searchOpenFilesDone(true),
-m_projectPluginView(0),
+m_projectPluginView(nullptr),
m_mainWindow (mainWin)
{
KXMLGUIClient::setComponentName (QStringLiteral("katesearch"), i18n ("Kate Search & Replace"));
@@ -657,7 +657,7 @@ void KatePluginSearchView::addHeaderItem()
QTreeWidgetItem * KatePluginSearchView::rootFileItem(const QString &url, const QString &fName)
{
if (!m_curResults) {
- return 0;
+ return nullptr;
}
QUrl fullUrl = QUrl::fromUserInput(url);
@@ -716,7 +716,7 @@ void KatePluginSearchView::addMatchMark(KTextEditor::Document* doc, int line, in
KTextEditor::ConfigInterface* ciface = qobject_cast<KTextEditor::ConfigInterface*>(activeView);
KTextEditor::Attribute::Ptr attr(new KTextEditor::Attribute());
- bool replace = ((sender() == &m_replacer) || (sender() == 0) || (sender() == m_ui.replaceButton));
+ bool replace = ((sender() == &m_replacer) || (sender() == nullptr) || (sender() == m_ui.replaceButton));
if (replace) {
QColor replaceColor(Qt::green);
if (ciface) replaceColor = ciface->configValue(QStringLiteral("replace-highlight-color")).value<QColor>();
@@ -1223,7 +1223,7 @@ void KatePluginSearchView::searchDone()
}
indicateMatch(m_curResults->matches > 0);
- m_curResults = 0;
+ m_curResults = nullptr;
m_toolView->unsetCursor();
if (fw == m_ui.stopButton) {
@@ -1251,7 +1251,7 @@ void KatePluginSearchView::searchWhileTypingDone()
m_curResults->tree->setColumnWidth(0, m_curResults->tree->width()-30);
}
- QWidget *focusObject = 0;
+ QWidget *focusObject = nullptr;
QTreeWidgetItem *root = m_curResults->tree->topLevelItem(0);
if (root) {
QTreeWidgetItem *child = root->child(0);
@@ -1264,7 +1264,7 @@ void KatePluginSearchView::searchWhileTypingDone()
"<b><i>%1 matches found</i></b>",
m_curResults->matches));
}
- m_curResults = 0;
+ m_curResults = nullptr;
if (focusObject) {
focusObject->setFocus();
@@ -1521,7 +1521,7 @@ void KatePluginSearchView::docViewChanged()
// add the marks if it is not already open
KTextEditor::Document *doc = m_mainWindow->activeView()->document();
if (doc) {
- QTreeWidgetItem *rootItem = 0;
+ QTreeWidgetItem *rootItem = nullptr;
for (int i=0; i<res->tree->topLevelItemCount(); i++) {
QString url = res->tree->topLevelItem(i)->data(0, ReplaceMatches::FileUrlRole).toString();
QString fName = res->tree->topLevelItem(i)->data(0, ReplaceMatches::FileNameRole).toString();
@@ -1583,7 +1583,7 @@ void KatePluginSearchView::itemSelected(QTreeWidgetItem *item)
int line;
int column;
int len;
- QTreeWidgetItem *rootItem = (item->parent()==0) ? item : item->parent();
+ QTreeWidgetItem *rootItem = (item->parent()==nullptr) ? item : item->parent();
for (int i=0; i<rootItem->childCount(); i++) {
item = rootItem->child(i);
line = item->data(0, ReplaceMatches::LineRole).toInt();
@@ -1925,7 +1925,7 @@ void KatePluginSearchView::tabCloseRequested(int index)
}
if (m_ui.resultTabWidget->count() > 1) {
delete tmp; // remove the tab
- m_curResults = 0;
+ m_curResults = nullptr;
}
if (m_ui.resultTabWidget->count() == 1) {
m_ui.resultTabWidget->tabBar()->hide();
@@ -2058,7 +2058,7 @@ void KatePluginSearchView::slotPluginViewDeleted (const QString &name, QObject *
{
// remove view
if (name == QStringLiteral("kateprojectplugin")) {
- m_projectPluginView = 0;
+ m_projectPluginView = nullptr;
slotProjectFileNameChanged ();
}
}
diff --git a/addons/search/plugin_search.h b/addons/search/plugin_search.h
index 1b82086..7001155 100644
--- a/addons/search/plugin_search.h
+++ b/addons/search/plugin_search.h
@@ -51,7 +51,7 @@ class Results: public QWidget, public Ui::Results
{
Q_OBJECT
public:
- Results(QWidget *parent = 0);
+ Results(QWidget *parent = nullptr);
int matches;
QRegularExpression regExp;
bool useRegExp;
@@ -81,7 +81,7 @@ class KatePluginSearch : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit KatePluginSearch(QObject* parent = 0, const QList<QVariant>& = QList<QVariant>());
+ explicit KatePluginSearch(QObject* parent = nullptr, const QList<QVariant>& = QList<QVariant>());
virtual ~KatePluginSearch();
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
diff --git a/addons/search/replace_matches.cpp b/addons/search/replace_matches.cpp
index 30e6a7c..94e42b4 100644
--- a/addons/search/replace_matches.cpp
+++ b/addons/search/replace_matches.cpp
@@ -27,8 +27,8 @@
#include <klocalizedstring.h>
ReplaceMatches::ReplaceMatches(QObject *parent) : QObject(parent),
-m_manager(0),
-m_tree(0),
+m_manager(nullptr),
+m_tree(nullptr),
m_rootIndex(-1)
{
connect(this, SIGNAL(replaceNextMatch()), this, SLOT(doReplaceNextMatch()), Qt::QueuedConnection);
@@ -36,7 +36,7 @@ m_rootIndex(-1)
void ReplaceMatches::replaceChecked(QTreeWidget *tree, const QRegularExpression &regexp, const QString &replace)
{
- if (m_manager == 0) return;
+ if (m_manager == nullptr) return;
if (m_rootIndex != -1) return;
m_tree = tree;
@@ -67,7 +67,7 @@ KTextEditor::Document *ReplaceMatches::findNamed(const QString &name)
return it;
}
}
- return 0;
+ return nullptr;
}
diff --git a/addons/search/replace_matches.h b/addons/search/replace_matches.h
index 5449070..7364373 100644
--- a/addons/search/replace_matches.h
+++ b/addons/search/replace_matches.h
@@ -44,7 +44,7 @@ public:
PostMatchRole
};
- ReplaceMatches(QObject *parent = 0);
+ ReplaceMatches(QObject *parent = nullptr);
void setDocumentManager(KTextEditor::Application *manager);
void replaceChecked(QTreeWidget *tree, const QRegularExpression &regexp, const QString &replace);
diff --git a/addons/search/search_open_files.h b/addons/search/search_open_files.h
index 541a1bc..01267d1 100644
--- a/addons/search/search_open_files.h
+++ b/addons/search/search_open_files.h
@@ -31,7 +31,7 @@ class SearchOpenFiles: public QObject
Q_OBJECT
public:
- SearchOpenFiles(QObject *parent = 0);
+ SearchOpenFiles(QObject *parent = nullptr);
void startSearch(const QList<KTextEditor::Document*> &list,const QRegularExpression &regexp);
bool searching();
diff --git a/addons/sessionapplet/engine/katesessionsjob.h b/addons/sessionapplet/engine/katesessionsjob.h
index 2116e0c..a2c3df2 100644
--- a/addons/sessionapplet/engine/katesessionsjob.h
+++ b/addons/sessionapplet/engine/katesessionsjob.h
@@ -29,7 +29,7 @@ class KateSessionsJob : public Plasma::ServiceJob
{
Q_OBJECT
public:
- KateSessionsJob(KateSessionsEngine* engine,const QString &destination, const QString &operation, const QVariantMap &parameters, QObject *parent=0);
+ KateSessionsJob(KateSessionsEngine* engine,const QString &destination, const QString &operation, const QVariantMap &parameters, QObject *parent=nullptr);
~KateSessionsJob() = default;
void start() override;
diff --git a/addons/snippets/editrepository.cpp b/addons/snippets/editrepository.cpp
index 0c9b48a..8517e75 100644
--- a/addons/snippets/editrepository.cpp
+++ b/addons/snippets/editrepository.cpp
@@ -53,7 +53,7 @@ EditRepository::EditRepository(SnippetRepository* repository, QWidget* parent)
connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
// fill list of available modes
- QSharedPointer<KTextEditor::Document> document(KTextEditor::Editor::instance()->createDocument(0));
+ QSharedPointer<KTextEditor::Document> document(KTextEditor::Editor::instance()->createDocument(nullptr));
repoFileTypesList->addItems(document->highlightingModes());
repoFileTypesList->sortItems();
repoFileTypesList->setSelectionMode(QAbstractItemView::ExtendedSelection);
diff --git a/addons/snippets/editrepository.h b/addons/snippets/editrepository.h
index b34c7c6..813dc90 100644
--- a/addons/snippets/editrepository.h
+++ b/addons/snippets/editrepository.h
@@ -42,7 +42,7 @@ class EditRepository : public QDialog, public Ui::EditRepositoryBase
public:
/// @p repo set to 0 when you want to create a new repository.
- explicit EditRepository(SnippetRepository* repo, QWidget* parent = 0);
+ explicit EditRepository(SnippetRepository* repo, QWidget* parent = nullptr);
private:
SnippetRepository* m_repo;
diff --git a/addons/snippets/editsnippet.h b/addons/snippets/editsnippet.h
index 6f25afa..ac3bd01 100644
--- a/addons/snippets/editsnippet.h
+++ b/addons/snippets/editsnippet.h
@@ -46,7 +46,7 @@ class EditSnippet : public QDialog
public:
/// @p snippet set to 0 when you want to create a new snippet.
- explicit EditSnippet(SnippetRepository* repo, Snippet* snippet, QWidget* parent = 0);
+ explicit EditSnippet(SnippetRepository* repo, Snippet* snippet, QWidget* parent = nullptr);
virtual ~EditSnippet();
void setSnippetText(const QString& text);
diff --git a/addons/snippets/katesnippetglobal.cpp b/addons/snippets/katesnippetglobal.cpp
index 8e318bf..8932ae5 100644
--- a/addons/snippets/katesnippetglobal.cpp
+++ b/addons/snippets/katesnippetglobal.cpp
@@ -101,7 +101,7 @@ void KateSnippetGlobal::createSnippet (KTextEditor::View *view)
mode = view->document()->mode();
// try to look for a fitting repo
- SnippetRepository* match = 0;
+ SnippetRepository* match = nullptr;
for ( int i = 0; i < SnippetStore::self()->rowCount(); ++i ) {
SnippetRepository* repo = dynamic_cast<SnippetRepository*>( SnippetStore::self()->item(i) );
if ( repo && repo->fileTypes().count() == 1 && repo->fileTypes().first() == mode ) {
@@ -118,7 +118,7 @@ void KateSnippetGlobal::createSnippet (KTextEditor::View *view)
match->setFileTypes(QStringList() << mode);
}
- EditSnippet dlg(match, 0, view);
+ EditSnippet dlg(match, nullptr, view);
dlg.setSnippetText(view->selectionText());
int status = dlg.exec();
if ( created && status != QDialog::Accepted ) {
diff --git a/addons/snippets/katesnippets.cpp b/addons/snippets/katesnippets.cpp
index 23f2545..55dc604 100644
--- a/addons/snippets/katesnippets.cpp
+++ b/addons/snippets/katesnippets.cpp
@@ -52,7 +52,7 @@ QObject *KateSnippetsPlugin::createView(KTextEditor::MainWindow *mainWindow)
}
KateSnippetsPluginView::KateSnippetsPluginView(KateSnippetsPlugin *plugin, KTextEditor::MainWindow *mainWindow)
- : QObject(mainWindow), m_plugin(plugin), m_mainWindow(mainWindow), m_toolView(0), m_snippets(0)
+ : QObject(mainWindow), m_plugin(plugin), m_mainWindow(mainWindow), m_toolView(nullptr), m_snippets(nullptr)
{
KXMLGUIClient::setComponentName(QStringLiteral("katesnippets"), i18n("Snippets tool view"));
setXMLFile(QStringLiteral("ui.rc"));
diff --git a/addons/snippets/katesnippets.h b/addons/snippets/katesnippets.h
index b7c6875..caf44e6 100644
--- a/addons/snippets/katesnippets.h
+++ b/addons/snippets/katesnippets.h
@@ -38,7 +38,7 @@ class KateSnippetsPlugin: public KTextEditor::Plugin
friend class KateSnippetsPluginView;
public:
- explicit KateSnippetsPlugin(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
+ explicit KateSnippetsPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
virtual ~KateSnippetsPlugin();
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
diff --git a/addons/snippets/snippet.cpp b/addons/snippets/snippet.cpp
index 157345b..4e8be64 100644
--- a/addons/snippets/snippet.cpp
+++ b/addons/snippets/snippet.cpp
@@ -34,7 +34,7 @@
#include <QAction>
Snippet::Snippet()
- : QStandardItem(i18n("<empty snippet>")), m_action(0)
+ : QStandardItem(i18n("<empty snippet>")), m_action(nullptr)
{
setIcon(QIcon::fromTheme(QLatin1String("text-plain")));
}
diff --git a/addons/snippets/snippetcompletionmodel.cpp b/addons/snippets/snippetcompletionmodel.cpp
index 74e5b89..024ff55 100644
--- a/addons/snippets/snippetcompletionmodel.cpp
+++ b/addons/snippets/snippetcompletionmodel.cpp
@@ -33,7 +33,7 @@
#include <KLocalizedString>
SnippetCompletionModel::SnippetCompletionModel()
- : KTextEditor::CodeCompletionModel(0)
+ : KTextEditor::CodeCompletionModel(nullptr)
{
setHasGroups(false);
}
@@ -63,7 +63,7 @@ QVariant SnippetCompletionModel::data( const QModelIndex& idx, int role ) const
if( !idx.isValid() || idx.row() < 0 || idx.row() >= m_snippets.count() ) {
return QVariant();
} else {
- return m_snippets.at( idx.row() )->data(idx, role, 0);
+ return m_snippets.at( idx.row() )->data(idx, role, nullptr);
}
}
diff --git a/addons/snippets/snippetrepository.cpp b/addons/snippets/snippetrepository.cpp
index 55b8f44..4f60ba5 100644
--- a/addons/snippets/snippetrepository.cpp
+++ b/addons/snippets/snippetrepository.cpp
@@ -245,7 +245,7 @@ void SnippetRepository::save()
QFile outfile(outname);
if (!outfile.open(QIODevice::WriteOnly)) {
- KMessageBox::error(0, i18n("Output file '%1' could not be opened for writing", outname));
+ KMessageBox::error(nullptr, i18n("Output file '%1' could not be opened for writing", outname));
return;
}
outfile.write(doc.toByteArray());
diff --git a/addons/snippets/snippetstore.cpp b/addons/snippets/snippetstore.cpp
index 4e2848a..3401edf 100644
--- a/addons/snippets/snippetstore.cpp
+++ b/addons/snippets/snippetstore.cpp
@@ -35,7 +35,7 @@
Q_DECLARE_METATYPE(KSharedConfig::Ptr)
-SnippetStore* SnippetStore::m_self = 0;
+SnippetStore* SnippetStore::m_self = nullptr;
SnippetStore::SnippetStore(KateSnippetGlobal* plugin)
: m_plugin(plugin)
@@ -63,7 +63,7 @@ SnippetStore::SnippetStore(KateSnippetGlobal* plugin)
SnippetStore::~SnippetStore()
{
invisibleRootItem()->removeRows( 0, invisibleRootItem()->rowCount() );
- m_self = 0;
+ m_self = nullptr;
}
void SnippetStore::init(KateSnippetGlobal* plugin)
@@ -104,7 +104,7 @@ bool SnippetStore::setData(const QModelIndex& index, const QVariant& value, int
// when we edited something, save the repository
- QStandardItem* repoItem = 0;
+ QStandardItem* repoItem = nullptr;
if ( index.parent().isValid() ) {
repoItem = itemFromIndex(index.parent());
} else {
@@ -127,7 +127,7 @@ SnippetRepository* SnippetStore::repositoryForFile(const QString& file)
}
}
}
- return 0;
+ return nullptr;
}
diff --git a/addons/snippets/snippetview.cpp b/addons/snippets/snippetview.cpp
index 504d3d5..6d26ecf 100644
--- a/addons/snippets/snippetview.cpp
+++ b/addons/snippets/snippetview.cpp
@@ -45,7 +45,7 @@
class SnippetFilterModel : public QSortFilterProxyModel {
public:
- SnippetFilterModel(QObject* parent = 0) : QSortFilterProxyModel(parent) { };
+ SnippetFilterModel(QObject* parent = nullptr) : QSortFilterProxyModel(parent) { };
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const Q_DECL_OVERRIDE {
auto index = sourceModel()->index(sourceRow, 0, sourceParent);
auto item = SnippetStore::self()->itemFromIndex(index);
@@ -256,7 +256,7 @@ void SnippetView::slotAddSnippet()
return;
}
- EditSnippet dlg(repo, 0, this);
+ EditSnippet dlg(repo, nullptr, this);
dlg.exec();
}
@@ -282,7 +282,7 @@ void SnippetView::slotRemoveSnippet()
void SnippetView::slotAddRepo()
{
- EditRepository dlg(0, this);
+ EditRepository dlg(nullptr, this);
dlg.exec();
}
@@ -360,7 +360,7 @@ bool SnippetView::eventFilter(QObject* obj, QEvent* e)
// no, listening to activated() is not enough since that would also trigger the edit mode which we _dont_ want here
// users may still rename stuff via select + F2 though
if (obj == snippetTree->viewport()) {
- const bool singleClick = style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, this);
+ const bool singleClick = style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, nullptr, this);
if ( (!singleClick && e->type() == QEvent::MouseButtonDblClick) || (singleClick && e->type() == QEvent::MouseButtonRelease) ) {
QMouseEvent* mouseEvent = dynamic_cast<QMouseEvent*>(e);
Q_ASSERT(mouseEvent);
diff --git a/addons/snippets/snippetview.h b/addons/snippets/snippetview.h
index 6b01ddb..8e00b2c 100644
--- a/addons/snippets/snippetview.h
+++ b/addons/snippets/snippetview.h
@@ -45,7 +45,7 @@ class SnippetView : public QWidget, public Ui::SnippetViewBase
Q_OBJECT
public:
- explicit SnippetView(KateSnippetGlobal* plugin, QWidget* parent = 0);
+ explicit SnippetView(KateSnippetGlobal* plugin, QWidget* parent = nullptr);
public:
void setupActionsForWindow(QWidget* widget);
diff --git a/addons/symbolviewer/bash_parser.cpp b/addons/symbolviewer/bash_parser.cpp
index 51ba96c..6feb86d 100644
--- a/addons/symbolviewer/bash_parser.cpp
+++ b/addons/symbolviewer/bash_parser.cpp
@@ -33,9 +33,9 @@ void KatePluginSymbolViewerView::parseBashSymbols(void)
int i;
//bool mainprog;
- QTreeWidgetItem *node = NULL;
- QTreeWidgetItem *funcNode = NULL;
- QTreeWidgetItem *lastFuncNode = NULL;
+ QTreeWidgetItem *node = nullptr;
+ QTreeWidgetItem *funcNode = nullptr;
+ QTreeWidgetItem *lastFuncNode = nullptr;
QPixmap func( ( const char** ) class_xpm );
diff --git a/addons/symbolviewer/cpp_parser.cpp b/addons/symbolviewer/cpp_parser.cpp
index c1a90f1..9f3614a 100644
--- a/addons/symbolviewer/cpp_parser.cpp
+++ b/addons/symbolviewer/cpp_parser.cpp
@@ -37,9 +37,9 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
m_struct->setText(i18n("Show Structures"));
m_func->setText(i18n("Show Functions"));
- QTreeWidgetItem *node = NULL;
- QTreeWidgetItem *mcrNode = NULL, *sctNode = NULL, *clsNode = NULL, *mtdNode = NULL;
- QTreeWidgetItem *lastMcrNode = NULL, *lastSctNode = NULL, *lastClsNode = NULL, *lastMtdNode = NULL;
+ QTreeWidgetItem *node = nullptr;
+ QTreeWidgetItem *mcrNode = nullptr, *sctNode = nullptr, *clsNode = nullptr, *mtdNode = nullptr;
+ QTreeWidgetItem *lastMcrNode = nullptr, *lastSctNode = nullptr, *lastClsNode = nullptr, *lastMtdNode = nullptr;
KTextEditor::Document *kv = m_mainWindow->activeView()->document();
diff --git a/addons/symbolviewer/ecma_parser.cpp b/addons/symbolviewer/ecma_parser.cpp
index cb50412..edee5d5 100644
--- a/addons/symbolviewer/ecma_parser.cpp
+++ b/addons/symbolviewer/ecma_parser.cpp
@@ -41,7 +41,7 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
QPixmap cls( ( const char** ) class_xpm );
QPixmap mtd( ( const char** ) method_xpm );
- QTreeWidgetItem *node = NULL;
+ QTreeWidgetItem *node = nullptr;
if (m_plugin->treeOn) {
m_symbols->setRootIsDecorated(1);
@@ -201,16 +201,16 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
// if we have a function identifier, make a node
if (identifier.length() > 0) {
// make a node for the function
- QTreeWidgetItem *parent = NULL;
+ QTreeWidgetItem *parent = nullptr;
if (! nodes.isEmpty()) {
parent = nodes.last();
}
- if ((m_plugin->treeOn) && (parent != NULL))
+ if ((m_plugin->treeOn) && (parent != nullptr))
node = new QTreeWidgetItem(parent);
else
node = new QTreeWidgetItem(m_symbols);
// mark the parent as a class (if it's not the root level)
- if (parent != NULL) {
+ if (parent != nullptr) {
parent->setIcon(0, QIcon(cls));
// mark this function as a method of the parent
node->setIcon(0, QIcon(mtd));
@@ -248,11 +248,11 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
// if we have an id, make a node
if (identifier.length() > 0) {
- QTreeWidgetItem *parent = NULL;
+ QTreeWidgetItem *parent = nullptr;
if (! nodes.isEmpty()) {
parent = nodes.last();
}
- if ((m_plugin->treeOn) && (parent != NULL))
+ if ((m_plugin->treeOn) && (parent != nullptr))
node = new QTreeWidgetItem(parent);
else
node = new QTreeWidgetItem(m_symbols);
@@ -272,7 +272,7 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
brace_depth++;
// if a node has been added at this level or above,
// use it to extend the stack
- if (node != NULL)
+ if (node != nullptr)
nodes.append(node);
// if no node has been added, extend the last node to this depth
else if (! nodes.isEmpty())
@@ -281,7 +281,7 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
else if (current == QLatin1Char('}')) {
brace_depth--;
// pop the last node off the stack
- node = NULL;
+ node = nullptr;
if (! nodes.isEmpty()) nodes.removeLast();
}
} // (scan the stripped line)
diff --git a/addons/symbolviewer/fortran_parser.cpp b/addons/symbolviewer/fortran_parser.cpp
index 2242f6f..4be1d73 100644
--- a/addons/symbolviewer/fortran_parser.cpp
+++ b/addons/symbolviewer/fortran_parser.cpp
@@ -31,9 +31,9 @@ void KatePluginSymbolViewerView::parseFortranSymbols(void)
int fnd,block=0,blockend=0,paro=0,parc=0;
bool mainprog;
- QTreeWidgetItem *node = NULL;
- QTreeWidgetItem *subrNode = NULL, *funcNode = NULL, *modNode = NULL;
- QTreeWidgetItem *lastSubrNode = NULL, *lastFuncNode = NULL, *lastModNode = NULL;
+ QTreeWidgetItem *node = nullptr;
+ QTreeWidgetItem *subrNode = nullptr, *funcNode = nullptr, *modNode = nullptr;
+ QTreeWidgetItem *lastSubrNode = nullptr, *lastFuncNode = nullptr, *lastModNode = nullptr;
QPixmap func( ( const char** ) class_xpm );
QPixmap subr( ( const char** ) macro_xpm );
diff --git a/addons/symbolviewer/perl_parser.cpp b/addons/symbolviewer/perl_parser.cpp
index 5ab796b..87ddc51 100644
--- a/addons/symbolviewer/perl_parser.cpp
+++ b/addons/symbolviewer/perl_parser.cpp
@@ -30,9 +30,9 @@ void KatePluginSymbolViewerView::parsePerlSymbols(void)
QPixmap sct( ( const char** ) struct_xpm );
QPixmap mcr( ( const char** ) macro_xpm );
QPixmap cls_int( ( const char** ) class_int_xpm );
- QTreeWidgetItem *node = NULL;
- QTreeWidgetItem *mcrNode = NULL, *sctNode = NULL, *clsNode = NULL;
- QTreeWidgetItem *lastMcrNode = NULL, *lastSctNode = NULL, *lastClsNode = NULL;
+ QTreeWidgetItem *node = nullptr;
+ QTreeWidgetItem *mcrNode = nullptr, *sctNode = nullptr, *clsNode = nullptr;
+ QTreeWidgetItem *lastMcrNode = nullptr, *lastSctNode = nullptr, *lastClsNode = nullptr;
KTextEditor::Document *kv = m_mainWindow->activeView()->document();
diff --git a/addons/symbolviewer/php_parser.cpp b/addons/symbolviewer/php_parser.cpp
index cfdd7eb..9cd6801 100644
--- a/addons/symbolviewer/php_parser.cpp
+++ b/addons/symbolviewer/php_parser.cpp
@@ -28,11 +28,11 @@ void KatePluginSymbolViewerView::parsePhpSymbols(void)
QPixmap classPix( ( const char** ) class_xpm );
QPixmap constPix( ( const char** ) macro_xpm );
QPixmap functionPix( ( const char** ) method_xpm );
- QTreeWidgetItem *node = NULL;
- QTreeWidgetItem *namespaceNode = NULL, *defineNode = NULL, \
- *classNode = NULL, *functionNode = NULL;
- QTreeWidgetItem *lastNamespaceNode = NULL, *lastDefineNode = NULL, \
- *lastClassNode = NULL, *lastFunctionNode = NULL;
+ QTreeWidgetItem *node = nullptr;
+ QTreeWidgetItem *namespaceNode = nullptr, *defineNode = nullptr, \
+ *classNode = nullptr, *functionNode = nullptr;
+ QTreeWidgetItem *lastNamespaceNode = nullptr, *lastDefineNode = nullptr, \
+ *lastClassNode = nullptr, *lastFunctionNode = nullptr;
KTextEditor::Document *kv = m_mainWindow->activeView()->document();
diff --git a/addons/symbolviewer/plugin_katesymbolviewer.cpp b/addons/symbolviewer/plugin_katesymbolviewer.cpp
index 1d3d894..034be92 100644
--- a/addons/symbolviewer/plugin_katesymbolviewer.cpp
+++ b/addons/symbolviewer/plugin_katesymbolviewer.cpp
@@ -79,7 +79,7 @@ KatePluginSymbolViewerView::KatePluginSymbolViewerView(KTextEditor::Plugin *plug
setXMLFile(QLatin1String("ui.rc"));
mw->guiFactory()->addClient (this);
- m_symbols = 0;
+ m_symbols = nullptr;
m_popup = new QMenu(m_symbols);
m_popup->addAction(i18n("Refresh List"), this, SLOT(slotRefreshSymbol()));
@@ -261,8 +261,8 @@ void KatePluginSymbolViewerView::updateCurrTreeItem()
int currLine = editView->cursorPositionVirtual().line();
int newItemLine = 0;
- QTreeWidgetItem *newItem = 0;
- QTreeWidgetItem *tmp = 0;
+ QTreeWidgetItem *newItem = nullptr;
+ QTreeWidgetItem *tmp = nullptr;
for (int i=0; i<m_symbols->topLevelItemCount(); i++) {
tmp = newActveItem(newItemLine, currLine, m_symbols->topLevelItem(i));
if (tmp) newItem = tmp;
@@ -277,8 +277,8 @@ void KatePluginSymbolViewerView::updateCurrTreeItem()
QTreeWidgetItem *KatePluginSymbolViewerView::newActveItem(int &newItemLine, int currLine, QTreeWidgetItem *item)
{
- QTreeWidgetItem *newItem = 0;
- QTreeWidgetItem *tmp = 0;
+ QTreeWidgetItem *newItem = nullptr;
+ QTreeWidgetItem *tmp = nullptr;
int itemLine = item->data(1, Qt::DisplayRole).toInt();
if ((itemLine <= currLine) && (itemLine > newItemLine)) {
@@ -364,7 +364,7 @@ void KatePluginSymbolViewerView::goToSymbol(QTreeWidgetItem *it)
//qDebug()<<"Slot Activated at pos: "<<m_symbols->indexOfTopLevelItem(it);
- kv->setCursorPosition (KTextEditor::Cursor (it->text(1).toInt(NULL, 10), 0));
+ kv->setCursorPosition (KTextEditor::Cursor (it->text(1).toInt(nullptr, 10), 0));
}
KatePluginSymbolViewer::KatePluginSymbolViewer( QObject* parent, const QList<QVariant>& )
diff --git a/addons/symbolviewer/plugin_katesymbolviewer.h b/addons/symbolviewer/plugin_katesymbolviewer.h
index 8c58eac..d10551c 100644
--- a/addons/symbolviewer/plugin_katesymbolviewer.h
+++ b/addons/symbolviewer/plugin_katesymbolviewer.h
@@ -47,7 +47,7 @@ class KatePluginSymbolViewerConfigPage : public KTextEditor::ConfigPage
friend class KatePluginSymbolViewer;
public:
- explicit KatePluginSymbolViewerConfigPage (QObject* parent = 0L, QWidget *parentWidget = 0L);
+ explicit KatePluginSymbolViewerConfigPage (QObject* parent = nullptr, QWidget *parentWidget = nullptr);
~KatePluginSymbolViewerConfigPage ();
/**
@@ -141,13 +141,13 @@ class KatePluginSymbolViewer : public KTextEditor::Plugin
{
Q_OBJECT
public:
- explicit KatePluginSymbolViewer(QObject* parent = 0, const QList<QVariant>& = QList<QVariant>());
+ explicit KatePluginSymbolViewer(QObject* parent = nullptr, const QList<QVariant>& = QList<QVariant>());
virtual ~KatePluginSymbolViewer();
QObject *createView (KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
int configPages () const Q_DECL_OVERRIDE { return 1; }
- KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
+ KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
public Q_SLOTS:
void applyConfig( KatePluginSymbolViewerConfigPage* p );
diff --git a/addons/symbolviewer/python_parser.cpp b/addons/symbolviewer/python_parser.cpp
index f85b41b..7be0848 100644
--- a/addons/symbolviewer/python_parser.cpp
+++ b/addons/symbolviewer/python_parser.cpp
@@ -32,9 +32,9 @@ void KatePluginSymbolViewerView::parsePythonSymbols(void)
int in_class = 0, state = 0, j;
QString name;
- QTreeWidgetItem *node = NULL;
- QTreeWidgetItem *mcrNode = NULL, *mtdNode = NULL, *clsNode = NULL;
- QTreeWidgetItem *lastMcrNode = NULL, *lastMtdNode = NULL, *lastClsNode = NULL;
+ QTreeWidgetItem *node = nullptr;
+ QTreeWidgetItem *mcrNode = nullptr, *mtdNode = nullptr, *clsNode = nullptr;
+ QTreeWidgetItem *lastMcrNode = nullptr, *lastMtdNode = nullptr, *lastClsNode = nullptr;
KTextEditor::Document *kv = m_mainWindow->activeView()->document();
diff --git a/addons/symbolviewer/ruby_parser.cpp b/addons/symbolviewer/ruby_parser.cpp
index 63a7896..c77148b 100644
--- a/addons/symbolviewer/ruby_parser.cpp
+++ b/addons/symbolviewer/ruby_parser.cpp
@@ -32,9 +32,9 @@ void KatePluginSymbolViewerView::parseRubySymbols(void)
int i;
QString name;
- QTreeWidgetItem *node = NULL;
- QTreeWidgetItem *mtdNode = NULL, *clsNode = NULL;
- QTreeWidgetItem *lastMtdNode = NULL, *lastClsNode = NULL;
+ QTreeWidgetItem *node = nullptr;
+ QTreeWidgetItem *mtdNode = nullptr, *clsNode = nullptr;
+ QTreeWidgetItem *lastMtdNode = nullptr, *lastClsNode = nullptr;
KTextEditor::Document *kv = m_mainWindow->activeView()->document();
//kdDebug(13000)<<"Lines counted :"<<kv->numLines()<<endl;
diff --git a/addons/symbolviewer/tcl_parser.cpp b/addons/symbolviewer/tcl_parser.cpp
index 3f27222..c6a2035 100644
--- a/addons/symbolviewer/tcl_parser.cpp
+++ b/addons/symbolviewer/tcl_parser.cpp
@@ -30,9 +30,9 @@ void KatePluginSymbolViewerView::parseTclSymbols(void)
int i, j, args_par = 0, graph = 0;
char block = 0, parse_func = 0;
- QTreeWidgetItem *node = NULL;
- QTreeWidgetItem *mcrNode = NULL, *clsNode = NULL;
- QTreeWidgetItem *lastMcrNode = NULL, *lastClsNode = NULL;
+ QTreeWidgetItem *node = nullptr;
+ QTreeWidgetItem *mcrNode = nullptr, *clsNode = nullptr;
+ QTreeWidgetItem *lastMcrNode = nullptr, *lastClsNode = nullptr;
QPixmap mcr( ( const char** ) macro_xpm );
QPixmap cls( ( const char** ) class_xpm );
diff --git a/addons/symbolviewer/xslt_parser.cpp b/addons/symbolviewer/xslt_parser.cpp
index 96edd63..3d082a4 100644
--- a/addons/symbolviewer/xslt_parser.cpp
+++ b/addons/symbolviewer/xslt_parser.cpp
@@ -37,9 +37,9 @@ void KatePluginSymbolViewerView::parseXsltSymbols(void)
QPixmap mcr( ( const char** ) macro_xpm );
QPixmap cls_int( ( const char** ) class_int_xpm );
- QTreeWidgetItem *node = NULL;
- QTreeWidgetItem *mcrNode = NULL, *sctNode = NULL, *clsNode = NULL;
- QTreeWidgetItem *lastMcrNode = NULL, *lastSctNode = NULL, *lastClsNode = NULL;
+ QTreeWidgetItem *node = nullptr;
+ QTreeWidgetItem *mcrNode = nullptr, *sctNode = nullptr, *clsNode = nullptr;
+ QTreeWidgetItem *lastMcrNode = nullptr, *lastSctNode = nullptr, *lastClsNode = nullptr;
KTextEditor::Document *kv = m_mainWindow->activeView()->document();
//kdDebug(13000)<<"Lines counted :"<<kv->numLines()<<endl;
diff --git a/addons/tabswitcher/tabswitcher.cpp b/addons/tabswitcher/tabswitcher.cpp
index 0d4fcde..d71fc8c 100644
--- a/addons/tabswitcher/tabswitcher.cpp
+++ b/addons/tabswitcher/tabswitcher.cpp
@@ -166,7 +166,7 @@ void TabSwitcherPluginView::unregisterDocument(KTextEditor::Document * document)
m_model->removeRow(i);
// disconnect documentNameChanged() signal
- disconnect(document, 0, this, 0);
+ disconnect(document, nullptr, this, nullptr);
break;
}
diff --git a/addons/tabswitcher/tabswitcher.h b/addons/tabswitcher/tabswitcher.h
index e94d609..81c385a 100644
--- a/addons/tabswitcher/tabswitcher.h
+++ b/addons/tabswitcher/tabswitcher.h
@@ -45,7 +45,7 @@ public:
/**
* Plugin constructor.
*/
- explicit TabSwitcherPlugin(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
+ explicit TabSwitcherPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
/**
* Create a new tab switcher for @p mainWindow.
diff --git a/addons/textfilter/plugin_katetextfilter.cpp b/addons/textfilter/plugin_katetextfilter.cpp
index d61a36c..4cde9ca 100644
--- a/addons/textfilter/plugin_katetextfilter.cpp
+++ b/addons/textfilter/plugin_katetextfilter.cpp
@@ -150,7 +150,7 @@ static void slipInFilter(KProcess & proc, KTextEditor::View & view, QString comm
void PluginKateTextFilter::slotEditFilter()
{
if (!KAuthorized::authorize(QStringLiteral("shell_access"))) {
- KMessageBox::sorry(0,i18n(
+ KMessageBox::sorry(nullptr,i18n(
"You are not allowed to execute arbitrary external applications. If "
"you want to be able to do this, contact your system administrator."),
i18n("Access Restrictions"));
diff --git a/addons/textfilter/plugin_katetextfilter.h b/addons/textfilter/plugin_katetextfilter.h
index c834191..0c845ab 100644
--- a/addons/textfilter/plugin_katetextfilter.h
+++ b/addons/textfilter/plugin_katetextfilter.h
@@ -36,7 +36,7 @@ class PluginKateTextFilter : public KTextEditor::Plugin
/**
* Plugin constructor.
*/
- explicit PluginKateTextFilter(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
+ explicit PluginKateTextFilter(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
virtual ~PluginKateTextFilter();
diff --git a/addons/xmlcheck/plugin_katexmlcheck.cpp b/addons/xmlcheck/plugin_katexmlcheck.cpp
index 8e431b8..b1669f3 100644
--- a/addons/xmlcheck/plugin_katexmlcheck.cpp
+++ b/addons/xmlcheck/plugin_katexmlcheck.cpp
@@ -119,7 +119,7 @@ PluginKateXMLCheckView::PluginKateXMLCheckView( KTextEditor::Plugin *plugin,
dock = m_mainWindow->createToolView(plugin, "kate_plugin_xmlcheck_ouputview", KTextEditor::MainWindow::Bottom, QIcon::fromTheme("misc"), i18n("XML Checker Output"));
listview = new QTreeWidget( dock );
- m_tmp_file=0;
+ m_tmp_file=nullptr;
QAction *a = actionCollection()->addAction("xml_check");
a->setText(i18n("Validate XML"));
connect(a, SIGNAL(triggered()), this, SLOT(slotValidate()));
@@ -186,7 +186,7 @@ void PluginKateXMLCheckView::slotProcExited(int exitCode, QProcess::ExitStatus e
QApplication::restoreOverrideCursor();
delete m_tmp_file;
QString proc_stderr = QString::fromLocal8Bit(m_proc.readAllStandardError());
- m_tmp_file=0;
+ m_tmp_file=nullptr;
listview->clear();
uint list_count = 0;
uint err_count = 0;
@@ -299,10 +299,10 @@ bool PluginKateXMLCheckView::slotValidate()
m_tmp_file = new QTemporaryFile();
if( !m_tmp_file->open() ) {
qDebug() << "Error (slotValidate()): could not create '" << m_tmp_file->fileName() << "': " << m_tmp_file->errorString();
- KMessageBox::error(0, i18n("<b>Error:</b> Could not create "
+ KMessageBox::error(nullptr, i18n("<b>Error:</b> Could not create "
"temporary file '%1'.", m_tmp_file->fileName()));
delete m_tmp_file;
- m_tmp_file=0L;
+ m_tmp_file=nullptr;
return false;
}
@@ -392,7 +392,7 @@ bool PluginKateXMLCheckView::slotValidate()
qDebug() << "args=" << args;
qDebug() << "exit code:"<< m_proc.exitCode();
if( ! m_proc.waitForStarted(-1) ) {
- KMessageBox::error(0, i18n("<b>Error:</b> Failed to execute xmllint. Please make "
+ KMessageBox::error(nullptr, i18n("<b>Error:</b> Failed to execute xmllint. Please make "
"sure that xmllint is installed. It is part of libxml2."));
return false;
}
diff --git a/addons/xmlcheck/plugin_katexmlcheck.h b/addons/xmlcheck/plugin_katexmlcheck.h
index 0a85a98..39e5550 100644
--- a/addons/xmlcheck/plugin_katexmlcheck.h
+++ b/addons/xmlcheck/plugin_katexmlcheck.h
@@ -75,7 +75,7 @@ class PluginKateXMLCheck : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit PluginKateXMLCheck( QObject* parent = 0, const QVariantList& = QVariantList() );
+ explicit PluginKateXMLCheck( QObject* parent = nullptr, const QVariantList& = QVariantList() );
virtual ~PluginKateXMLCheck();
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
diff --git a/addons/xmltools/plugin_katexmltools.cpp b/addons/xmltools/plugin_katexmltools.cpp
index f7290c0..ede35e2 100644
--- a/addons/xmltools/plugin_katexmltools.cpp
+++ b/addons/xmltools/plugin_katexmltools.cpp
@@ -154,7 +154,7 @@ PluginKateXMLToolsView::~PluginKateXMLToolsView()
PluginKateXMLToolsCompletionModel::PluginKateXMLToolsCompletionModel(QObject *const parent)
: CodeCompletionModel(parent)
- , m_viewToAssignTo(0)
+ , m_viewToAssignTo(nullptr)
, m_mode(none)
, m_correctPos(0)
{
@@ -319,7 +319,7 @@ QModelIndex PluginKateXMLToolsCompletionModel::index(const int row,
}
if (parent.internalId() == groupNode) { // Is this a group node?
if (0 <= row && row < m_allowed.size()) { // Make sure to return only valid indices
- return createIndex(row, column, (void *)0); // Just return a leaf-level index
+ return createIndex(row, column, (void *)nullptr); // Just return a leaf-level index
}
}
// Leaf node has no children... nothing to return
@@ -456,7 +456,7 @@ void PluginKateXMLToolsCompletionModel::getDTD()
"*.xml");
} else {
url.setUrl(defaultDir + filename);
- KMessageBox::information(0, i18n("The current file has been identified "
+ KMessageBox::information(nullptr, i18n("The current file has been identified "
"as a document of type \"%1\". The meta DTD for this document type "
"will now be loaded.", doctype),
i18n("Loading XML Meta DTD"),
@@ -491,7 +491,7 @@ void PluginKateXMLToolsCompletionModel::slotFinished(KJob *job)
static_cast<KIO::Job *>(job)->uiDelegate()->showErrorMessage();
} else if (static_cast<KIO::TransferJob *>(job)->isErrorPage()) {
// catch failed loading loading via http:
- KMessageBox::error(0, i18n("The file '%1' could not be opened. "
+ KMessageBox::error(nullptr, i18n("The file '%1' could not be opened. "
"The server returned an error.", m_urlString),
i18n("XML Plugin Error"));
} else {
@@ -502,7 +502,7 @@ void PluginKateXMLToolsCompletionModel::slotFinished(KJob *job)
assignDTD(dtd, m_viewToAssignTo);
// clean up a bit
- m_viewToAssignTo = 0;
+ m_viewToAssignTo = nullptr;
m_dtdString.clear();
}
QGuiApplication::restoreOverrideCursor();
diff --git a/addons/xmltools/plugin_katexmltools.h b/addons/xmltools/plugin_katexmltools.h
index e79097a..c3d2931 100644
--- a/addons/xmltools/plugin_katexmltools.h
+++ b/addons/xmltools/plugin_katexmltools.h
@@ -45,7 +45,7 @@ class PluginKateXMLTools : public KTextEditor::Plugin
Q_OBJECT
public:
- explicit PluginKateXMLTools(QObject *parent = 0, const QVariantList& = QVariantList());
+ explicit PluginKateXMLTools(QObject *parent = nullptr, const QVariantList& = QVariantList());
~PluginKateXMLTools();
QObject *createView(KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
};
diff --git a/addons/xmltools/pseudo_dtd.cpp b/addons/xmltools/pseudo_dtd.cpp
index adf73b1..8b3bcb6 100644
--- a/addons/xmltools/pseudo_dtd.cpp
+++ b/addons/xmltools/pseudo_dtd.cpp
@@ -42,14 +42,14 @@ void PseudoDTD::analyzeDTD(QString &metaDtdUrl, QString &metaDtd)
{
QDomDocument doc("dtdIn_xml");
if (! doc.setContent(metaDtd)) {
- KMessageBox::error(0, i18n("The file '%1' could not be parsed. "
+ KMessageBox::error(nullptr, i18n("The file '%1' could not be parsed. "
"Please check that the file is well-formed XML.", metaDtdUrl),
i18n("XML Plugin Error"));
return;
}
if (doc.doctype().name() != "dtd") {
- KMessageBox::error(0, i18n("The file '%1' is not in the expected format. "
+ KMessageBox::error(nullptr, i18n("The file '%1' is not in the expected format. "
"Please check that the file is of this type:\n"
"-//Norman Walsh//DTD DTDParse V2.0//EN\n"
"You can produce such files with dtdparse. "
diff --git a/kate/kateapp.cpp b/kate/kateapp.cpp
index c89ccce..2248d3a 100644
--- a/kate/kateapp.cpp
+++ b/kate/kateapp.cpp
@@ -168,10 +168,10 @@ bool KateApp::startupKate()
// notify about start
KStartupInfo::setNewStartupId(activeKateMainWindow(), KStartupInfo::startupId());
- QTextCodec *codec = m_args.isSet(QStringLiteral("encoding")) ? QTextCodec::codecForName(m_args.value(QStringLiteral("encoding")).toUtf8()) : 0;
+ QTextCodec *codec = m_args.isSet(QStringLiteral("encoding")) ? QTextCodec::codecForName(m_args.value(QStringLiteral("encoding")).toUtf8()) : nullptr;
bool tempfileSet = m_args.isSet(QStringLiteral("tempfile"));
- KTextEditor::Document *doc = 0;
+ KTextEditor::Document *doc = nullptr;
const QString codec_name = codec ? QString::fromLatin1(codec->name()) : QString();
Q_FOREACH(const QString positionalArgument, m_args.positionalArguments()) {
@@ -277,15 +277,15 @@ KTextEditor::Document *KateApp::openDocUrl(const QUrl &url, const QString &encod
KateMainWindow *mainWindow = activeKateMainWindow();
if (!mainWindow) {
- return 0;
+ return nullptr;
}
- QTextCodec *codec = encoding.isEmpty() ? 0 : QTextCodec::codecForName(encoding.toLatin1());
+ QTextCodec *codec = encoding.isEmpty() ? nullptr : QTextCodec::codecForName(encoding.toLatin1());
// this file is no local dir, open it, else warn
bool noDir = !url.isLocalFile() || !QFileInfo(url.toLocalFile()).isDir();
- KTextEditor::Document *doc = 0;
+ KTextEditor::Document *doc = nullptr;
if (noDir) {
// open a normal file
@@ -358,7 +358,7 @@ void KateApp::removeMainWindow(KateMainWindow *mainWindow)
KateMainWindow *KateApp::activeKateMainWindow()
{
if (m_mainWindows.isEmpty()) {
- return 0;
+ return nullptr;
}
int n = m_mainWindows.indexOf(static_cast<KateMainWindow *>((static_cast<QApplication *>(QCoreApplication::instance())->activeWindow())));
@@ -386,7 +386,7 @@ KateMainWindow *KateApp::mainWindow(int n)
return m_mainWindows[n];
}
- return 0;
+ return nullptr;
}
void KateApp::emitDocumentClosed(const QString &token)
diff --git a/kate/kateapp.h b/kate/kateapp.h
index b47a12b..ae43a10 100644
--- a/kate/kateapp.h
+++ b/kate/kateapp.h
@@ -140,7 +140,7 @@ public:
* @param sgroup session group for this window
* @return new constructed main window
*/
- KateMainWindow *newMainWindow(KConfig *sconfig = 0, const QString &sgroup = QString());
+ KateMainWindow *newMainWindow(KConfig *sconfig = nullptr, const QString &sgroup = QString());
/**
* add the mainwindow given
diff --git a/kate/kateconfigplugindialogpage.h b/kate/kateconfigplugindialogpage.h
index 94db2ad..c97c509 100644
--- a/kate/kateconfigplugindialogpage.h
+++ b/kate/kateconfigplugindialogpage.h
@@ -32,7 +32,7 @@ class KatePluginListView : public QTreeWidget
Q_OBJECT
public:
- KatePluginListView(QWidget *parent = 0);
+ KatePluginListView(QWidget *parent = nullptr);
Q_SIGNALS:
void stateChange(KatePluginListItem *, bool);
diff --git a/kate/katedocmanager.cpp b/kate/katedocmanager.cpp
index 887ba9f..fdfd583 100644
--- a/kate/katedocmanager.cpp
+++ b/kate/katedocmanager.cpp
@@ -133,7 +133,7 @@ KTextEditor::Document *KateDocManager::findDocument(const QUrl &url) const
}
}
- return 0;
+ return nullptr;
}
QList<KTextEditor::Document *> KateDocManager::openUrls(const QList<QUrl> &urls, const QString &encoding, bool isTempFile, const KateDocumentInfo &docInfo)
@@ -155,7 +155,7 @@ KTextEditor::Document *KateDocManager::openUrl(const QUrl &url, const QString &e
{
// special handling: if only one unmodified empty buffer in the list,
// keep this buffer in mind to close it after opening the new url
- KTextEditor::Document *untitledDoc = 0;
+ KTextEditor::Document *untitledDoc = nullptr;
if ((documentList().count() == 1) && (!documentList().at(0)->isModified()
&& documentList().at(0)->url().isEmpty())) {
untitledDoc = documentList().first();
@@ -165,7 +165,7 @@ KTextEditor::Document *KateDocManager::openUrl(const QUrl &url, const QString &e
// create new document
//
QUrl u(url.adjusted(QUrl::NormalizePathSegments));
- KTextEditor::Document *doc = 0;
+ KTextEditor::Document *doc = nullptr;
// always new document if url is empty...
if (!u.isEmpty()) {
@@ -290,7 +290,7 @@ bool KateDocManager::closeDocumentList(QList<KTextEditor::Document *> documents)
}
}
- if (modifiedDocuments.size() > 0 && !KateSaveModifiedDialog::queryClose(0, modifiedDocuments)) {
+ if (modifiedDocuments.size() > 0 && !KateSaveModifiedDialog::queryClose(nullptr, modifiedDocuments)) {
return false;
}
@@ -443,14 +443,14 @@ void KateDocManager::restoreDocumentList(KConfig *config)
progress.setWindowTitle(i18n("Starting Up"));
progress.setLabelText(i18n("Reopening files from the last session..."));
progress.setModal(true);
- progress.setCancelButton(0);
+ progress.setCancelButton(nullptr);
progress.setRange(0, count);
m_documentStillToRestore = count;
m_openingErrors.clear();
for (unsigned int i = 0; i < count; i++) {
KConfigGroup cg(config, QString::fromLatin1("Document %1").arg(i));
- KTextEditor::Document *doc = 0;
+ KTextEditor::Document *doc = nullptr;
if (i == 0) {
doc = m_docList.first();
@@ -600,7 +600,7 @@ void KateDocManager::documentOpened()
void KateDocManager::showRestoreErrors()
{
if (!m_openingErrors.isEmpty()) {
- KMessageBox::information(0,
+ KMessageBox::information(nullptr,
m_openingErrors,
i18n("Errors/Warnings while opening documents"));
diff --git a/kate/katemainwindow.cpp b/kate/katemainwindow.cpp
index 39dd96e..f390bc4 100644
--- a/kate/katemainwindow.cpp
+++ b/kate/katemainwindow.cpp
@@ -81,7 +81,7 @@
#include <ktexteditor/sessionconfiginterface.h>
//END
-KateMwModOnHdDialog *KateMainWindow::s_modOnHdDialog = 0;
+KateMwModOnHdDialog *KateMainWindow::s_modOnHdDialog = nullptr;
KateContainerStackedLayout::KateContainerStackedLayout(QWidget *parent)
: QStackedLayout(parent)
@@ -104,7 +104,7 @@ QSize KateContainerStackedLayout::minimumSize() const
}
KateMainWindow::KateMainWindow(KConfig *sconfig, const QString &sgroup)
- : KateMDI::MainWindow(0)
+ : KateMDI::MainWindow(nullptr)
, m_modignore(false)
, m_wrapper(new KTextEditor::MainWindow(this))
{
@@ -198,11 +198,11 @@ KateMainWindow::~KateMainWindow()
// delete the view manager, before KateMainWindow's wrapper is dead
delete m_viewManager;
- m_viewManager = 0;
+ m_viewManager = nullptr;
// kill the wrapper object, now that all views are dead
delete m_wrapper;
- m_wrapper = 0;
+ m_wrapper = nullptr;
}
QSize KateMainWindow::sizeHint() const
@@ -331,7 +331,7 @@ void KateMainWindow::setupActions()
connect(a, SIGNAL(triggered()), this, SLOT(newWindow()));
a->setWhatsThis(i18n("Create a new Kate view (a new window with the same document list)."));
- m_showFullScreenAction = KStandardAction::fullScreen(0, 0, this, this);
+ m_showFullScreenAction = KStandardAction::fullScreen(nullptr, nullptr, this, this);
actionCollection()->addAction(m_showFullScreenAction->objectName(), m_showFullScreenAction);
connect(m_showFullScreenAction, SIGNAL(toggled(bool)), this, SLOT(slotFullScreen(bool)));
@@ -679,7 +679,7 @@ void KateMainWindow::dropEvent(QDropEvent *event)
void KateMainWindow::slotDropEvent(QDropEvent *event)
{
- if (event->mimeData() == 0) {
+ if (event->mimeData() == nullptr) {
return;
}
@@ -693,11 +693,11 @@ void KateMainWindow::slotDropEvent(QDropEvent *event)
// Try to get the KTextEditor::View that sent this, and activate it, so that the file opens in the
// view where it was dropped
KTextEditor::View *kVsender = qobject_cast<KTextEditor::View *>(QObject::sender());
- if (kVsender != 0) {
+ if (kVsender != nullptr) {
QWidget *parent = kVsender->parentWidget();
- if (parent != 0) {
+ if (parent != nullptr) {
KateViewSpace *vs = qobject_cast<KateViewSpace *>(parent->parentWidget());
- if (vs != 0) {
+ if (vs != nullptr) {
m_viewManager->setActiveSpace(vs);
}
}
@@ -773,7 +773,7 @@ void KateMainWindow::openUrl(const QString &name)
void KateMainWindow::slotConfigure()
{
- showPluginConfigPage(0, 0);
+ showPluginConfigPage(nullptr, 0);
}
void KateMainWindow::showPluginConfigPage(KTextEditor::Plugin *configpageinterface, uint id)
@@ -827,7 +827,7 @@ void KateMainWindow::mSlotFixOpenWithMenu()
QMimeType mime = db.mimeTypeForName(activeView->document()->mimeType());
//qCDebug(LOG_KATE) << "mime type: " << mime.name();
- QAction *a = 0;
+ QAction *a = nullptr;
KService::List offers = KMimeTypeTrader::self()->query(mime.name(), QStringLiteral("Application"));
// add all default open-with-actions except "Kate"
for (KService::List::Iterator it = offers.begin(); it != offers.end(); ++it) {
@@ -1070,7 +1070,7 @@ void KateMainWindow::queueModifiedOnDisc(KTextEditor::Document *doc)
}
bool modOnDisk = (uint)docInfo->modifiedOnDisc;
- if (s_modOnHdDialog == 0 && modOnDisk) {
+ if (s_modOnHdDialog == nullptr && modOnDisk) {
DocVector list;
list.append(doc);
@@ -1080,7 +1080,7 @@ void KateMainWindow::queueModifiedOnDisc(KTextEditor::Document *doc)
s_modOnHdDialog->exec();
delete s_modOnHdDialog; // s_modOnHdDialog is set to 0 in destructor of KateMwModOnHdDialog (jowenn!!!)
m_modignore = false;
- } else if (s_modOnHdDialog != 0) {
+ } else if (s_modOnHdDialog != nullptr) {
s_modOnHdDialog->addDocument(doc);
}
}
@@ -1098,7 +1098,7 @@ QObject *KateMainWindow::pluginView(const QString &name)
{
KTextEditor::Plugin *plugin = KateApp::self()->pluginManager()->plugin(name);
if (!plugin) {
- return 0;
+ return nullptr;
}
return m_pluginViews.contains(plugin) ? m_pluginViews.value(plugin) : 0;
diff --git a/kate/katemainwindow.h b/kate/katemainwindow.h
index 7112420..ba514a4 100644
--- a/kate/katemainwindow.h
+++ b/kate/katemainwindow.h
@@ -118,7 +118,7 @@ public:
/*reimp*/ void saveGlobalProperties(KConfig *sessionConfig) Q_DECL_OVERRIDE;
public:
- bool queryClose_internal(KTextEditor::Document *doc = NULL);
+ bool queryClose_internal(KTextEditor::Document *doc = nullptr);
/**
* save the settings, size and state of this window in
@@ -383,7 +383,7 @@ public Q_SLOTS:
*/
void splitView(Qt::Orientation orientation)
{
- m_viewManager->splitViewSpace(0L, orientation);
+ m_viewManager->splitViewSpace(nullptr, orientation);
}
/**
@@ -529,7 +529,7 @@ private:
class BarState
{
public:
- BarState(): m_bar(0), m_state(false) {}
+ BarState(): m_bar(nullptr), m_state(false) {}
BarState(QWidget *bar): m_bar(bar), m_state(false) {}
~BarState() {}
QWidget *bar() {
@@ -550,7 +550,7 @@ private:
public:
static void unsetModifiedOnDiscDialogIfIf(KateMwModOnHdDialog *diag) {
if (s_modOnHdDialog == diag) {
- s_modOnHdDialog = 0;
+ s_modOnHdDialog = nullptr;
}
}
private:
diff --git a/kate/katemdi.cpp b/kate/katemdi.cpp
index 7f227d6..a5bd777 100644
--- a/kate/katemdi.cpp
+++ b/kate/katemdi.cpp
@@ -212,7 +212,7 @@ ToolView::ToolView(MainWindow *mainwin, Sidebar *sidebar, QWidget *parent)
: QFrame(parent)
, m_mainWin(mainwin)
, m_sidebar(sidebar)
- , m_toolbar(0)
+ , m_toolbar(nullptr)
, m_toolVisible(false)
, persistent(false)
{
@@ -287,8 +287,8 @@ void ToolView::actionEvent(QActionEvent* event)
Sidebar::Sidebar(KMultiTabBar::KMultiTabBarPosition pos, MainWindow *mainwin, QWidget *parent)
: KMultiTabBar(pos, parent)
, m_mainWin(mainwin)
- , m_splitter(0)
- , m_ownSplit(0)
+ , m_splitter(nullptr)
+ , m_ownSplit(nullptr)
, m_lastSize(0)
{
hide();
@@ -716,7 +716,7 @@ void Sidebar::saveSession(KConfigGroup &config)
MainWindow::MainWindow(QWidget *parentWidget)
: KParts::MainWindow(parentWidget, Qt::Window)
, m_sidebarsVisible(true)
- , m_restoreConfig(0)
+ , m_restoreConfig(nullptr)
, m_guiClient(new GUIClient(this))
{
// init the internal widgets
@@ -795,7 +795,7 @@ QWidget *MainWindow::centralWidget() const
ToolView *MainWindow::createToolView(KTextEditor::Plugin *plugin, const QString &identifier, KMultiTabBar::KMultiTabBarPosition pos, const QIcon &icon, const QString &text)
{
if (m_idToWidget[identifier]) {
- return 0;
+ return nullptr;
}
// try the restore config to figure out real pos
@@ -804,7 +804,7 @@ ToolView *MainWindow::createToolView(KTextEditor::Plugin *plugin, const QString
pos = (KMultiTabBar::KMultiTabBarPosition) cg.readEntry(QString::fromLatin1("Kate-MDI-ToolView-%1-Position").arg(identifier), int(pos));
}
- ToolView *v = m_sidebars[pos]->addWidget(icon, text, 0);
+ ToolView *v = m_sidebars[pos]->addWidget(icon, text, nullptr);
v->id = identifier;
v->plugin = plugin;
@@ -1010,7 +1010,7 @@ void MainWindow::finishRestore()
}
// clear this stuff, we are done ;)
- m_restoreConfig = 0;
+ m_restoreConfig = nullptr;
m_restoreGroup.clear();
}
diff --git a/kate/katemdi.h b/kate/katemdi.h
index 570cb21..680ebb3 100644
--- a/kate/katemdi.h
+++ b/kate/katemdi.h
@@ -274,7 +274,7 @@ public:
/**
* Constructor
*/
- MainWindow(QWidget *parentWidget = 0);
+ MainWindow(QWidget *parentWidget = nullptr);
/**
* Destructor
diff --git a/kate/katemwmodonhddialog.cpp b/kate/katemwmodonhddialog.cpp
index 98134c1..b8ac4ff 100644
--- a/kate/katemwmodonhddialog.cpp
+++ b/kate/katemwmodonhddialog.cpp
@@ -60,8 +60,8 @@ public:
KateMwModOnHdDialog::KateMwModOnHdDialog(DocVector docs, QWidget *parent, const char *name)
: QDialog(parent),
- m_proc(0),
- m_diffFile(0),
+ m_proc(nullptr),
+ m_diffFile(nullptr),
m_blockAddDocument(false)
{
setWindowTitle(i18n("Documents Modified on Disk"));
@@ -138,7 +138,7 @@ KateMwModOnHdDialog::KateMwModOnHdDialog(DocVector docs, QWidget *parent, const
buttons->addButton(reloadButton, QDialogButtonBox::DestructiveRole);
connect(reloadButton, &QPushButton::clicked, this, &KateMwModOnHdDialog::slotReload);
- slotSelectionChanged(NULL, NULL);
+ slotSelectionChanged(nullptr, nullptr);
}
KateMwModOnHdDialog::~KateMwModOnHdDialog()
@@ -297,11 +297,11 @@ void KateMwModOnHdDialog::slotDataAvailable()
void KateMwModOnHdDialog::slotPDone()
{
setCursor(Qt::ArrowCursor);
- slotSelectionChanged(twDocuments->currentItem(), 0);
+ slotSelectionChanged(twDocuments->currentItem(), nullptr);
const QProcess::ExitStatus es = m_proc->exitStatus();
delete m_proc;
- m_proc = 0;
+ m_proc = nullptr;
if (es != QProcess::NormalExit) {
KMessageBox::sorry(this,
@@ -309,7 +309,7 @@ void KateMwModOnHdDialog::slotPDone()
"diff(1) is installed and in your PATH."),
i18n("Error Creating Diff"));
delete m_diffFile;
- m_diffFile = 0;
+ m_diffFile = nullptr;
return;
}
@@ -318,14 +318,14 @@ void KateMwModOnHdDialog::slotPDone()
i18n("Ignoring amount of white space changed, the files are identical."),
i18n("Diff Output"));
delete m_diffFile;
- m_diffFile = 0;
+ m_diffFile = nullptr;
return;
}
m_diffFile->setAutoRemove(false);
QUrl url = QUrl::fromLocalFile(m_diffFile->fileName());
delete m_diffFile;
- m_diffFile = 0;
+ m_diffFile = nullptr;
// KRun::runUrl should delete the file, once the client exits
KRun::runUrl(url, QStringLiteral("text/x-patch"), this, true);
diff --git a/kate/katemwmodonhddialog.h b/kate/katemwmodonhddialog.h
index 9092a75..266522b 100644
--- a/kate/katemwmodonhddialog.h
+++ b/kate/katemwmodonhddialog.h
@@ -40,7 +40,7 @@ class KateMwModOnHdDialog : public QDialog
{
Q_OBJECT
public:
- explicit KateMwModOnHdDialog(DocVector docs, QWidget *parent = 0, const char *name = 0);
+ explicit KateMwModOnHdDialog(DocVector docs, QWidget *parent = nullptr, const char *name = nullptr);
~KateMwModOnHdDialog();
void addDocument(KTextEditor::Document *doc);
diff --git a/kate/katepluginmanager.cpp b/kate/katepluginmanager.cpp
index 3f0f5f9..19b44ea 100644
--- a/kate/katepluginmanager.cpp
+++ b/kate/katepluginmanager.cpp
@@ -205,7 +205,7 @@ void KatePluginManager::unloadPlugin(KatePluginInfo *item)
disablePluginGUI(item);
delete item->plugin;
KTextEditor::Plugin *plugin = item->plugin;
- item->plugin = 0L;
+ item->plugin = nullptr;
item->load = false;
emit KateApp::self()->wrapper()->pluginDeleted(item->saveName(), plugin);
}
@@ -249,7 +249,7 @@ void KatePluginManager::enablePluginGUI(KatePluginInfo *item)
// enable the gui for all mainwindows...
for (int i = 0; i < KateApp::self()->mainWindowsCount(); i++) {
- enablePluginGUI(item, KateApp::self()->mainWindow(i), 0);
+ enablePluginGUI(item, KateApp::self()->mainWindow(i), nullptr);
}
}
@@ -291,7 +291,7 @@ KTextEditor::Plugin *KatePluginManager::plugin(const QString &name)
* name known?
*/
if (!m_name2Plugin.contains(name)) {
- return 0;
+ return nullptr;
}
/**
@@ -311,7 +311,7 @@ class KTextEditor::Plugin *KatePluginManager::loadPlugin(const QString &name, bo
* name known?
*/
if (!m_name2Plugin.contains(name)) {
- return 0;
+ return nullptr;
}
/**
@@ -319,7 +319,7 @@ class KTextEditor::Plugin *KatePluginManager::loadPlugin(const QString &name, bo
*/
loadPlugin(m_name2Plugin.value(name));
if (!m_name2Plugin.value(name)->plugin) {
- return 0;
+ return nullptr;
}
/**
diff --git a/kate/katepluginmanager.h b/kate/katepluginmanager.h
index 4274fdc..aac474b 100644
--- a/kate/katepluginmanager.h
+++ b/kate/katepluginmanager.h
@@ -61,7 +61,7 @@ public:
void unloadAllPlugins();
- void enableAllPluginsGUI(KateMainWindow *win, KConfigBase *config = 0);
+ void enableAllPluginsGUI(KateMainWindow *win, KConfigBase *config = nullptr);
void disableAllPluginsGUI(KateMainWindow *win);
void loadConfig(KConfig *);
@@ -70,7 +70,7 @@ public:
bool loadPlugin(KatePluginInfo *item);
void unloadPlugin(KatePluginInfo *item);
- void enablePluginGUI(KatePluginInfo *item, KateMainWindow *win, KConfigBase *config = 0);
+ void enablePluginGUI(KatePluginInfo *item, KateMainWindow *win, KConfigBase *config = nullptr);
void enablePluginGUI(KatePluginInfo *item);
void disablePluginGUI(KatePluginInfo *item, KateMainWindow *win);
diff --git a/kate/katetabbar.cpp b/kate/katetabbar.cpp
index 3d17c3c..9aed552 100644
--- a/kate/katetabbar.cpp
+++ b/kate/katetabbar.cpp
@@ -489,7 +489,7 @@ void KateTabBar::paintEvent(QPaintEvent *event)
QStyleOption option;
option.initFrom(d->tabButtons[0]);
option.state |= QStyle::State_Horizontal;
- const int w = style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent, 0, this);
+ const int w = style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent, nullptr, this);
const int offset = w / 2;
option.rect.setWidth(w);
option.rect.moveTop(0);
diff --git a/kate/katetabbar.h b/kate/katetabbar.h
index 2f7b91a..66926c8 100644
--- a/kate/katetabbar.h
+++ b/kate/katetabbar.h
@@ -43,7 +43,7 @@ class KateTabBar : public QWidget
Q_PROPERTY(bool isActive READ isActive WRITE setActive)
public:
- explicit KateTabBar(QWidget *parent = 0);
+ explicit KateTabBar(QWidget *parent = nullptr);
virtual ~KateTabBar();
/**
diff --git a/kate/katetabbutton.cpp b/kate/katetabbutton.cpp
index c50aa7b..dd999df 100644
--- a/kate/katetabbutton.cpp
+++ b/kate/katetabbutton.cpp
@@ -75,8 +75,8 @@ QSize TabCloseButton::sizeHint() const
ensurePolished();
// read the metrics from the style
- const int w = style()->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, 0, this);
- const int h = style()->pixelMetric(QStyle::PM_TabCloseIndicatorHeight, 0, this);
+ const int w = style()->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, nullptr, this);
+ const int h = style()->pixelMetric(QStyle::PM_TabCloseIndicatorHeight, nullptr, this);
return QSize(w, h);
}
@@ -95,7 +95,7 @@ void TabCloseButton::leaveEvent(QEvent *event)
KateTabButton::KateTabButton(const QString &text, QWidget *parent)
: QAbstractButton(parent)
- , m_geometryAnimation(0)
+ , m_geometryAnimation(nullptr)
{
setCheckable(true);
setFocusPolicy(Qt::NoFocus);
@@ -103,7 +103,7 @@ KateTabButton::KateTabButton(const QString &text, QWidget *parent)
setText(text);
// add close button
- const int margin = style()->pixelMetric(QStyle::PM_ButtonMargin, 0, this);
+ const int margin = style()->pixelMetric(QStyle::PM_ButtonMargin, nullptr, this);
m_closeButton = new TabCloseButton(this);
QHBoxLayout * hbox = new QHBoxLayout(this);
hbox->setSpacing(0);
@@ -133,7 +133,7 @@ void KateTabButton::paintEvent(QPaintEvent *ev)
}
// compute sane margins
- const int margin = style()->pixelMetric(QStyle::PM_ButtonMargin, 0, this);
+ const int margin = style()->pixelMetric(QStyle::PM_ButtonMargin, nullptr, this);
const int barMargin = margin / 2;
const int barHeight = ceil(height() / 10.0);
@@ -236,7 +236,7 @@ void KateTabButton::moveEvent(QMoveEvent *event)
// the tab buttons geometry, we need to adjust the width by the separator's
// width to avoid artifacts
if (parentWidget()) {
- const int w = style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent, 0, this);
+ const int w = style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent, nullptr, this);
QRect rect = geometry();
rect.moveLeft(event->oldPos().x());
rect.adjust(-w, 0, w, 0);
@@ -268,7 +268,7 @@ void KateTabButton::setAnimatedGeometry(const QRect & startGeom,
}
// if the style does not want animations, just set geometry
- if (! style()->styleHint(QStyle::SH_Widget_Animate, 0, this)
+ if (! style()->styleHint(QStyle::SH_Widget_Animate, nullptr, this)
|| (isVisible() && endGeom == startGeom))
{
setGeometry(endGeom);
diff --git a/kate/katetabbutton.h b/kate/katetabbutton.h
index 8888da3..1029049 100644
--- a/kate/katetabbutton.h
+++ b/kate/katetabbutton.h
@@ -32,7 +32,7 @@ class TabCloseButton : public QAbstractButton
public:
// constructor
- TabCloseButton(QWidget * parent = 0);
+ TabCloseButton(QWidget * parent = nullptr);
// paint close button depending on its state
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
// returns the size hint depending on the style
@@ -60,7 +60,7 @@ public:
/**
* Constructs a new tab bar button with \a text and \a parent.
*/
- KateTabButton(const QString &text, QWidget *parent = 0);
+ KateTabButton(const QString &text, QWidget *parent = nullptr);
/**
* Returns @e true, if the tabbar is the currently active tab bar.
diff --git a/kate/kateviewmanager.cpp b/kate/kateviewmanager.cpp
index 1c99f1c..4fc4bd8 100644
--- a/kate/kateviewmanager.cpp
+++ b/kate/kateviewmanager.cpp
@@ -66,7 +66,7 @@ KateViewManager::KateViewManager(QWidget *parentW, KateMainWindow *parent)
// important, set them up, as we use them in other methodes
setupActions();
- KateViewSpace *vs = new KateViewSpace(this, 0);
+ KateViewSpace *vs = new KateViewSpace(this, nullptr);
addWidget(vs);
vs->setActive(true);
@@ -329,7 +329,7 @@ KTextEditor::View *KateViewManager::openUrlWithView(const QUrl &url, const QStri
KTextEditor::Document *doc = KateApp::self()->documentManager()->openUrl(url, encoding);
if (!doc) {
- return 0;
+ return nullptr;
}
if (!doc->url().isEmpty()) {
@@ -520,13 +520,13 @@ KateViewSpace *KateViewManager::activeViewSpace()
}
Q_ASSERT(false);
- return 0L;
+ return nullptr;
}
KTextEditor::View *KateViewManager::activeView()
{
if (m_activeViewRunning) {
- return 0L;
+ return nullptr;
}
m_activeViewRunning = true;
@@ -561,7 +561,7 @@ KTextEditor::View *KateViewManager::activeView()
m_activeViewRunning = false;
// no views exists!
- return 0L;
+ return nullptr;
}
void KateViewManager::setActiveSpace(KateViewSpace *vs)
@@ -1053,7 +1053,7 @@ void KateViewManager::restoreViewConfiguration(const KConfigGroup &config)
delete widget(0);
}
- KateViewSpace *vs = new KateViewSpace(this, 0);
+ KateViewSpace *vs = new KateViewSpace(this, nullptr);
addWidget(vs);
vs->setActive(true);
m_viewSpaceList.append(vs);
@@ -1134,7 +1134,7 @@ void KateViewManager::restoreSplitter(const KConfigBase *configBase, const QStri
for (QStringList::Iterator it = children.begin(); it != children.end(); ++it) {
// for a viewspace, create it and open all documents therein.
if ((*it).startsWith(viewConfGrp + QStringLiteral("-ViewSpace"))) {
- KateViewSpace *vs = new KateViewSpace(this, 0);
+ KateViewSpace *vs = new KateViewSpace(this, nullptr);
m_viewSpaceList.append(vs);
// make active so that the view created in restoreConfig has this
// new view space as parent.
diff --git a/kate/kateviewmanager.h b/kate/kateviewmanager.h
index c52040a..305376d 100644
--- a/kate/kateviewmanager.h
+++ b/kate/kateviewmanager.h
@@ -116,7 +116,7 @@ public:
* create a new document.
* Can return NULL.
*/
- KTextEditor::View *createView(KTextEditor::Document *doc = 0L, KateViewSpace *vs = nullptr);
+ KTextEditor::View *createView(KTextEditor::Document *doc = nullptr, KateViewSpace *vs = nullptr);
private:
bool deleteView(KTextEditor::View *view);
@@ -179,7 +179,7 @@ public Q_SLOTS:
* The orientation of the new splitter is determined by the value of o.
* Note: horizontal splitter means vertically aligned views.
*/
- void splitViewSpace(KateViewSpace *vs = 0L, Qt::Orientation o = Qt::Horizontal);
+ void splitViewSpace(KateViewSpace *vs = nullptr, Qt::Orientation o = Qt::Horizontal);
/**
* Close the view space that contains the given view. If no view was
@@ -201,7 +201,7 @@ public Q_SLOTS:
/** Splits the active viewspace horizontally */
void slotSplitViewSpaceHoriz() {
- splitViewSpace(0L, Qt::Vertical);
+ splitViewSpace(nullptr, Qt::Vertical);
}
/** Splits the active viewspace vertically */
diff --git a/kate/kateviewspace.cpp b/kate/kateviewspace.cpp
index b72ee29..50791cd 100644
--- a/kate/kateviewspace.cpp
+++ b/kate/kateviewspace.cpp
@@ -471,7 +471,7 @@ void KateViewSpace::documentDestroyed(QObject *doc)
m_lruDocList.remove(m_lruDocList.indexOf(invalidDoc));
// disconnect entirely
- disconnect(doc, 0, this, 0);
+ disconnect(doc, nullptr, this, nullptr);
// case: there was no view created yet, but still a button was added
if (m_docToTabId.contains(invalidDoc)) {
diff --git a/kate/kateviewspace.h b/kate/kateviewspace.h
index 425bc56..ed844cd 100644
--- a/kate/kateviewspace.h
+++ b/kate/kateviewspace.h
@@ -39,7 +39,7 @@ class KateViewSpace : public QWidget
Q_OBJECT
public:
- explicit KateViewSpace(KateViewManager *, QWidget *parent = 0, const char *name = 0);
+ explicit KateViewSpace(KateViewManager *, QWidget *parent = nullptr, const char *name = nullptr);
/**
* Returns \e true, if this view space is currently the active view space.
diff --git a/kate/main.cpp b/kate/main.cpp
index 342cd5d..dcaf184 100644
--- a/kate/main.cpp
+++ b/kate/main.cpp
@@ -418,7 +418,7 @@ int main(int argc, char **argv)
// set chosen codec
QTextCodec *codec = parser.isSet(useEncodingOption) ?
- QTextCodec::codecForName(parser.value(useEncodingOption).toUtf8()) : 0;
+ QTextCodec::codecForName(parser.value(useEncodingOption).toUtf8()) : nullptr;
if (codec) {
input.setCodec(codec);
diff --git a/kate/session/katesession.cpp b/kate/session/katesession.cpp
index aa5a37e..4f64b78 100644
--- a/kate/session/katesession.cpp
+++ b/kate/session/katesession.cpp
@@ -38,7 +38,7 @@ KateSession::KateSession(const QString &file, const QString &name, const bool an
, m_file(file)
, m_anonymous(anonymous)
, m_documents(0)
- , m_config(0)
+ , m_config(nullptr)
, m_timestamp()
{
Q_ASSERT(!m_file.isEmpty());
diff --git a/kate/session/katesession.h b/kate/session/katesession.h
index cd40bc3..a963b06 100644
--- a/kate/session/katesession.h
+++ b/kate/session/katesession.h
@@ -121,7 +121,7 @@ private:
* @param anonymous anonymous flag
* @param config if specified, the session will copy configuration from the KConfig instead of opening the file
*/
- KateSession(const QString &file, const QString &name, const bool anonymous, const KConfig *config = 0);
+ KateSession(const QString &file, const QString &name, const bool anonymous, const KConfig *config = nullptr);
private:
QString m_name;
diff --git a/kate/session/katesessionchooser.cpp b/kate/session/katesessionchooser.cpp
index 8e4e46f..857a3d8 100644
--- a/kate/session/katesessionchooser.cpp
+++ b/kate/session/katesessionchooser.cpp
@@ -117,7 +117,7 @@ KateSessionChooser::KateSessionChooser(QWidget *parent, const QString &lastSessi
connect(newButton, SIGNAL(clicked()), this, SLOT(slotNew()));
setResult(resultNone);
- selectionChanged(NULL, NULL);
+ selectionChanged(nullptr, nullptr);
}
KateSessionChooser::~KateSessionChooser()
diff --git a/kate/session/katesessionmanagedialog.cpp b/kate/session/katesessionmanagedialog.cpp
index a1191a6..de8a6ea 100644
--- a/kate/session/katesessionmanagedialog.cpp
+++ b/kate/session/katesessionmanagedialog.cpp
@@ -95,7 +95,7 @@ KateSessionManageDialog::KateSessionManageDialog(QWidget *parent)
connect(m_openButton, SIGNAL(clicked()), this, SLOT(open()));
// trigger action update
- selectionChanged(NULL, NULL);
+ selectionChanged(nullptr, nullptr);
}
KateSessionManageDialog::~KateSessionManageDialog()
@@ -108,7 +108,7 @@ void KateSessionManageDialog::slotClose()
void KateSessionManageDialog::selectionChanged(QTreeWidgetItem *current, QTreeWidgetItem *)
{
- const bool validItem = (current != NULL);
+ const bool validItem = (current != nullptr);
m_rename->setEnabled(validItem);
m_del->setEnabled(validItem && (static_cast<KateSessionChooserItem *>(current))->session != KateApp::self()->sessionManager()->activeSession());
diff --git a/kate/session/katesessionmanager.cpp b/kate/session/katesessionmanager.cpp
index bf3a0b1..11509e8 100644
--- a/kate/session/katesessionmanager.cpp
+++ b/kate/session/katesessionmanager.cpp
@@ -121,12 +121,12 @@ bool KateSessionManager::activateSession(KateSession::Ptr session,
//check if the requested session is already open in another instance
KateRunningInstanceMap instances;
if (!fillinRunningKateAppInstances(&instances)) {
- KMessageBox::error(0, i18n("Internal error: there is more than one instance open for a given session."));
+ KMessageBox::error(nullptr, i18n("Internal error: there is more than one instance open for a given session."));
return false;
}
if (instances.contains(session->name())) {
- if (KMessageBox::questionYesNo(0, i18n("Session '%1' is already opened in another kate instance, change there instead of reopening?", session->name()),
+ if (KMessageBox::questionYesNo(nullptr, i18n("Session '%1' is already opened in another kate instance, change there instead of reopening?", session->name()),
QString(), KStandardGuiItem::yes(), KStandardGuiItem::no(), QStringLiteral("katesessionmanager_switch_instance")) == KMessageBox::Yes) {
instances[session->name()]->dbus_if->call(QStringLiteral("activate"));
cleanupRunningKateAppInstanceMap(&instances);
@@ -365,7 +365,7 @@ bool KateSessionManager::chooseSession()
return true;
}
- QScopedPointer<KateSessionChooser> chooser(new KateSessionChooser(0, lastSession));
+ QScopedPointer<KateSessionChooser> chooser(new KateSessionChooser(nullptr, lastSession));
const int res = chooser->exec();
bool success = true;
@@ -416,7 +416,7 @@ void KateSessionManager::sessionNew()
void KateSessionManager::sessionOpen()
{
- QScopedPointer<KateSessionOpenDialog> chooser(new KateSessionOpenDialog(0));
+ QScopedPointer<KateSessionOpenDialog> chooser(new KateSessionOpenDialog(nullptr));
const int res = chooser->exec();
@@ -460,7 +460,7 @@ bool KateSessionManager::newSessionName()
}
if (name.isEmpty()) {
- KMessageBox::sorry(0, i18n("To save a session, you must specify a name."), i18n("Missing Session Name"));
+ KMessageBox::sorry(nullptr, i18n("To save a session, you must specify a name."), i18n("Missing Session Name"));
continue;
}
@@ -483,7 +483,7 @@ bool KateSessionManager::newSessionName()
void KateSessionManager::sessionManage()
{
- QScopedPointer<KateSessionManageDialog>(new KateSessionManageDialog(0))->exec();
+ QScopedPointer<KateSessionManageDialog>(new KateSessionManageDialog(nullptr))->exec();
}
QString KateSessionManager::anonymousSessionFile() const
diff --git a/kate/session/katesessionmanager.h b/kate/session/katesessionmanager.h
index 15a710e..ee05d6f 100644
--- a/kate/session/katesessionmanager.h
+++ b/kate/session/katesessionmanager.h
@@ -33,7 +33,7 @@ class KATE_TESTS_EXPORT KateSessionManager : public QObject
Q_OBJECT
public:
- KateSessionManager(QObject *parent = 0, const QString &sessionsDir = QString());
+ KateSessionManager(QObject *parent = nullptr, const QString &sessionsDir = QString());
~KateSessionManager();
/**
diff --git a/kate/session/katesessionsaction.h b/kate/session/katesessionsaction.h
index 0fd4ea4..3b48a0a 100644
--- a/kate/session/katesessionsaction.h
+++ b/kate/session/katesessionsaction.h
@@ -31,7 +31,7 @@ class KATE_TESTS_EXPORT KateSessionsAction : public KActionMenu
Q_OBJECT
public:
- KateSessionsAction(const QString &text, QObject *parent, KateSessionManager *manager = 0);
+ KateSessionsAction(const QString &text, QObject *parent, KateSessionManager *manager = nullptr);
~KateSessionsAction() {
}
diff --git a/kwrite/kwrite.cpp b/kwrite/kwrite.cpp
index ad1d919..d18ed0f 100644
--- a/kwrite/kwrite.cpp
+++ b/kwrite/kwrite.cpp
@@ -60,15 +60,15 @@ QList<KTextEditor::Document *> KWrite::docList;
QList<KWrite *> KWrite::winList;
KWrite::KWrite(KTextEditor::Document *doc)
- : m_view(0)
- , m_recentFiles(0)
- , m_paShowPath(0)
- , m_paShowMenuBar(0)
- , m_paShowStatusBar(0)
- , m_activityResource(0)
+ : m_view(nullptr)
+ , m_recentFiles(nullptr)
+ , m_paShowPath(nullptr)
+ , m_paShowMenuBar(nullptr)
+ , m_paShowStatusBar(nullptr)
+ , m_activityResource(nullptr)
{
if (!doc) {
- doc = KTextEditor::Editor::instance()->createDocument(0);
+ doc = KTextEditor::Editor::instance()->createDocument(nullptr);
// enable the modified on disk warning dialogs if any
if (qobject_cast<KTextEditor::ModificationInterface *>(doc)) {
@@ -481,7 +481,7 @@ void KWrite::restore()
for (int z = 1; z <= docs; z++) {
buf = QString::fromLatin1("Document %1").arg(z);
KConfigGroup cg(config, buf);
- doc = KTextEditor::Editor::instance()->createDocument(0);
+ doc = KTextEditor::Editor::instance()->createDocument(nullptr);
doc->readSessionConfig(cg);
docList.append(doc);
}
diff --git a/kwrite/kwrite.h b/kwrite/kwrite.h
index 01cbd85..a3e0bf0 100644
--- a/kwrite/kwrite.h
+++ b/kwrite/kwrite.h
@@ -46,7 +46,7 @@ class KWrite : public KParts::MainWindow
Q_OBJECT
public:
- KWrite(KTextEditor::Document * = 0L);
+ KWrite(KTextEditor::Document * = nullptr);
~KWrite();
void loadURL(const QUrl &url);
diff --git a/kwrite/main.cpp b/kwrite/main.cpp
index 68a055e..62f4f2d 100644
--- a/kwrite/main.cpp
+++ b/kwrite/main.cpp
@@ -199,7 +199,7 @@ extern "C" Q_DECL_EXPORT int main(int argc, char **argv)
bool nav = false;
int line = 0, column = 0;
- QTextCodec *codec = parser.isSet(QStringLiteral("encoding")) ? QTextCodec::codecForName(parser.value(QStringLiteral("encoding")).toLocal8Bit()) : 0;
+ QTextCodec *codec = parser.isSet(QStringLiteral("encoding")) ? QTextCodec::codecForName(parser.value(QStringLiteral("encoding")).toLocal8Bit()) : nullptr;
if (parser.isSet(QStringLiteral("line"))) {
line = parser.value(QStringLiteral("line")).toInt() - 1;
@@ -268,7 +268,7 @@ extern "C" Q_DECL_EXPORT int main(int argc, char **argv)
t->view()->setCursorPosition(info.cursor);
}
} else {
- KMessageBox::sorry(0, i18n("The file '%1' could not be opened: it is not a normal file, it is a folder.", info.url.toString()));
+ KMessageBox::sorry(nullptr, i18n("The file '%1' could not be opened: it is not a normal file, it is a folder.", info.url.toString()));
}
}
if (!docs_opened) {