changed NULLs to nullptr
This commit is contained in:
+41
-44
@@ -236,7 +236,7 @@ Sequence* create_sequence_from_media(QVector<Media*>& media_list) {
|
||||
const FootageStream& ms = m->video_tracks.at(j);
|
||||
s->width = ms.video_width;
|
||||
s->height = ms.video_height;
|
||||
if (ms.video_frame_rate != 0) {
|
||||
if (qFuzzyCompare(ms.video_frame_rate, 0.0)) {
|
||||
s->frame_rate = ms.video_frame_rate * m->speed;
|
||||
|
||||
if (ms.video_interlacing != VIDEO_PROGRESSIVE) s->frame_rate *= 2;
|
||||
@@ -247,13 +247,10 @@ Sequence* create_sequence_from_media(QVector<Media*>& media_list) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!got_audio_values) {
|
||||
for (int j=0;j<m->audio_tracks.size();j++) {
|
||||
const FootageStream& ms = m->audio_tracks.at(j);
|
||||
s->audio_frequency = ms.audio_frequency;
|
||||
got_audio_values = true;
|
||||
break;
|
||||
}
|
||||
if (!got_audio_values && m->audio_tracks.size() > 0) {
|
||||
const FootageStream& ms = m->audio_tracks.at(0);
|
||||
s->audio_frequency = ms.audio_frequency;
|
||||
got_audio_values = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,7 +298,7 @@ void Project::replace_selected_file() {
|
||||
if (selected_items.size() == 1) {
|
||||
Media* item = item_to_media(selected_items.at(0));
|
||||
if (item->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
replace_media(item, 0);
|
||||
replace_media(item, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,7 +314,7 @@ void Project::replace_media(Media* item, QString filename) {
|
||||
}
|
||||
|
||||
void Project::replace_clip_media() {
|
||||
if (sequence == NULL) {
|
||||
if (sequence == nullptr) {
|
||||
QMessageBox::critical(this, "No active sequence", "No sequence is active, please open the sequence you want to replace clips from.", QMessageBox::Ok);
|
||||
} else {
|
||||
QModelIndexList selected_items = get_current_selected();
|
||||
@@ -364,11 +361,11 @@ void Project::open_properties() {
|
||||
}
|
||||
|
||||
Media* Project::new_sequence(ComboAction *ca, Sequence *s, bool open, Media* parent) {
|
||||
if (parent == NULL) parent = project_model.get_root();
|
||||
if (parent == nullptr) parent = project_model.get_root();
|
||||
Media* item = new Media(parent);
|
||||
item->set_sequence(s);
|
||||
|
||||
if (ca != NULL) {
|
||||
if (ca != nullptr) {
|
||||
ca->append(new NewSequenceCommand(item, parent));
|
||||
if (open) ca->append(new ChangeSequenceAction(s));
|
||||
} else {
|
||||
@@ -397,7 +394,7 @@ bool Project::is_focused() {
|
||||
}
|
||||
|
||||
Media* Project::new_folder(QString name) {
|
||||
Media* item = new Media(0);
|
||||
Media* item = new Media(nullptr);
|
||||
item->set_folder();
|
||||
item->set_name(name);
|
||||
return item;
|
||||
@@ -466,14 +463,14 @@ void Project::delete_selected_media() {
|
||||
Sequence* s = sequence_items.at(j)->to_sequence();
|
||||
for (int k=0;k<s->clips.size();k++) {
|
||||
Clip* c = s->clips.at(k);
|
||||
if (c != NULL && c->media == item) {
|
||||
if (c != nullptr && c->media == item) {
|
||||
if (!confirm_delete) {
|
||||
// we found a reference, so we know we'll need to ask if the user wants to delete it
|
||||
QMessageBox confirm(this);
|
||||
confirm.setWindowTitle("Delete media in use?");
|
||||
confirm.setText("The media '" + media->name + "' is currently used in '" + s->name + "'. Deleting it will remove all instances in the sequence. Are you sure you want to do this?");
|
||||
QAbstractButton* yes_button = confirm.addButton(QMessageBox::Yes);
|
||||
QAbstractButton* skip_button = NULL;
|
||||
QAbstractButton* skip_button = nullptr;
|
||||
if (items.size() > 1) skip_button = confirm.addButton("Skip", QMessageBox::NoRole);
|
||||
QAbstractButton* abort_button = confirm.addButton(QMessageBox::Cancel);
|
||||
confirm.exec();
|
||||
@@ -484,7 +481,7 @@ void Project::delete_selected_media() {
|
||||
} else if (confirm.clickedButton() == skip_button) {
|
||||
// remove media item and any folders containing it from the remove list
|
||||
Media* parent = item;
|
||||
while (parent != NULL) {
|
||||
while (parent != nullptr) {
|
||||
parents.append(parent);
|
||||
|
||||
// re-add item's siblings
|
||||
@@ -531,7 +528,7 @@ void Project::delete_selected_media() {
|
||||
// remove
|
||||
if (remove) {
|
||||
panel_effect_controls->clear_effects(true);
|
||||
if (sequence != NULL) sequence->selections.clear();
|
||||
if (sequence != nullptr) sequence->selections.clear();
|
||||
|
||||
// remove media and parents
|
||||
for (int m=0;m<parents.size();m++) {
|
||||
@@ -552,18 +549,18 @@ void Project::delete_selected_media() {
|
||||
Sequence* s = items.at(i)->to_sequence();
|
||||
|
||||
if (s == sequence) {
|
||||
ca->append(new ChangeSequenceAction(NULL));
|
||||
ca->append(new ChangeSequenceAction(nullptr));
|
||||
}
|
||||
|
||||
if (s == panel_footage_viewer->seq) {
|
||||
panel_footage_viewer->set_media(NULL);
|
||||
panel_footage_viewer->set_media(nullptr);
|
||||
}
|
||||
} else if (items.at(i)->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
if (panel_footage_viewer->seq != NULL) {
|
||||
if (panel_footage_viewer->seq != nullptr) {
|
||||
for (int j=0;j<panel_footage_viewer->seq->clips.size();j++) {
|
||||
Clip* c = panel_footage_viewer->seq->clips.at(j);
|
||||
if (c != NULL && c->media == items.at(i)) {
|
||||
panel_footage_viewer->set_media(NULL);
|
||||
if (c != nullptr && c->media == items.at(i)) {
|
||||
panel_footage_viewer->set_media(nullptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -603,8 +600,8 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla
|
||||
|
||||
if (!recursive) last_imported_media.clear();
|
||||
|
||||
bool create_undo_action = (!recursive && replace == NULL);
|
||||
ComboAction* ca;
|
||||
bool create_undo_action = (!recursive && replace == nullptr);
|
||||
ComboAction* ca = nullptr;
|
||||
if (create_undo_action) ca = new ComboAction();
|
||||
|
||||
for (int i=0;i<files.size();i++) {
|
||||
@@ -622,7 +619,7 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla
|
||||
subdir_filenames.append(subdir_files.at(j).filePath());
|
||||
}
|
||||
|
||||
process_file_list(subdir_filenames, true, NULL, folder);
|
||||
process_file_list(subdir_filenames, true, nullptr, folder);
|
||||
|
||||
if (create_undo_action) {
|
||||
ca->append(new AddMediaCommand(folder, parent));
|
||||
@@ -711,7 +708,7 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla
|
||||
Media* item;
|
||||
Footage* m;
|
||||
|
||||
if (replace != NULL) {
|
||||
if (replace != nullptr) {
|
||||
item = replace;
|
||||
m = replace->to_footage();
|
||||
m->reset();
|
||||
@@ -728,7 +725,7 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla
|
||||
|
||||
last_imported_media.append(item);
|
||||
|
||||
if (replace == NULL) {
|
||||
if (replace == nullptr) {
|
||||
if (create_undo_action) {
|
||||
ca->append(new AddMediaCommand(item, parent));
|
||||
} else {
|
||||
@@ -747,7 +744,7 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla
|
||||
|
||||
for (int i=0;i<last_imported_media.size();i++) {
|
||||
// generate waveform/thumbnail in another thread
|
||||
start_preview_generator(last_imported_media.at(i), replace != NULL);
|
||||
start_preview_generator(last_imported_media.at(i), replace != nullptr);
|
||||
}
|
||||
} else {
|
||||
delete ca;
|
||||
@@ -762,7 +759,7 @@ Media* Project::get_selected_folder() {
|
||||
Media* m = item_to_media(selected_items.at(0));
|
||||
if (m->get_type() == MEDIA_TYPE_FOLDER) return m;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool Project::reveal_media(Media *media, QModelIndex parent) {
|
||||
@@ -805,12 +802,12 @@ void Project::import_dialog() {
|
||||
|
||||
if (fd.exec()) {
|
||||
QStringList files = fd.selectedFiles();
|
||||
process_file_list(files, false, NULL, get_selected_folder());
|
||||
process_file_list(files, false, nullptr, get_selected_folder());
|
||||
}
|
||||
}
|
||||
|
||||
void Project::delete_clips_using_selected_media() {
|
||||
if (sequence == NULL) {
|
||||
if (sequence == nullptr) {
|
||||
QMessageBox::critical(this, "No active sequence", "No sequence is active, please open the sequence you want to delete clips from.", QMessageBox::Ok);
|
||||
} else {
|
||||
ComboAction* ca = new ComboAction();
|
||||
@@ -818,7 +815,7 @@ void Project::delete_clips_using_selected_media() {
|
||||
QModelIndexList items = get_current_selected();
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
if (c != NULL) {
|
||||
if (c != nullptr) {
|
||||
for (int j=0;j<items.size();j++) {
|
||||
Media* m = item_to_media(items.at(j));
|
||||
if (c->media == m) {
|
||||
@@ -849,7 +846,7 @@ void Project::clear() {
|
||||
QVector<Media*> sequences = list_all_project_sequences();
|
||||
for (int i=0;i<sequences.size();i++) {
|
||||
delete sequences.at(i)->to_sequence();
|
||||
sequences.at(i)->set_sequence(NULL);
|
||||
sequences.at(i)->set_sequence(nullptr);
|
||||
}
|
||||
|
||||
// delete everything else
|
||||
@@ -858,8 +855,8 @@ void Project::clear() {
|
||||
|
||||
void Project::new_project() {
|
||||
// clear existing project
|
||||
set_sequence(NULL);
|
||||
panel_footage_viewer->set_media(NULL);
|
||||
set_sequence(nullptr);
|
||||
panel_footage_viewer->set_media(nullptr);
|
||||
clear();
|
||||
mainWindow->setWindowModified(false);
|
||||
}
|
||||
@@ -895,7 +892,7 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
}
|
||||
// save_folder(stream, item, type, set_ids_only);
|
||||
} else {
|
||||
int folder = (m->parentItem() != NULL) ? m->parentItem()->temp_id : 0;
|
||||
int folder = (m->parentItem() != nullptr) ? m->parentItem()->temp_id : 0;
|
||||
if (type == MEDIA_TYPE_FOOTAGE) {
|
||||
Footage* f = m->to_footage();
|
||||
f->save_id = media_id;
|
||||
@@ -955,7 +952,7 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
|
||||
for (int j=0;j<s->transitions.size();j++) {
|
||||
Transition* t = s->transitions.at(j);
|
||||
if (t != NULL) {
|
||||
if (t != nullptr) {
|
||||
stream.writeStartElement("transition");
|
||||
stream.writeAttribute("id", QString::number(j));
|
||||
stream.writeAttribute("length", QString::number(t->get_true_length()));
|
||||
@@ -966,7 +963,7 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
|
||||
for (int j=0;j<s->clips.size();j++) {
|
||||
Clip* c = s->clips.at(j);
|
||||
if (c != NULL) {
|
||||
if (c != nullptr) {
|
||||
stream.writeStartElement("clip"); // clip
|
||||
stream.writeAttribute("id", QString::number(j));
|
||||
stream.writeAttribute("enabled", QString::number(c->enabled));
|
||||
@@ -987,7 +984,7 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
stream.writeAttribute("maintainpitch", QString::number(c->maintain_audio_pitch));
|
||||
stream.writeAttribute("reverse", QString::number(c->reverse));
|
||||
|
||||
if (c->media != NULL) {
|
||||
if (c->media != nullptr) {
|
||||
stream.writeAttribute("type", QString::number(c->media->get_type()));
|
||||
switch (c->media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
@@ -1184,7 +1181,7 @@ void Project::list_all_sequences_worker(QVector<Media*>* list, Media* parent) {
|
||||
|
||||
QVector<Media*> Project::list_all_project_sequences() {
|
||||
QVector<Media*> list;
|
||||
list_all_sequences_worker(&list, NULL);
|
||||
list_all_sequences_worker(&list, nullptr);
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -1198,7 +1195,7 @@ QModelIndexList Project::get_current_selected() {
|
||||
#define THROBBER_LIMIT 20
|
||||
#define THROBBER_SIZE 50
|
||||
|
||||
MediaThrobber::MediaThrobber(Media *i) : pixmap(":/icons/throbber.png"), animation(0), item(i), animator(NULL) {}
|
||||
MediaThrobber::MediaThrobber(Media *i) : pixmap(":/icons/throbber.png"), animation(0), item(i), animator(nullptr) {}
|
||||
|
||||
void MediaThrobber::start() {
|
||||
// set up throbber
|
||||
@@ -1218,7 +1215,7 @@ void MediaThrobber::animation_update() {
|
||||
}
|
||||
|
||||
void MediaThrobber::stop(int icon_type, bool replace) {
|
||||
if (animator != NULL) {
|
||||
if (animator != nullptr) {
|
||||
animator->stop();
|
||||
delete animator;
|
||||
}
|
||||
@@ -1236,7 +1233,7 @@ void MediaThrobber::stop(int icon_type, bool replace) {
|
||||
Sequence* s = sequences.at(i)->to_sequence();
|
||||
for (int j=0;j<s->clips.size();j++) {
|
||||
Clip* c = s->clips.at(j);
|
||||
if (c != NULL) {
|
||||
if (c != nullptr) {
|
||||
c->refresh();
|
||||
}
|
||||
}
|
||||
@@ -1246,6 +1243,6 @@ void MediaThrobber::stop(int icon_type, bool replace) {
|
||||
update_ui(replace);
|
||||
|
||||
panel_project->tree_view->viewport()->update();
|
||||
item->throbber = NULL;
|
||||
item->throbber = nullptr;
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user