Commit aaa517e1 authored by Laurent Montel's avatar Laurent Montel

Add nullptr

parent ebfaebb8
......@@ -267,7 +267,7 @@ void SmallJobLabel::slotSetJobCount(int jobCount)
setText(i18np("%1 job", "%1 jobs", jobCount));
setToolTip(i18np("%1 pending job", "%1 pending jobs", jobCount));
if (style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) {
if (style()->styleHint(QStyle::SH_Widget_Animate, nullptr, this)) {
setFixedWidth(sizeHint().width());
m_action->setVisible(true);
return;
......@@ -288,7 +288,7 @@ void SmallJobLabel::slotSetJobCount(int jobCount)
m_timeLine->start();
}
} else {
if (style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) {
if (style()->styleHint(QStyle::SH_Widget_Animate, nullptr, this)) {
setFixedWidth(0);
m_action->setVisible(false);
return;
......@@ -566,11 +566,11 @@ void Bin::abortOperations()
}
}
delete m_rootFolder;
m_rootFolder = NULL;
m_rootFolder = nullptr;
delete m_itemView;
m_itemView = NULL;
m_itemView = nullptr;
delete m_jobManager;
m_jobManager = NULL;
m_jobManager = nullptr;
blockSignals(false);
}
......@@ -1868,7 +1868,7 @@ void Bin::showClipProperties(ProjectClip *clip, bool forceRefresh)
}
m_propertiesPanel->setProperty("clipId", clip->clipId());
QVBoxLayout *lay = static_cast<QVBoxLayout *>(m_propertiesPanel->layout());
if (lay == 0) {
if (lay == nullptr) {
lay = new QVBoxLayout(m_propertiesPanel);
m_propertiesPanel->setLayout(lay);
}
......@@ -2341,7 +2341,7 @@ bool Bin::hasPendingJob(const QString &id, AbstractClipJob::JOBTYPE type)
void Bin::slotCreateProjectClip()
{
QAction *act = qobject_cast<QAction *>(sender());
if (act == 0) {
if (act == nullptr) {
// Cannot access triggering action, something is wrong
qCDebug(KDENLIVE_LOG) << "// Error in clip creation action";
return;
......@@ -2842,7 +2842,7 @@ void Bin::slotStartClipJob(bool enable)
Q_UNUSED(enable)
QAction *act = qobject_cast<QAction *>(sender());
if (act == 0) {
if (act == nullptr) {
// Cannot access triggering action, something is wrong
qCDebug(KDENLIVE_LOG) << "// Error in clip job action";
return;
......
......@@ -46,7 +46,7 @@ Core::~Core()
delete m_projectManager;
delete m_binController;
delete m_monitorManager;
m_self = 0;
m_self = nullptr;
}
void Core::build(MainWindow *mainWindow)
......
......@@ -647,13 +647,13 @@ void ProfilesDialog::saveProfile(MltVideoProfile &profile, QString profilePath)
}
QFile file(profilePath);
if (!file.open(QIODevice::WriteOnly)) {
KMessageBox::sorry(0, i18n("Cannot open file %1", profilePath));
KMessageBox::sorry(nullptr, i18n("Cannot open file %1", profilePath));
return;
}
QTextStream out(&file);
out << "description=" << profile.description << '\n' << "frame_rate_num=" << profile.frame_rate_num << '\n' << "frame_rate_den=" << profile.frame_rate_den << '\n' << "width=" << profile.width << '\n' << "height=" << profile.height << '\n' << "progressive=" << profile.progressive << '\n' << "sample_aspect_num=" << profile.sample_aspect_num << '\n' << "sample_aspect_den=" << profile.sample_aspect_den << '\n' << "display_aspect_num=" << profile.display_aspect_num << '\n' << "display_aspect_den=" << profile.display_aspect_den << '\n' << "colorspace=" << profile.colorspace << '\n';
if (file.error() != QFile::NoError) {
KMessageBox::error(0, i18n("Cannot write to file %1", profilePath));
KMessageBox::error(nullptr, i18n("Cannot write to file %1", profilePath));
}
file.close();
profile.path = profilePath;
......
......@@ -587,7 +587,7 @@ bool RenderWidget::saveProfile(QDomElement newprofile)
profiles.setAttribute(QStringLiteral("version"), 1);
doc.appendChild(profiles);
}
int version = profiles.attribute(QStringLiteral("version"), 0).toInt();
int version = profiles.attribute(QStringLiteral("version"), nullptr).toInt();
if (version < 1) {
doc.clear();
profiles = doc.createElement(QStringLiteral("profiles"));
......@@ -770,7 +770,7 @@ void RenderWidget::slotEditProfile()
doc.appendChild(profiles);
}
int version = profiles.attribute(QStringLiteral("version"), 0).toInt();
int version = profiles.attribute(QStringLiteral("version"), nullptr).toInt();
if (version < 1) {
doc.clear();
profiles = doc.createElement(QStringLiteral("profiles"));
......@@ -936,7 +936,7 @@ void RenderWidget::updateButtons()
void RenderWidget::focusFirstVisibleItem(const QString &profile)
{
QTreeWidgetItem *item = 0;
QTreeWidgetItem *item = nullptr;
if (!profile.isEmpty()) {
QList<QTreeWidgetItem *> items = m_view.formats->findItems(profile, Qt::MatchExactly | Qt::MatchRecursive);
if (!items.isEmpty()) {
......@@ -1902,7 +1902,7 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
if (editable || groups.isEmpty()) {
QDomElement profiles = doc.documentElement();
if (editable && profiles.attribute(QStringLiteral("version"), 0).toInt() < 1) {
if (editable && profiles.attribute(QStringLiteral("version"), nullptr).toInt() < 1) {
// this is an old profile version, update it
QDomDocument newdoc;
QDomElement newprofiles = newdoc.createElement(QStringLiteral("profiles"));
......@@ -1983,7 +1983,7 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
// Check if item with same name already exists and replace it,
// allowing to override default profiles
QTreeWidgetItem *item = 0;
QTreeWidgetItem *item = nullptr;
for (int j = 0; j < groupItem->childCount(); ++j) {
if (groupItem->child(j)->text(0) == profileName) {
item = groupItem->child(j);
......@@ -2478,7 +2478,7 @@ bool RenderWidget::startWaitingRenderJobs()
QFile file(autoscriptFile);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
qCWarning(KDENLIVE_LOG) << "////// ERROR writing to file: " << autoscriptFile;
KMessageBox::error(0, i18n("Cannot write to file %1", autoscriptFile));
KMessageBox::error(nullptr, i18n("Cannot write to file %1", autoscriptFile));
return false;
}
......@@ -2501,7 +2501,7 @@ bool RenderWidget::startWaitingRenderJobs()
// erase itself when rendering is finished
outStream << "rm " << autoscriptFile << '\n' << '\n';
if (file.error() != QFile::NoError) {
KMessageBox::error(0, i18n("Cannot write to file %1", autoscriptFile));
KMessageBox::error(nullptr, i18n("Cannot write to file %1", autoscriptFile));
file.close();
m_blockProcessing = false;
return false;
......
......@@ -447,7 +447,7 @@ void DvdWizardMenu::checkBackgroundType(int ix)
m_view.background_color->setVisible(true);
m_view.background_image->setVisible(false);
m_view.loop_movie->setVisible(false);
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
} else {
......@@ -456,12 +456,12 @@ void DvdWizardMenu::checkBackgroundType(int ix)
if (ix == 1) {
m_view.background_image->clear();
m_view.background_image->setFilter(QStringLiteral("*"));
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
m_view.loop_movie->setVisible(false);
} else {
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
m_view.background_image->clear();
......@@ -491,7 +491,7 @@ void DvdWizardMenu::buildImage()
{
emit completeChanged();
if (m_view.background_image->url().isEmpty()) {
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
return;
......@@ -501,7 +501,7 @@ void DvdWizardMenu::buildImage()
if (m_view.background_list->currentIndex() == 1) {
// image background
if (!pix.load(m_view.background_image->url().toLocalFile())) {
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
return;
......@@ -636,13 +636,13 @@ void DvdWizardMenu::createButtonImages(const QString &selected_image, const QStr
int letterboxHeight = m_height / factor;
target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
}
if (m_safeRect->scene() != 0) {
if (m_safeRect->scene() != nullptr) {
m_scene->removeItem(m_safeRect);
}
if (m_color->scene() != 0) {
if (m_color->scene() != nullptr) {
m_scene->removeItem(m_color);
}
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
prepareUnderLines();
......@@ -684,7 +684,7 @@ void DvdWizardMenu::createBackgroundImage(const QString &img1, bool letterbox)
Q_UNUSED(letterbox)
m_scene->clearSelection();
if (m_safeRect->scene() != 0) {
if (m_safeRect->scene() != nullptr) {
m_scene->removeItem(m_safeRect);
}
bool showBg = false;
......@@ -704,10 +704,10 @@ void DvdWizardMenu::createBackgroundImage(const QString &img1, bool letterbox)
if (menuMovie()) {
showBg = true;
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
if (m_color->scene() != 0) {
if (m_color->scene() != nullptr) {
m_scene->removeItem(m_color);
}
img.fill(Qt::transparent);
......
......@@ -106,7 +106,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
if (item) {
item->setData(0, IdRole, groups.at(i).toElement().attribute(QStringLiteral("list")));
} else {
item = new QTreeWidgetItem((QTreeWidget *)0, QStringList(folderNames.at(i)));
item = new QTreeWidgetItem((QTreeWidget *)nullptr, QStringList(folderNames.at(i)));
item->setData(0, TypeRole, QString::number((int) EffectsList::EFFECT_FOLDER));
item->setData(0, IdRole, groups.at(i).toElement().attribute(QStringLiteral("list")));
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
......@@ -118,7 +118,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
misc = findFolder(i18n("Misc"));
if (misc == nullptr) {
misc = new QTreeWidgetItem((QTreeWidget *)0, QStringList(i18n("Misc")));
misc = new QTreeWidgetItem((QTreeWidget *)nullptr, QStringList(i18n("Misc")));
misc->setData(0, TypeRole, QString::number((int) EffectsList::EFFECT_FOLDER));
misc->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
insertTopLevelItem(0, misc);
......@@ -126,7 +126,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
audio = findFolder(i18n("Audio"));
if (audio == nullptr) {
audio = new QTreeWidgetItem((QTreeWidget *)0, QStringList(i18n("Audio")));
audio = new QTreeWidgetItem((QTreeWidget *)nullptr, QStringList(i18n("Audio")));
audio->setData(0, TypeRole, QString::number((int) EffectsList::EFFECT_FOLDER));
audio->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
insertTopLevelItem(0, audio);
......@@ -134,7 +134,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
custom = findFolder(i18nc("Folder Name", "Custom"));
if (custom == nullptr) {
custom = new QTreeWidgetItem((QTreeWidget *)0, QStringList(i18nc("Folder Name", "Custom")));
custom = new QTreeWidgetItem((QTreeWidget *)nullptr, QStringList(i18nc("Folder Name", "Custom")));
custom->setData(0, TypeRole, QString::number((int) EffectsList::EFFECT_FOLDER));
custom->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
insertTopLevelItem(0, custom);
......@@ -147,7 +147,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
} else {
loadEffects(&MainWindow::videoEffects, misc, &folders, EffectsList::EFFECT_VIDEO, current, &found);
loadEffects(&MainWindow::audioEffects, audio, &folders, EffectsList::EFFECT_AUDIO, current, &found);
loadEffects(&MainWindow::customEffects, custom, static_cast<QList<QTreeWidgetItem *> *>(0), EffectsList::EFFECT_CUSTOM, current, &found);
loadEffects(&MainWindow::customEffects, custom, static_cast<QList<QTreeWidgetItem *> *>(nullptr), EffectsList::EFFECT_CUSTOM, current, &found);
if (!found && !currentFolder.isEmpty()) {
// previously selected effect was removed, focus on its parent folder
for (int i = 0; i < topLevelItemCount(); ++i) {
......
......@@ -675,7 +675,7 @@ QDomDocument initEffects::createDescriptionFromMlt(Mlt::Repository *repository,
}
}
delete metadata;
metadata = 0;
metadata = nullptr;
/*QString outstr;
QTextStream str(&outstr);
ret.save(str, 2);
......
......@@ -96,7 +96,7 @@ KeyframeEdit::~KeyframeEdit()
keyframe_list->blockSignals(true);
keyframe_list->clear();
QLayoutItem *child;
while ((child = m_slidersLayout->takeAt(0)) != 0) {
while ((child = m_slidersLayout->takeAt(0)) != nullptr) {
QWidget *wid = child->widget();
delete child;
delete wid;
......
......@@ -45,7 +45,7 @@ void HideTitleBars::slotShowTitleBars(bool show)
if (show) {
if (dock->isFloating()) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......@@ -55,7 +55,7 @@ void HideTitleBars::slotShowTitleBars(bool show)
QList<QDockWidget *> docked = pCore->window()->tabifiedDockWidgets(dock);
if (docked.isEmpty()) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......@@ -70,7 +70,7 @@ void HideTitleBars::slotShowTitleBars(bool show)
}
if (!hasVisibleDockSibling) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......
......@@ -3900,7 +3900,7 @@ void MainWindow::updateDockTitleBars(bool isTopLevel)
QWidget *bar = dock->titleBarWidget();
if (dock->isFloating()) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......@@ -3908,7 +3908,7 @@ void MainWindow::updateDockTitleBars(bool isTopLevel)
QList<QDockWidget *> docked = pCore->window()->tabifiedDockWidgets(dock);
if (docked.isEmpty()) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......@@ -3923,7 +3923,7 @@ void MainWindow::updateDockTitleBars(bool isTopLevel)
}
if (!hasVisibleDockSibling) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......
......@@ -214,13 +214,13 @@ void ProducerQueue::processFileProperties()
}
if (type == Color) {
path.prepend("color:");
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (type == Text || type == TextTemplate) {
path.prepend("kdenlivetitle:");
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (type == QText) {
path.prepend("qtext:");
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (type == Playlist && !proxyProducer) {
//TODO: "xml" seems to corrupt project fps if different, and "consumer" crashed on audio transition
Mlt::Profile *xmlProfile = new Mlt::Profile();
......@@ -250,9 +250,9 @@ void ProducerQueue::processFileProperties()
continue;
}
m_binController->profile()->set_explicit(true);
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (type == SlideShow) {
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (!url.isValid()) {
//WARNING: when is this case used? Not sure it is working.. JBM/
QDomDocument doc;
......@@ -270,7 +270,7 @@ void ProducerQueue::processFileProperties()
mlt.appendChild(tractor);
producer = new Mlt::Producer(*m_binController->profile(), "xml-string", doc.toString().toUtf8().constData());
} else {
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
if (producer->is_valid() && info.xml.hasAttribute(QStringLiteral("checkProfile")) && producer->get_int("video_index") > -1) {
// Check if clip profile matches
QString service = producer->get("mlt_service");
......@@ -577,7 +577,7 @@ void ProducerQueue::processFileProperties()
path = "xml:" + path.section(QLatin1Char(':'), 1);
}
Mlt::Profile original_profile;
Mlt::Producer *tmpProd = new Mlt::Producer(original_profile, 0, path.toUtf8().constData());
Mlt::Producer *tmpProd = new Mlt::Producer(original_profile, nullptr, path.toUtf8().constData());
original_profile.set_explicit(true);
filePropertyMap[QStringLiteral("progressive")] = QString::number(original_profile.progressive());
filePropertyMap[QStringLiteral("colorspace")] = QString::number(original_profile.colorspace());
......@@ -588,7 +588,7 @@ void ProducerQueue::processFileProperties()
// Warning, MLT detects an incorrect length in producer consumer when producer's fps != project's fps
//TODO: report bug to MLT
delete tmpProd;
tmpProd = new Mlt::Producer(original_profile, 0, path.toUtf8().constData());
tmpProd = new Mlt::Producer(original_profile, nullptr, path.toUtf8().constData());
int originalLength = tmpProd->get_length();
int fixedLength = (int)(originalLength * m_binController->profile()->fps() / originalFps);
producer->set("length", fixedLength);
......
......@@ -52,7 +52,7 @@
#ifndef Q_OS_WIN
typedef GLenum(*ClientWaitSync_fp)(GLsync sync, GLbitfield flags, GLuint64 timeout);
static ClientWaitSync_fp ClientWaitSync = 0;
static ClientWaitSync_fp ClientWaitSync = nullptr;
#endif
using namespace Mlt;
......@@ -61,19 +61,19 @@ GLWidget::GLWidget(int id, QObject *parent)
: QQuickView((QWindow *) parent)
, sendFrameForAnalysis(false)
, m_id(id)
, m_shader(0)
, m_glslManager(0)
, m_consumer(0)
, m_producer(0)
, m_shader(nullptr)
, m_glslManager(nullptr)
, m_consumer(nullptr)
, m_producer(nullptr)
, m_initSem(0)
, m_analyseSem(1)
, m_isInitialized(false)
, m_threadStartEvent(0)
, m_threadStopEvent(0)
, m_threadCreateEvent(0)
, m_threadJoinEvent(0)
, m_displayEvent(0)
, m_frameRenderer(0)
, m_threadStartEvent(nullptr)
, m_threadStopEvent(nullptr)
, m_threadCreateEvent(nullptr)
, m_threadJoinEvent(nullptr)
, m_displayEvent(nullptr)
, m_frameRenderer(nullptr)
, m_projectionLocation(0)
, m_modelViewLocation(0)
, m_vertexLocation(0)
......@@ -82,7 +82,7 @@ GLWidget::GLWidget(int id, QObject *parent)
, m_zoom(1.0f)
, m_openGLSync(false)
, m_offset(QPoint(0, 0))
, m_shareContext(0)
, m_shareContext(nullptr)
, m_audioWaveDisplayed(false)
, m_fbo(nullptr)
{
......@@ -103,7 +103,7 @@ GLWidget::GLWidget(int id, QObject *parent)
}
if ((m_glslManager && !m_glslManager->is_valid())) {
delete m_glslManager;
m_glslManager = 0;
m_glslManager = nullptr;
KdenliveSettings::setGpu_accel(false);
// Need to destroy MLT global reference to prevent filters from trying to use GPU.
mlt_properties_set_data(mlt_global_properties(), "glslManager", nullptr, 0, nullptr, nullptr);
......@@ -166,7 +166,7 @@ void GLWidget::initializeGL()
if (m_glslManager && openglContext()->isOpenGLES()) {
delete m_glslManager;
m_glslManager = 0;
m_glslManager = nullptr;
KdenliveSettings::setGpu_accel(false);
// Need to destroy MLT global reference to prevent filters from trying to use GPU.
mlt_properties_set_data(mlt_global_properties(), "glslManager", nullptr, 0, nullptr, nullptr);
......@@ -186,7 +186,7 @@ void GLWidget::initializeGL()
qCDebug(KDENLIVE_LOG) << " / / // NO GL SYNC, ERROR";
emit gpuNotSupported();
delete m_glslManager;
m_glslManager = 0;
m_glslManager = nullptr;
}
}
}
......@@ -677,7 +677,7 @@ void GLWidget::startGlsl()
m_glslManager->fire_event("init glsl");
if (!m_glslManager->get_int("glsl_supported")) {
delete m_glslManager;
m_glslManager = 0;
m_glslManager = nullptr;
// Need to destroy MLT global reference to prevent filters from trying to use GPU.
mlt_properties_set_data(mlt_global_properties(), "glslManager", nullptr, 0, nullptr, nullptr);
emit gpuNotSupported();
......@@ -880,9 +880,9 @@ int GLWidget::reconfigureMulti(const QString &params, const QString &path, Mlt::
}
m_consumer = new Mlt::FilteredConsumer(*profile, "multi");
delete m_threadStartEvent;
m_threadStartEvent = 0;
m_threadStartEvent = nullptr;
delete m_threadStopEvent;
m_threadStopEvent = 0;
m_threadStopEvent = nullptr;
delete m_threadCreateEvent;
delete m_threadJoinEvent;
......@@ -986,9 +986,9 @@ int GLWidget::reconfigure(Mlt::Profile *profile)
}
m_consumer = new Mlt::FilteredConsumer(*m_monitorProfile, serviceName.toLatin1().constData());
delete m_threadStartEvent;
m_threadStartEvent = 0;
m_threadStartEvent = nullptr;
delete m_threadStopEvent;
m_threadStopEvent = 0;
m_threadStopEvent = nullptr;
delete m_threadCreateEvent;
delete m_threadJoinEvent;
......@@ -1267,10 +1267,10 @@ void GLWidget::on_gl_frame_show(mlt_consumer, void *self, mlt_frame frame_ptr)
}
RenderThread::RenderThread(thread_function_t function, void *data, QOpenGLContext *context, QSurface *surface)
: QThread(0)
: QThread(nullptr)
, m_function(function)
, m_data(data)
, m_context(0)
, m_context(nullptr)
, m_surface(surface)
{
if (context) {
......@@ -1300,11 +1300,11 @@ void RenderThread::run()
}
FrameRenderer::FrameRenderer(QOpenGLContext *shareContext, QSurface *surface)
: QThread(0)
: QThread(nullptr)
, m_semaphore(3)
, m_context(0)
, m_context(nullptr)
, m_surface(surface)
, m_gl32(0)
, m_gl32(nullptr)
, sendAudioForAnalysis(false)
{
Q_ASSERT(shareContext);
......
......@@ -334,7 +334,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
m_toolbar->addSeparator();
int tm = 0;
int bm = 0;
m_toolbar->getContentsMargins(0, &tm, 0, &bm);
m_toolbar->getContentsMargins(nullptr, &tm, nullptr, &bm);
m_audioMeterWidget = new MonitorAudioLevel(m_glMonitor->profile(), m_toolbar->height() - tm - bm, this);
m_toolbar->addWidget(m_audioMeterWidget);
if (!m_audioMeterWidget->isValid) {
......
......@@ -20,7 +20,7 @@
class FrameData : public QSharedData
{
public:
FrameData() : f((mlt_frame)0) {};
FrameData() : f((mlt_frame)nullptr) {};
explicit FrameData(Mlt::Frame &frame) : f(frame) {};
~FrameData() {};
......@@ -30,7 +30,7 @@ private:
};
SharedFrame::SharedFrame()
: d(0)
: d(nullptr)
{
}
......@@ -65,8 +65,8 @@ Mlt::Frame SharedFrame::clone(bool audio, bool image, bool alpha) const
// It could be added to mlt_frame as an alternative to:
// mlt_frame mlt_frame_clone( mlt_frame self, int is_deep );
// It could also be added to Mlt::Frame as a const function.
void *data = 0;
void *copy = 0;
void *data = nullptr;
void *copy = nullptr;
int size = 0;
Mlt::Frame cloneFrame(mlt_frame_init(nullptr));
cloneFrame.inherit(d->f);
......@@ -99,7 +99,7 @@ Mlt::Frame SharedFrame::clone(bool audio, bool image, bool alpha) const
size = mlt_image_format_size(get_image_format(),
get_image_width(),
get_image_height(),
0);
nullptr);
}
copy = mlt_pool_alloc(size);
memcpy(copy, data, size);
......
......@@ -134,7 +134,7 @@ Point2 NearestPointOnCurve(Point2 P, Point2 *V, double *tOut)
/* Find distances for candidate points */
for (i = 0; i < n_solutions; ++i) {
p = Bezier(V, DEGREE, t_candidate[i],
(Point2 *)NULL, (Point2 *)NULL);
(Point2 *)nullptr, (Point2 *)nullptr);
new_dist = V2SquaredLength(V2Sub(&P, &p, &v));
if (new_dist < dist) {
dist = new_dist;
......@@ -151,7 +151,7 @@ Point2 NearestPointOnCurve(Point2 P, Point2 *V, double *tOut)
/* Return the point on the curve at parameter value t */
// printf("t : %4.12f\n", t);
*tOut = t;
return (Bezier(V, DEGREE, t, (Point2 *)NULL, (Point2 *)NULL));
return (Bezier(V, DEGREE, t, (Point2 *)nullptr, (Point2 *)nullptr));
}
/*
......@@ -481,12 +481,12 @@ static Point2 Bezier(Point2 *V, int degree, double t, Point2 *Left, Point2 *Righ
}
}
if (Left != NULL) {
if (Left != nullptr) {
for (j = 0; j <= degree; ++j) {
Left[j] = Vtemp[j][0];
}
}
if (Right != NULL) {
if (Right != nullptr) {
for (j = 0; j <= degree; ++j) {
Right[j] = Vtemp[degree - j][j];
}
......
......@@ -347,7 +347,7 @@ void RotoWidget::setupTrackingListen(const ItemInfo &info)
// TODO: track effects
return;
}
Mlt::Producer *clip = NULL;
Mlt::Producer *clip = nullptr;
if (info.track == 0) {
clip = m_monitor->render->getProducer();
} else {
......
......@@ -48,13 +48,13 @@
class NoEditDelegate: public QStyledItemDelegate
{
public:
NoEditDelegate(QObject *parent = 0): QStyledItemDelegate(parent) {}
NoEditDelegate(QObject *parent = nullptr): QStyledItemDelegate(parent) {}
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE
{
Q_UNUSED(parent);
Q_UNUSED(option);
Q_UNUSED(index);
return 0;
return nullptr;
}
};
......
......@@ -301,7 +301,7 @@ void JobManager::launchJob(ProjectClip *clip, AbstractClipJob *job, bool runQueu
void JobManager::slotDiscardClipJobs()
{
QAction *act = qobject_cast<QAction *>(sender());
if (act == 0) {
if (act == nullptr) {
// Cannot access triggering action, something is wrong
qCDebug(KDENLIVE_LOG) << "// Error in job action";
return;
......
......@@ -46,8 +46,8 @@ the Free Software Foundation, either version 3 of the License, or
ProjectManager::ProjectManager(QObject *parent) :
QObject(parent),
m_project(0),
m_trackView(0),
m_project(nullptr),
m_trackView(nullptr),
m_progressDialog(nullptr)
{
m_fileRevert = KStandardAction::revert(this, SLOT(slotRevert()), pCore->window()->actionCollection());
......@@ -443,7 +443,7 @@ bool ProjectManager::checkForBackupFile(const QUrl &url)
}
if (orphanedFile) {
if (KMessageBox::questionYesNo(0,
if (KMessageBox::questionYesNo(nullptr,
i18n("Auto-saved files exist. Do you want to recover them now?"),
i18n("File Recovery"),
KGuiItem(i18n("Recover")), KGuiItem(i18n("Don't recover"))) == KMessageBox::Yes) {
......@@ -522,7 +522,7 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
pCore->monitorManager()->resetDisplay();
m_progressDialog = new QProgressDialog(pCore->window());
m_progressDialog->setWindowTitle(i18n("Loading project"));
m_progressDialog->setCancelButton(0);
m_progressDialog->setCancelButton(nullptr);
m_progressDialog->setLabelText(i18n("Loading project"));
m_progressDialog->setMaximum(0);
m_progressDialog->show();
......
......@@ -213,7 +213,7 @@ bool StatusBarMessageLabel::slotMessageTimeout()
}
QColor bgColor = KStatefulBrush(KColorScheme::Window, KColorScheme::NegativeBackground, KSharedConfig::openConfig(KdenliveSettings::colortheme())).brush(this).color();
const char *iconName = 0;
const char *iconName = nullptr;
if (m_animation.state() == QAbstractAnimation::Running) {
m_animation.stop();
}
......@@ -259,7 +259,7 @@ bool StatusBarMessageLabel::slotMessageTimeout()
break;
}
if (iconName == 0) {
if (iconName == nullptr) {
m_pixmap->setVisible(false);
} else {
m_pixmap->setPixmap(SmallIcon(iconName));
......
......@@ -113,7 +113,7 @@ void AbstractClipItem::closeAnimation()
}
setEnabled(false);
setFlag(QGraphicsItem::ItemIsSelectable, false);
if (QApplication::style()->styleHint(QStyle::SH_Widget_Animate, 0, QApplication::activeWindow())) {
if (QApplication::style()->styleHint(QStyle::SH_Widget_Animate, nullptr, QApplication::activeWindow())) {
// animation disabled
deleteLater();