aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/animationloader.cpp11
-rw-r--r--src/courtroom.cpp9
2 files changed, 8 insertions, 12 deletions
diff --git a/src/animationloader.cpp b/src/animationloader.cpp
index ae7bfe07..5f57cbe5 100644
--- a/src/animationloader.cpp
+++ b/src/animationloader.cpp
@@ -25,17 +25,6 @@ void AnimationLoader::load(const QString &fileName)
{
return;
}
- else if (fileName == QObject::tr("Invalid File"))
- {
- // Set the image to a null pixmap if it's invalid
- stopLoading();
- m_size = QSize(1, 1);
- m_frames.clear();
- m_frames.append(AnimationFrame(QPixmap(), 0));
- m_frame_count = 1;
- m_loop_count = 0;
- return;
- }
stopLoading();
m_file_name = fileName;
QImageReader *reader = new QImageReader;
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index ce4b982f..cf6a64b1 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -4526,7 +4526,14 @@ void Courtroom::set_scene(bool show_desk, const QString f_side)
QPair<QString, QRect> desk_pair = ao_app->get_pos_path(f_side, true);
ui_vp_background->loadAndPlayAnimation(bg_pair.first);
- ui_vp_desk->loadAndPlayAnimation(desk_pair.first);
+ if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path(desk_pair.first))))
+ {
+ ui_vp_desk->loadAndPlayAnimation(desk_pair.first);
+ }
+ else
+ {
+ show_desk = false;
+ }
double scale = double(ui_viewport->height()) / double(ui_vp_background->frameSize().height());
QSize scaled_size = ui_vp_background->frameSize() * scale;