Commit 6048a896 authored by Laurent Montel's avatar Laurent Montel

Use Q_NULLPTR reduce the number of compile warning

parent 5b5e286a
......@@ -112,7 +112,7 @@ int main(int argc, char **argv)
RenderJob *job = new RenderJob(doerase, usekuiserver, pid, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
if (!locale.isEmpty()) job->setLocale(locale);
job->start();
RenderJob *dualjob = NULL;
RenderJob *dualjob = Q_NULLPTR;
if (dualpass) {
if (vprelist.size()>1)
args.replaceInStrings(QRegExp(QLatin1String("^vpre=.*")),QStringLiteral("vpre=%1").arg(vprelist.at(1)));
......
......@@ -125,7 +125,7 @@ Bin* AbstractProjectItem::bin()
if (m_parent) {
return m_parent->bin();
}
return NULL;
return Q_NULLPTR;
}
QPixmap AbstractProjectItem::roundedPixmap(const QPixmap &source)
......
......@@ -202,7 +202,7 @@ bool BinMessageWidget::event(QEvent* ev) {
}
SmallJobLabel::SmallJobLabel(QWidget *parent) : QPushButton(parent)
, m_action(NULL)
, m_action(Q_NULLPTR)
{
setFixedWidth(0);
setFlat(true);
......@@ -317,21 +317,21 @@ bool LineEventEater::eventFilter(QObject *obj, QEvent *event)
Bin::Bin(QWidget* parent) :
QWidget(parent)
, isLoading(false)
, m_itemModel(NULL)
, m_itemView(NULL)
, m_rootFolder(NULL)
, m_folderUp(NULL)
, m_jobManager(NULL)
, m_doc(NULL)
, m_extractAudioAction(NULL)
, m_transcodeAction(NULL)
, m_clipsActionsMenu(NULL)
, m_inTimelineAction(NULL)
, m_itemModel(Q_NULLPTR)
, m_itemView(Q_NULLPTR)
, m_rootFolder(Q_NULLPTR)
, m_folderUp(Q_NULLPTR)
, m_jobManager(Q_NULLPTR)
, m_doc(Q_NULLPTR)
, m_extractAudioAction(Q_NULLPTR)
, m_transcodeAction(Q_NULLPTR)
, m_clipsActionsMenu(Q_NULLPTR)
, m_inTimelineAction(Q_NULLPTR)
, m_listType((BinViewType) KdenliveSettings::binMode())
, m_iconSize(160, 90)
, m_propertiesPanel(NULL)
, m_propertiesPanel(Q_NULLPTR)
, m_blankThumb()
, m_invalidClipDialog(NULL)
, m_invalidClipDialog(Q_NULLPTR)
, m_gainedFocus(false)
, m_audioDuration(0)
, m_processedAudio(0)
......@@ -602,7 +602,7 @@ bool Bin::eventFilter(QObject *obj, QEvent *event)
QAbstractItemView *view = qobject_cast<QAbstractItemView*>(obj->parent());
if (view) {
QModelIndex idx = view->indexAt(mouseEvent->pos());
ClipController *ctl = NULL;
ClipController *ctl = Q_NULLPTR;
if (idx.isValid()) {
AbstractProjectItem *item = static_cast<AbstractProjectItem*>(m_proxyModel->mapToSource(idx).internalPointer());
if (item) {
......@@ -741,7 +741,7 @@ void Bin::slotAddClip()
void Bin::deleteClip(const QString &id)
{
if (m_monitor->activeClipId() == id) {
emit openClip(NULL);
emit openClip(Q_NULLPTR);
}
ProjectClip *clip = m_rootFolder->clip(id);
if (!clip) {
......@@ -762,7 +762,7 @@ ProjectClip *Bin::getFirstSelectedClip()
{
QModelIndexList indexes = m_proxyModel->selectionModel()->selectedIndexes();
if (indexes.isEmpty()) {
return NULL;
return Q_NULLPTR;
}
foreach (const QModelIndex &ix, indexes) {
AbstractProjectItem *item = static_cast<AbstractProjectItem*>(m_proxyModel->mapToSource(ix).internalPointer());
......@@ -771,7 +771,7 @@ ProjectClip *Bin::getFirstSelectedClip()
return clip;
}
}
return NULL;
return Q_NULLPTR;
}
void Bin::slotDeleteClip()
......@@ -861,7 +861,7 @@ void Bin::slotReloadClip()
AbstractProjectItem *item = static_cast<AbstractProjectItem*>(m_proxyModel->mapToSource(ix).internalPointer());
ProjectClip *currentItem = qobject_cast<ProjectClip*>(item);
if (currentItem) {
emit openClip(NULL);
emit openClip(Q_NULLPTR);
QDomDocument doc;
QDomElement xml = currentItem->toXml(doc);
qDebug()<<"*****************\n"<<doc.toString()<<"\n******************";
......@@ -963,7 +963,7 @@ int Bin::lastClipId() const
void Bin::setDocument(KdenliveDoc* project)
{
// Remove clip from Bin's monitor
if (m_doc) emit openClip(NULL);
if (m_doc) emit openClip(Q_NULLPTR);
m_infoMessage->hide();
blockSignals(true);
m_proxyModel->selectionModel()->blockSignals(true);
......@@ -979,7 +979,7 @@ void Bin::setDocument(KdenliveDoc* project)
}
delete m_rootFolder;
delete m_itemView;
m_itemView = NULL;
m_itemView = Q_NULLPTR;
delete m_jobManager;
m_clipCounter = 1;
m_folderCounter = 1;
......@@ -1003,7 +1003,7 @@ void Bin::setDocument(KdenliveDoc* project)
//connect(m_itemModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), m_itemView
//connect(m_itemModel, SIGNAL(updateCurrentItem()), this, SLOT(autoSelect()));
slotInitView(NULL);
slotInitView(Q_NULLPTR);
bool binEffectsDisabled = getDocumentProperty(QStringLiteral("disablebineffects")).toInt() == 1;
setBinEffectsDisabledStatus(binEffectsDisabled);
autoSelect();
......@@ -1178,7 +1178,7 @@ void Bin::slotLoadFolders(QMap<QString,QString> foldersData)
if (parentFolder == m_rootFolder) {
// parent folder not yet created, create unnamed placeholder
parentFolder = new ProjectFolder(parentId, QString(), parentFolder);
} else if (parentFolder == NULL) {
} else if (parentFolder == Q_NULLPTR) {
// Parent folder not yet created in hierarchy
if (iterations > maxIterations) {
// Give up, place folder in root
......@@ -1377,11 +1377,11 @@ void Bin::selectProxyModel(const QModelIndex &id)
// No item selected in bin
m_openAction->setEnabled(false);
m_deleteAction->setEnabled(false);
showClipProperties(NULL);
showClipProperties(Q_NULLPTR);
emit findInTimeline(QString());
emit masterClipSelected(NULL, m_monitor);
emit masterClipSelected(Q_NULLPTR, m_monitor);
// Display black bg in clip monitor
emit openClip(NULL);
emit openClip(Q_NULLPTR);
}
}
......@@ -1437,7 +1437,7 @@ void Bin::slotInitView(QAction *action)
m_folderUp->parent()->removeChild(m_folderUp);
}
delete m_folderUp;
m_folderUp = NULL;
m_folderUp = Q_NULLPTR;
}
}
m_listType = static_cast<BinViewType>(viewType);
......@@ -1449,7 +1449,7 @@ void Bin::slotInitView(QAction *action)
switch (m_listType) {
case BinIconView:
m_itemView = new MyListView(this);
m_folderUp = new ProjectFolderUp(NULL);
m_folderUp = new ProjectFolderUp(Q_NULLPTR);
m_showDate->setEnabled(false);
m_showDesc->setEnabled(false);
break;
......@@ -1643,7 +1643,7 @@ void Bin::slotItemDoubleClicked(const QModelIndex &ix, const QPoint pos)
// We are entering a parent folder
m_folderUp->setParent(parentItem->parent());
}
else m_folderUp->setParent(NULL);
else m_folderUp->setParent(Q_NULLPTR);
m_itemView->setRootIndex(m_proxyModel->mapFromSource(parent));
return;
}
......@@ -1716,12 +1716,12 @@ void Bin::slotSwitchClipProperties()
return;
}
}
slotSwitchClipProperties(NULL);
slotSwitchClipProperties(Q_NULLPTR);
}
void Bin::slotSwitchClipProperties(ProjectClip *clip)
{
if (clip == NULL) {
if (clip == Q_NULLPTR) {
m_propertiesPanel->setEnabled(false);
return;
}
......@@ -1829,7 +1829,7 @@ QStringList Bin::getBinFolderClipIds(const QString &id) const
ProjectClip *Bin::getBinClip(const QString &id)
{
ProjectClip *clip = NULL;
ProjectClip *clip = Q_NULLPTR;
if (id.contains(QLatin1Char('_'))) {
clip = m_rootFolder->clip(id.section(QLatin1Char('_'), 0, 0));
}
......@@ -1898,7 +1898,7 @@ void Bin::slotProducerReady(requestClipInfo info, ClipController *controller)
}
}
else if (currentClip == info.clipId) {
emit openClip(NULL);
emit openClip(Q_NULLPTR);
clip->setCurrent(true);
}
}
......@@ -2072,7 +2072,7 @@ void Bin::slotUpdateJobStatus(const QString&id, int jobType, int status, const Q
}
if (!actionName.isEmpty()) {
QAction *action = NULL;
QAction *action = Q_NULLPTR;
QList< KActionCollection * > collections = KActionCollection::allCollections();
for (int i = 0; i < collections.count(); ++i) {
KActionCollection *coll = collections.at(i);
......@@ -2981,7 +2981,7 @@ void Bin::slotAddClipMarker(const QString &id, QList <CommentedTime> newMarkers,
{
ProjectClip *clip = getBinClip(id);
if (!clip) return;
if (groupCommand == NULL) {
if (groupCommand == Q_NULLPTR) {
groupCommand = new QUndoCommand;
groupCommand->setText(i18np("Add marker", "Add markers", newMarkers.count()));
}
......@@ -3262,7 +3262,7 @@ void Bin::slotQueryRemoval(const QString &id, QUrl url, const QString &errorMess
}
}
delete m_invalidClipDialog;
m_invalidClipDialog = NULL;
m_invalidClipDialog = Q_NULLPTR;
}
void Bin::slotRefreshClipThumbnail(const QString &id)
......@@ -3429,15 +3429,15 @@ void Bin::slotSendAudioThumb(QString id)
bool Bin::isEmpty() const
{
// TODO: return true if we only have folders
if (m_clipCounter == 1 || m_rootFolder == NULL) return true;
if (m_clipCounter == 1 || m_rootFolder == Q_NULLPTR) return true;
return m_rootFolder->isEmpty();
}
void Bin::reloadAllProducers()
{
if (m_rootFolder == NULL || m_rootFolder->isEmpty() || !isEnabled()) return;
if (m_rootFolder == Q_NULLPTR || m_rootFolder->isEmpty() || !isEnabled()) return;
QList <ProjectClip*> clipList = m_rootFolder->childClips();
emit openClip(NULL);
emit openClip(Q_NULLPTR);
foreach(ProjectClip *clip, clipList) {
QDomDocument doc;
QDomElement xml = clip->toXml(doc);
......
......@@ -544,7 +544,7 @@ private slots:
void slotShowDescColumn(bool show);
/** @brief Setup the bin view type (icon view, tree view, ...).
* @param action The action whose data defines the view type or NULL to keep default view */
* @param action The action whose data defines the view type or Q_NULLPTR to keep default view */
void slotInitView(QAction *action);
/** @brief Update status for clip jobs */
......
......@@ -37,10 +37,10 @@
Generators::Generators(Monitor *monitor, const QString &path, QWidget *parent) :
QDialog(parent)
, m_producer(NULL)
, m_timePos(NULL)
, m_container(NULL)
, m_preview(NULL)
, m_producer(Q_NULLPTR)
, m_timePos(Q_NULLPTR)
, m_container(Q_NULLPTR)
, m_preview(Q_NULLPTR)
{
QFile file(path);
QDomDocument doc;
......
......@@ -48,7 +48,7 @@ ProjectClip::ProjectClip(const QString &id, QIcon thumb, ClipController *control
AbstractProjectItem(AbstractProjectItem::ClipItem, id, parent)
, m_abortAudioThumb(false)
, m_controller(controller)
, m_thumbsProducer(NULL)
, m_thumbsProducer(Q_NULLPTR)
{
m_clipStatus = StatusReady;
m_name = m_controller->clipName();
......@@ -73,9 +73,9 @@ ProjectClip::ProjectClip(const QString &id, QIcon thumb, ClipController *control
ProjectClip::ProjectClip(const QDomElement& description, QIcon thumb, ProjectFolder* parent) :
AbstractProjectItem(AbstractProjectItem::ClipItem, description, parent)
, m_abortAudioThumb(false)
, m_controller(NULL)
, m_controller(Q_NULLPTR)
, m_type(Unknown)
, m_thumbsProducer(NULL)
, m_thumbsProducer(Q_NULLPTR)
{
Q_ASSERT(description.hasAttribute("id"));
m_clipStatus = StatusWaiting;
......@@ -186,13 +186,13 @@ ProjectClip* ProjectClip::clip(const QString &id)
if (id == m_id) {
return this;
}
return NULL;
return Q_NULLPTR;
}
ProjectFolder* ProjectClip::folder(const QString &id)
{
Q_UNUSED(id)
return NULL;
return Q_NULLPTR;
}
void ProjectClip::disableEffects(bool disable)
......@@ -208,7 +208,7 @@ ProjectSubClip* ProjectClip::getSubClip(int in, int out)
return clip;
}
}
return NULL;
return Q_NULLPTR;
}
QStringList ProjectClip::subClipIds() const
......@@ -228,7 +228,7 @@ ProjectClip* ProjectClip::clipAt(int ix)
if (ix == index()) {
return this;
}
return NULL;
return Q_NULLPTR;
}
/*bool ProjectClip::isValid() const
......@@ -376,7 +376,7 @@ void ProjectClip::createAudioThumbs()
Mlt::Producer *ProjectClip::originalProducer()
{
if (!m_controller) {
return NULL;
return Q_NULLPTR;
}
return &m_controller->originalProducer();
}
......@@ -388,11 +388,11 @@ Mlt::Producer *ProjectClip::thumbProducer()
return m_thumbsProducer;
}
if (!m_controller || m_controller->clipType() == Unknown) {
return NULL;
return Q_NULLPTR;
}
Mlt::Producer prod = m_controller->originalProducer();
if (!prod.is_valid())
return NULL;
return Q_NULLPTR;
Clip clip(prod);
if (KdenliveSettings::gpu_accel()) {
m_thumbsProducer = clip.softClone(ClipController::getPassPropertiesList());
......@@ -413,7 +413,7 @@ ClipController *ProjectClip::controller()
bool ProjectClip::isReady() const
{
return m_controller != NULL && m_clipStatus == StatusReady;
return m_controller != Q_NULLPTR && m_clipStatus == StatusReady;
}
/*void ProjectClip::setZone(const QPoint &zone)
......@@ -818,7 +818,7 @@ QVariant ProjectClip::data(DataType type) const
{
switch (type) {
case AbstractProjectItem::IconOverlay:
return m_controller != NULL ? (m_controller->hasEffects() ? QVariant("kdenlive-track_has_effect") : QVariant()) : QVariant();
return m_controller != Q_NULLPTR ? (m_controller->hasEffects() ? QVariant("kdenlive-track_has_effect") : QVariant()) : QVariant();
break;
default:
break;
......@@ -843,7 +843,7 @@ void ProjectClip::slotQueryIntraThumbs(QList <int> frames)
void ProjectClip::doExtractIntra()
{
Mlt::Producer *prod = thumbProducer();
if (prod == NULL || !prod->is_valid()) return;
if (prod == Q_NULLPTR || !prod->is_valid()) return;
int fullWidth = 150 * prod->profile()->dar() + 0.5;
double dar = prod->profile()->dar();
int max = prod->get_length();
......@@ -890,7 +890,7 @@ void ProjectClip::slotExtractImage(QList <int> frames)
void ProjectClip::doExtractImage()
{
Mlt::Producer *prod = thumbProducer();
if (prod == NULL || !prod->is_valid()) return;
if (prod == Q_NULLPTR || !prod->is_valid()) return;
int frameWidth = 150 * prod->profile()->dar() + 0.5;
bool ok = false;
QDir thumbFolder = bin()->getCacheDir(CacheThumbs, &ok);
......@@ -944,7 +944,7 @@ void ProjectClip::discardAudioThumb()
const QString ProjectClip::getAudioThumbPath(AudioStreamInfo *audioInfo)
{
if (audioInfo == NULL)
if (audioInfo == Q_NULLPTR)
return QString();
int audioStream = audioInfo->ffmpeg_audio_index();
QString clipHash = hash();
......@@ -1291,7 +1291,7 @@ const QString ProjectClip::geometryWithOffset(const QString &data, int offset)
if (offset == 0) return data;
Mlt::Profile *profile = m_controller->profile();
Mlt::Geometry geometry(data.toUtf8().data(), duration().frames(profile->fps()), profile->width(), profile->height());
Mlt::Geometry newgeometry(NULL, duration().frames(profile->fps()), profile->width(), profile->height());
Mlt::Geometry newgeometry(Q_NULLPTR, duration().frames(profile->fps()), profile->width(), profile->height());
Mlt::GeometryItem item;
int pos = 0;
while (!geometry.next_key(&item, pos)) {
......
......@@ -72,14 +72,14 @@ public:
/** @brief Returns a unique hash identifier used to store clip thumbnails. */
//virtual void hash() = 0;
/** @brief Returns this if @param id matches the clip's id or NULL otherwise. */
/** @brief Returns this if @param id matches the clip's id or Q_NULLPTR otherwise. */
ProjectClip *clip(const QString &id);
ProjectFolder* folder(const QString &id);
ProjectSubClip* getSubClip(int in, int out);
/** @brief Returns this if @param ix matches the clip's index or NULL otherwise. */
/** @brief Returns this if @param ix matches the clip's index or Q_NULLPTR otherwise. */
ProjectClip* clipAt(int ix);
/** @brief Recursively disable/enable bin effects. */
......
......@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
ProjectFolder::ProjectFolder(const QString &id, const QString &name, ProjectFolder* parent) :
AbstractProjectItem(AbstractProjectItem::FolderItem, id, parent)
, m_bin(NULL)
, m_bin(Q_NULLPTR)
{
m_name = name;
m_clipStatus = StatusReady;
......@@ -43,7 +43,7 @@ ProjectFolder::ProjectFolder(Bin *bin) :
, m_bin(bin)
{
m_name = QStringLiteral("root");
setParent(NULL);
setParent(Q_NULLPTR);
}
ProjectFolder::~ProjectFolder()
......@@ -54,7 +54,7 @@ void ProjectFolder::setCurrent(bool current, bool notify)
{
Q_UNUSED(notify)
if (current) {
bin()->openProducer(NULL);
bin()->openProducer(Q_NULLPTR);
}
}
......@@ -66,7 +66,7 @@ ProjectClip* ProjectFolder::clip(const QString &id)
return clip;
}
}
return NULL;
return Q_NULLPTR;
}
QList <ProjectClip *> ProjectFolder::childClips()
......@@ -98,19 +98,19 @@ ProjectFolder* ProjectFolder::folder(const QString &id)
return folderItem;
}
}
return NULL;
return Q_NULLPTR;
}
ProjectClip* ProjectFolder::clipAt(int index)
{
if (isEmpty()) return NULL;
if (isEmpty()) return Q_NULLPTR;
for (int i = 0; i < count(); ++i) {
ProjectClip *clip = at(i)->clipAt(index);
if (clip) {
return clip;
}
}
return NULL;
return Q_NULLPTR;
}
void ProjectFolder::disableEffects(bool disable)
......
......@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
ProjectFolderUp::ProjectFolderUp(AbstractProjectItem* parent) :
AbstractProjectItem(AbstractProjectItem::FolderUpItem, QString(), parent)
, m_bin(NULL)
, m_bin(Q_NULLPTR)
{
m_thumbnail = KoIconUtils::themedIcon(QStringLiteral("go-previous"));
m_name = i18n("Back");
......@@ -50,7 +50,7 @@ void ProjectFolderUp::setCurrent(bool current, bool notify)
ProjectClip* ProjectFolderUp::clip(const QString &id)
{
Q_UNUSED(id)
return NULL;
return Q_NULLPTR;
}
......@@ -62,13 +62,13 @@ QString ProjectFolderUp::getToolTip() const
ProjectFolder* ProjectFolderUp::folder(const QString &id)
{
Q_UNUSED(id)
return NULL;
return Q_NULLPTR;
}
ProjectClip* ProjectFolderUp::clipAt(int index)
{
Q_UNUSED(index)
return NULL;
return Q_NULLPTR;
}
void ProjectFolderUp::disableEffects(bool)
......
......@@ -291,7 +291,7 @@ QMimeData* ProjectItemModel::mimeData(const QModelIndexList& indices) const
void ProjectItemModel::onAboutToAddItem(AbstractProjectItem* item)
{
AbstractProjectItem *parentItem = item->parent();
if (parentItem == NULL) return;
if (parentItem == Q_NULLPTR) return;
QModelIndex parentIndex;
if (parentItem != m_bin->rootFolder()) {
parentIndex = createIndex(parentItem->index(), 0, parentItem);
......@@ -308,7 +308,7 @@ void ProjectItemModel::onItemAdded(AbstractProjectItem* item)
void ProjectItemModel::onAboutToRemoveItem(AbstractProjectItem* item)
{
AbstractProjectItem *parentItem = item->parent();
if (parentItem == NULL) return;
if (parentItem == Q_NULLPTR) return;
QModelIndex parentIndex;
if (parentItem != m_bin->rootFolder()) {
parentIndex = createIndex(parentItem->index(), 0, parentItem);
......@@ -328,7 +328,7 @@ void ProjectItemModel::onItemUpdated(AbstractProjectItem* item)
{
if (!item || item->clipStatus() == AbstractProjectItem::StatusDeleting) return;
AbstractProjectItem *parentItem = item->parent();
if (parentItem == NULL) return;
if (parentItem == Q_NULLPTR) return;
QModelIndex parentIndex;
if (parentItem != m_bin->rootFolder()) {
parentIndex = createIndex(parentItem->index(), 0, parentItem);
......
......@@ -77,13 +77,13 @@ QString ProjectSubClip::getToolTip() const
ProjectClip* ProjectSubClip::clip(const QString &id)
{
Q_UNUSED(id)
return NULL;
return Q_NULLPTR;
}
ProjectFolder* ProjectSubClip::folder(const QString &id)
{
Q_UNUSED(id)
return NULL;
return Q_NULLPTR;
}
void ProjectSubClip::disableEffects(bool)
......@@ -104,7 +104,7 @@ QPoint ProjectSubClip::zone() const
ProjectClip* ProjectSubClip::clipAt(int ix)
{
Q_UNUSED(ix)
return NULL;
return Q_NULLPTR;
}
QDomElement ProjectSubClip::toXml(QDomDocument& document, bool)
......@@ -119,7 +119,7 @@ QDomElement ProjectSubClip::toXml(QDomDocument& document, bool)
ProjectSubClip *ProjectSubClip::subClip(int in, int out)
{
if (m_in == in && m_out == out) return this;
return NULL;
return Q_NULLPTR;
}
void ProjectSubClip::setCurrent(bool current, bool notify)
......
......@@ -114,7 +114,7 @@ void ManageCapturesDialog::slotDeleteCurrent()
qDebug()<<"// ERRor removing file "<<item->data(0, Qt::UserRole).toString();
}
delete item;
item = NULL;
item = Q_NULLPTR;
}
void ManageCapturesDialog::slotToggle()
......
......@@ -45,10 +45,10 @@ MltDeviceCapture::MltDeviceCapture(QString profile, /*VideoSurface *surface, */Q
AbstractRender(Kdenlive::RecordMonitor, parent),
doCapture(0),
processingImage(false),
m_mltConsumer(NULL),
m_mltProducer(NULL),
m_mltProfile(NULL),
m_showFrameEvent(NULL),
m_mltConsumer(Q_NULLPTR),
m_mltProducer(Q_NULLPTR),
m_mltProfile(Q_NULLPTR),
m_showFrameEvent(Q_NULLPTR),
m_droppedFrames(0),
m_livePreview(KdenliveSettings::enable_recording_preview())
{
......@@ -118,7 +118,7 @@ bool MltDeviceCapture::buildConsumer(const QString &profileName)
//m_mltConsumer->set("real_time", 0);
if (!m_mltConsumer->is_valid()) {
delete m_mltConsumer;
m_mltConsumer = NULL;
m_mltConsumer = Q_NULLPTR;
return false;
}
return true;
......@@ -141,7 +141,7 @@ void MltDeviceCapture::stop()
//m_captureDisplayWidget->stop();
if (m_showFrameEvent) delete m_showFrameEvent;
m_showFrameEvent = NULL;
m_showFrameEvent = Q_NULLPTR;
if (m_mltConsumer) {
m_mltConsumer->set("refresh", 0);
......@@ -168,21 +168,21 @@ void MltDeviceCapture::stop()
nextservicetodisconnect = nextservice;
nextservice = mlt_service_producer(nextservice);
mlt_field_disconnect_service(field->get_field(), nextservicetodisconnect);
if (nextservice == NULL) break;
if (nextservice == Q_NULLPTR) break;
properties = MLT_SERVICE_PROPERTIES(nextservice);
mlt_type = mlt_properties_get(properties, "mlt_type");
resource = mlt_properties_get(properties, "mlt_service");
}
delete field;
field = NULL;
field = Q_NULLPTR;
}
mlt_service_unlock(service.get_service());
delete m_mltProducer;
m_mltProducer = NULL;
m_mltProducer = Q_NULLPTR;
}
// For some reason, the consumer seems to be deleted by previous stuff when in playlist mode
if (!isPlaylist && m_mltConsumer) delete m_mltConsumer;
m_mltConsumer = NULL;
m_mltConsumer = Q_NULLPTR;
}
......@@ -251,7 +251,7 @@ void MltDeviceCapture::showAudio(Mlt::Frame& frame)
bool MltDeviceCapture::slotStartPreview(const QString &producer, bool xmlFormat)
{
if (m_mltConsumer == NULL) {
if (m_mltConsumer == Q_NULLPTR) {
if (!buildConsumer()) return false;
}
char *tmp = qstrdup(producer.toUtf8().constData());
......@@ -259,10 +259,10 @@ bool MltDeviceCapture::slotStartPreview(const QString &producer, bool xmlFormat)
else m_mltProducer = new Mlt::Producer(*m_mltProfile, tmp);
delete[] tmp;
if (m_mltProducer == NULL || !m_mltProducer->is_valid()) {
if (m_mltProducer == Q_NULLPTR || !m_mltProducer->is_valid()) {
if (m_mltProducer) {
delete m_mltProducer;
m_mltProducer = NULL;
m_mltProducer = Q_NULLPTR;
}
//qDebug()<<"//// ERROR CREATRING PROD";
return false;
......@@ -270,7 +270,7 @@ bool MltDeviceCapture::slotStartPreview(const QString &producer, bool xmlFormat)
m_mltConsumer->connect(*m_mltProducer);
if (m_mltConsumer->start() == -1) {
delete m_mltConsumer;
m_mltConsumer = NULL;
m_mltConsumer = Q_NULLPTR;
return false;
}
m_droppedFramesTimer.start();
......@@ -311,7 +311,7 @@ void MltDeviceCapture::saveFrame(Mlt::Frame& frame)
void MltDeviceCapture::captureFrame(const QString &path)
{
if (m_mltProducer == NULL || !m_mltProducer->is_valid()) return;
if (m_mltProducer == Q_NULLPTR || !m_mltProducer->is_valid()) return;
// Hide overlay track before doing the capture
Mlt::Service service(m_mltProducer->parent().get_service());
......@@ -338,10 +338,10 @@ bool MltDeviceCapture::slotStartCapture(const QString &params, co