changed NULLs to nullptr
This commit is contained in:
+26
-26
@@ -43,7 +43,7 @@ const EffectMeta* get_meta_from_name(const QString& name) {
|
||||
return &effects.at(j);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LoadThread::load_effect(QXmlStreamReader& stream, Clip* c) {
|
||||
@@ -67,7 +67,7 @@ void LoadThread::load_effect(QXmlStreamReader& stream, Clip* c) {
|
||||
// wait for effects to be loaded
|
||||
panel_effect_controls->effects_loaded.lock();
|
||||
|
||||
const EffectMeta* meta = NULL;
|
||||
const EffectMeta* meta = nullptr;
|
||||
|
||||
// find effect with this name
|
||||
if (!effect_name.isEmpty()) {
|
||||
@@ -168,7 +168,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
switch (type) {
|
||||
case MEDIA_TYPE_FOLDER:
|
||||
{
|
||||
Media* folder = panel_project->new_folder(0);
|
||||
Media* folder = panel_project->new_folder(nullptr);
|
||||
folder->temp_id2 = 0;
|
||||
for (int j=0;j<stream.attributes().size();j++) {
|
||||
const QXmlStreamAttribute& attr = stream.attributes().at(j);
|
||||
@@ -239,7 +239,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
item->set_footage(m);
|
||||
|
||||
if (folder == 0) {
|
||||
project_model.appendChild(NULL, item);
|
||||
project_model.appendChild(nullptr, item);
|
||||
} else {
|
||||
find_loaded_folder_by_id(folder)->appendChild(item);
|
||||
}
|
||||
@@ -250,7 +250,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
break;
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
{
|
||||
Media* parent = NULL;
|
||||
Media* parent = nullptr;
|
||||
Sequence* s = new Sequence();
|
||||
|
||||
// load attributes about sequence
|
||||
@@ -304,8 +304,8 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
s->markers.append(m);
|
||||
} else if (stream.name() == "transition" && stream.isStartElement()) {
|
||||
TransitionData td;
|
||||
td.otc = NULL;
|
||||
td.ctc = NULL;
|
||||
td.otc = nullptr;
|
||||
td.ctc = nullptr;
|
||||
for (int j=0;j<stream.attributes().size();j++) {
|
||||
const QXmlStreamAttribute& attr = stream.attributes().at(j);
|
||||
if (attr.name() == "id") {
|
||||
@@ -325,7 +325,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
// backwards compatibility code
|
||||
c->autoscale = false;
|
||||
|
||||
c->media = NULL;
|
||||
c->media = nullptr;
|
||||
|
||||
for (int j=0;j<stream.attributes().size();j++) {
|
||||
const QXmlStreamAttribute& attr = stream.attributes().at(j);
|
||||
@@ -370,7 +370,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
media_type = MEDIA_TYPE_SEQUENCE;
|
||||
|
||||
// since we haven't finished loading sequences, we defer linking this until later
|
||||
c->media = NULL;
|
||||
c->media = nullptr;
|
||||
c->media_stream = attr.value().toInt();
|
||||
loaded_clips.append(c);
|
||||
}
|
||||
@@ -468,16 +468,16 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
const TransitionData& td = transition_data.at(i);
|
||||
Clip* primary = td.otc;
|
||||
Clip* secondary = td.ctc;
|
||||
if (primary != NULL || secondary != NULL) {
|
||||
if (primary == NULL) {
|
||||
if (primary != nullptr || secondary != nullptr) {
|
||||
if (primary == nullptr) {
|
||||
primary = secondary;
|
||||
secondary = NULL;
|
||||
secondary = nullptr;
|
||||
}
|
||||
const EffectMeta* meta = get_meta_from_name(td.name);
|
||||
if (meta == NULL) {
|
||||
if (meta == nullptr) {
|
||||
qWarning() << "Failed to link transition with name:" << td.name;
|
||||
if (td.otc != NULL) td.otc->opening_transition = -1;
|
||||
if (td.ctc != NULL) td.ctc->closing_transition = -1;
|
||||
if (td.otc != nullptr) td.otc->opening_transition = -1;
|
||||
if (td.ctc != nullptr) td.ctc->closing_transition = -1;
|
||||
} else {
|
||||
emit start_create_dual_transition(&td, primary, secondary, meta);
|
||||
|
||||
@@ -486,7 +486,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
}
|
||||
}
|
||||
|
||||
Media* m = panel_project->new_sequence(NULL, s, false, parent);
|
||||
Media* m = panel_project->new_sequence(nullptr, s, false, parent);
|
||||
|
||||
loaded_sequences.append(m);
|
||||
}
|
||||
@@ -503,14 +503,14 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
}
|
||||
|
||||
Media* LoadThread::find_loaded_folder_by_id(int id) {
|
||||
if (id == 0) return NULL;
|
||||
if (id == 0) return nullptr;
|
||||
for (int j=0;j<loaded_folders.size();j++) {
|
||||
Media* parent_item = loaded_folders.at(j);
|
||||
if (parent_item->temp_id == id) {
|
||||
return parent_item;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LoadThread::run() {
|
||||
@@ -538,7 +538,7 @@ void LoadThread::run() {
|
||||
show_err = true;
|
||||
|
||||
// temp variables for loading (unnecessary?)
|
||||
open_seq = NULL;
|
||||
open_seq = nullptr;
|
||||
loaded_folders.clear();
|
||||
loaded_media_items.clear();
|
||||
loaded_clips.clear();
|
||||
@@ -573,7 +573,7 @@ void LoadThread::run() {
|
||||
Media* folder = loaded_folders.at(i);
|
||||
int parent = folder->temp_id2;
|
||||
if (folder->temp_id2 == 0) {
|
||||
project_model.appendChild(NULL, folder);
|
||||
project_model.appendChild(nullptr, folder);
|
||||
} else {
|
||||
find_loaded_folder_by_id(parent)->appendChild(folder);
|
||||
}
|
||||
@@ -601,7 +601,7 @@ void LoadThread::run() {
|
||||
// attach nested sequence clips to their sequences
|
||||
for (int i=0;i<loaded_clips.size();i++) {
|
||||
for (int j=0;j<loaded_sequences.size();j++) {
|
||||
if (loaded_clips.at(i)->media == NULL && loaded_clips.at(i)->media_stream == loaded_sequences.at(j)->to_sequence()->save_id) {
|
||||
if (loaded_clips.at(i)->media == nullptr && loaded_clips.at(i)->media_stream == loaded_sequences.at(j)->to_sequence()->save_id) {
|
||||
loaded_clips.at(i)->media = loaded_sequences.at(j);
|
||||
loaded_clips.at(i)->refresh();
|
||||
break;
|
||||
@@ -659,7 +659,7 @@ void LoadThread::success_func() {
|
||||
}
|
||||
|
||||
mainWindow->setWindowModified(autorecovery);
|
||||
if (open_seq != NULL) set_sequence(open_seq);
|
||||
if (open_seq != nullptr) set_sequence(open_seq);
|
||||
update_ui(false);
|
||||
}
|
||||
|
||||
@@ -695,7 +695,7 @@ void LoadThread::create_effect_ui(
|
||||
|
||||
if (cancelled) return;
|
||||
if (type == TA_NO_TRANSITION) {
|
||||
if (meta == NULL) {
|
||||
if (meta == nullptr) {
|
||||
// create void effect
|
||||
VoidEffect* ve = new VoidEffect(c, *effect_name);
|
||||
ve->set_enabled(effect_enabled);
|
||||
@@ -709,7 +709,7 @@ void LoadThread::create_effect_ui(
|
||||
c->effects.append(e);
|
||||
}
|
||||
} else {
|
||||
int transition_index = create_transition(c, NULL, meta);
|
||||
int transition_index = create_transition(c, nullptr, meta);
|
||||
Transition* t = c->sequence->transitions.at(transition_index);
|
||||
if (effect_length > -1) t->set_length(effect_length);
|
||||
t->set_enabled(effect_enabled);
|
||||
@@ -728,7 +728,7 @@ void LoadThread::create_effect_ui(
|
||||
void LoadThread::create_dual_transition(const TransitionData* td, Clip* primary, Clip* secondary, const EffectMeta* meta) {
|
||||
int transition_index = create_transition(primary, secondary, meta);
|
||||
primary->sequence->transitions.at(transition_index)->set_length(td->length);
|
||||
if (td->otc != NULL) td->otc->opening_transition = transition_index;
|
||||
if (td->ctc != NULL) td->ctc->closing_transition = transition_index;
|
||||
if (td->otc != nullptr) td->otc->opening_transition = transition_index;
|
||||
if (td->ctc != nullptr) td->ctc->closing_transition = transition_index;
|
||||
waitCond.wakeAll();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user