Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4129c1f

Browse files
authored
Fix slide position overriding when it shouldn't (AttorneyOnline#1023)
* Fix slide position overriding when it shouldn't * Cover all positions instead
1 parent 640b026 commit 4129c1f

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

src/path_functions.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,14 @@ BackgroundPosition AOApplication::get_pos_path(const QString &pos)
8282
{
8383
// witness is default if pos is invalid
8484
QString f_pos = pos;
85+
8586
// legacy overrides for new format if found
86-
if (pos == "def" && file_exists(get_image_suffix(get_background_path("court"))))
87-
{
88-
f_pos = "court:def";
89-
}
90-
else if (pos == "pro" && file_exists(get_image_suffix(get_background_path("court"))))
87+
if (file_exists(get_image_suffix(get_background_path("court"))))
9188
{
92-
f_pos = "court:pro";
93-
}
94-
else if (pos == "wit" && file_exists(get_image_suffix(get_background_path("court"))))
95-
{
96-
f_pos = "court:wit";
89+
if (!read_design_ini("court:" + f_pos + "/origin", get_background_path("design.ini")).isEmpty())
90+
{
91+
f_pos = QString("court:%1").arg(f_pos);
92+
}
9793
}
9894
QStringList f_pos_split = f_pos.split(":");
9995

0 commit comments

Comments
 (0)