You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
committed by
AThousandShips
parent
0f95e9f8e6
commit
a1846b27ea
@@ -180,7 +180,7 @@ void AudioStreamImportSettingsDialog::_preview_changed(ObjectID p_which) {
|
||||
}
|
||||
|
||||
void AudioStreamImportSettingsDialog::_preview_zoom_in() {
|
||||
if (!stream.is_valid()) {
|
||||
if (stream.is_null()) {
|
||||
return;
|
||||
}
|
||||
float page_size = zoom_bar->get_page();
|
||||
@@ -192,7 +192,7 @@ void AudioStreamImportSettingsDialog::_preview_zoom_in() {
|
||||
}
|
||||
|
||||
void AudioStreamImportSettingsDialog::_preview_zoom_out() {
|
||||
if (!stream.is_valid()) {
|
||||
if (stream.is_null()) {
|
||||
return;
|
||||
}
|
||||
float page_size = zoom_bar->get_page();
|
||||
@@ -204,7 +204,7 @@ void AudioStreamImportSettingsDialog::_preview_zoom_out() {
|
||||
}
|
||||
|
||||
void AudioStreamImportSettingsDialog::_preview_zoom_reset() {
|
||||
if (!stream.is_valid()) {
|
||||
if (stream.is_null()) {
|
||||
return;
|
||||
}
|
||||
zoom_bar->set_max(stream->get_length());
|
||||
@@ -262,7 +262,7 @@ void AudioStreamImportSettingsDialog::_on_finished() {
|
||||
}
|
||||
|
||||
void AudioStreamImportSettingsDialog::_draw_indicator() {
|
||||
if (!stream.is_valid()) {
|
||||
if (stream.is_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ void AudioStreamImportSettingsDialog::_seek_to(real_t p_x) {
|
||||
}
|
||||
|
||||
void AudioStreamImportSettingsDialog::edit(const String &p_path, const String &p_importer, const Ref<AudioStream> &p_stream) {
|
||||
if (!stream.is_null()) {
|
||||
if (stream.is_valid()) {
|
||||
stream->disconnect_changed(callable_mp(this, &AudioStreamImportSettingsDialog::_audio_changed));
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ void AudioStreamImportSettingsDialog::edit(const String &p_path, const String &p
|
||||
String text = String::num(stream->get_length(), 2).pad_decimals(2) + "s";
|
||||
_duration_label->set_text(text);
|
||||
|
||||
if (!stream.is_null()) {
|
||||
if (stream.is_valid()) {
|
||||
stream->connect_changed(callable_mp(this, &AudioStreamImportSettingsDialog::_audio_changed));
|
||||
_preview->queue_redraw();
|
||||
_indicator->queue_redraw();
|
||||
|
||||
Reference in New Issue
Block a user