refactored path functions and added support for case-sensitive filesystems

This commit is contained in:
David Skoland 2018-11-16 02:01:08 +01:00
parent 11c2f258eb
commit 8ffdd2afb8
16 changed files with 162 additions and 139 deletions

View File

@ -102,12 +102,11 @@ public:
QString get_default_theme_path(QString p_file); QString get_default_theme_path(QString p_file);
QString get_character_path(QString p_character, QString p_file); QString get_character_path(QString p_character, QString p_file);
QString get_character_emotions_path(QString p_character, QString p_file); QString get_character_emotions_path(QString p_character, QString p_file);
QString get_demothings_path();
QString get_sounds_path(); QString get_sounds_path();
QString get_music_path(QString p_song); QString get_music_path(QString p_song);
QString get_background_path(); QString get_background_path(QString p_file);
QString get_default_background_path(); QString get_default_background_path(QString p_file);
QString get_evidence_path(); QString get_evidence_path(QString p_file);
QString get_case_sensitive_path(QString p_file); QString get_case_sensitive_path(QString p_file);
////// Functions for reading and writing files ////// ////// Functions for reading and writing files //////

View File

@ -15,8 +15,8 @@ AOButton::~AOButton()
void AOButton::set_image(QString p_image) void AOButton::set_image(QString p_image)
{ {
QString image_path = ao_app->get_theme_path() + p_image; QString image_path = ao_app->get_theme_path(p_image);
QString default_image_path = ao_app->get_default_theme_path() + p_image; QString default_image_path = ao_app->get_default_theme_path(p_image);
if (file_exists(image_path)) if (file_exists(image_path))
this->setStyleSheet("border-image:url(\"" + image_path + "\")"); this->setStyleSheet("border-image:url(\"" + image_path + "\")");

View File

@ -19,10 +19,10 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_
void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
{ {
QString original_path = ao_app->get_character_path(p_char) + emote_prefix + p_emote.toLower() + ".gif"; QString original_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".gif");
QString alt_path = ao_app->get_character_path(p_char) + p_emote.toLower() + ".png"; QString alt_path = ao_app->get_character_path(p_char, p_emote + ".png");
QString placeholder_path = ao_app->get_theme_path() + "placeholder.gif"; QString placeholder_path = ao_app->get_theme_path("placeholder.gif");
QString placeholder_default_path = ao_app->get_default_theme_path() + "placeholder.gif"; QString placeholder_default_path = ao_app->get_default_theme_path("placeholder.gif");
QString gif_path; QString gif_path;
if (file_exists(original_path)) if (file_exists(original_path))
@ -58,7 +58,7 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
{ {
QString gif_path = ao_app->get_character_path(p_char) + p_emote.toLower(); QString gif_path = ao_app->get_character_path(p_char, p_emote);
m_movie->stop(); m_movie->stop();
this->clear(); this->clear();
@ -107,7 +107,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
void AOCharMovie::play_talking(QString p_char, QString p_emote) void AOCharMovie::play_talking(QString p_char, QString p_emote)
{ {
QString gif_path = ao_app->get_character_path(p_char) + "(b)" + p_emote.toLower(); QString gif_path = ao_app->get_character_path(p_char, "(b)" + p_emote);
m_movie->stop(); m_movie->stop();
this->clear(); this->clear();
@ -120,7 +120,7 @@ void AOCharMovie::play_talking(QString p_char, QString p_emote)
void AOCharMovie::play_idle(QString p_char, QString p_emote) void AOCharMovie::play_idle(QString p_char, QString p_emote)
{ {
QString gif_path = ao_app->get_character_path(p_char) + "(a)" + p_emote.toLower(); QString gif_path = ao_app->get_character_path(p_char, "(a)" + p_emote);
m_movie->stop(); m_movie->stop();
this->clear(); this->clear();

View File

@ -16,19 +16,13 @@ AOEmoteButton::AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x
void AOEmoteButton::set_image(QString p_char, int p_emote, QString suffix) void AOEmoteButton::set_image(QString p_char, int p_emote, QString suffix)
{ {
QString emotion_number = QString::number(p_emote + 1); QString emotion_number = QString::number(p_emote + 1);
QString image_path = ao_app->get_character_path(p_char) + "emotions/ao2/button" + emotion_number + suffix; QString image_path = ao_app->get_character_emotions_path(p_char, "button" + emotion_number + suffix);
QString alt_path = ao_app->get_character_path(p_char) + "emotions/button" + emotion_number + suffix;
if (file_exists(image_path)) if (file_exists(image_path))
{ {
this->setText(""); this->setText("");
this->setStyleSheet("border-image:url(\"" + image_path + "\")"); this->setStyleSheet("border-image:url(\"" + image_path + "\")");
} }
else if (file_exists(alt_path))
{
this->setText("");
this->setStyleSheet("border-image:url(\"" + alt_path + "\")");
}
else else
{ {
this->setText(ao_app->get_emote_comment(p_char, p_emote)); this->setText(ao_app->get_emote_comment(p_char, p_emote));

View File

@ -37,7 +37,7 @@ void AOEvidenceButton::reset()
void AOEvidenceButton::set_image(QString p_image) void AOEvidenceButton::set_image(QString p_image)
{ {
QString image_path = ao_app->get_evidence_path() + p_image; QString image_path = ao_app->get_evidence_path(p_image);
if (file_exists(image_path)) if (file_exists(image_path))
{ {
@ -53,8 +53,8 @@ void AOEvidenceButton::set_image(QString p_image)
void AOEvidenceButton::set_theme_image(QString p_image) void AOEvidenceButton::set_theme_image(QString p_image)
{ {
QString theme_image_path = ao_app->get_theme_path() + p_image; QString theme_image_path = ao_app->get_theme_path(p_image);
QString default_image_path = ao_app->get_default_theme_path() + p_image; QString default_image_path = ao_app->get_default_theme_path(p_image);
QString final_image_path; QString final_image_path;

View File

@ -21,7 +21,7 @@ void AOEvidenceDisplay::show_evidence(QString p_evidence_image, bool is_left_sid
sfx_player->set_volume(p_volume); sfx_player->set_volume(p_volume);
QString f_evidence_path = ao_app->get_evidence_path() + p_evidence_image; QString f_evidence_path = ao_app->get_evidence_path(p_evidence_image);
QPixmap f_pixmap(f_evidence_path); QPixmap f_pixmap(f_evidence_path);
@ -47,8 +47,8 @@ void AOEvidenceDisplay::show_evidence(QString p_evidence_image, bool is_left_sid
evidence_icon->setPixmap(f_pixmap.scaled(evidence_icon->width(), evidence_icon->height(), Qt::IgnoreAspectRatio)); evidence_icon->setPixmap(f_pixmap.scaled(evidence_icon->width(), evidence_icon->height(), Qt::IgnoreAspectRatio));
QString f_default_gif_path = ao_app->get_default_theme_path() + gif_name; QString f_default_gif_path = ao_app->get_default_theme_path(gif_name);
QString f_gif_path = ao_app->get_theme_path() + gif_name; QString f_gif_path = ao_app->get_theme_path(gif_name);
if (file_exists(f_gif_path)) if (file_exists(f_gif_path))
final_gif_path = f_gif_path; final_gif_path = f_gif_path;

View File

@ -15,8 +15,8 @@ AOImage::~AOImage()
void AOImage::set_image(QString p_image) void AOImage::set_image(QString p_image)
{ {
QString theme_image_path = ao_app->get_theme_path() + p_image; QString theme_image_path = ao_app->get_theme_path(p_image);
QString default_image_path = ao_app->get_default_theme_path() + p_image; QString default_image_path = ao_app->get_default_theme_path(p_image);
QString final_image_path; QString final_image_path;
@ -32,7 +32,7 @@ void AOImage::set_image(QString p_image)
void AOImage::set_image_from_path(QString p_path) void AOImage::set_image_from_path(QString p_path)
{ {
QString default_path = ao_app->get_default_theme_path() + "chatmed.png"; QString default_path = ao_app->get_default_theme_path("chatmed.png");
QString final_path; QString final_path;

View File

@ -28,15 +28,15 @@ void AOMovie::play(QString p_gif, QString p_char, QString p_custom_theme)
QString custom_path; QString custom_path;
if (p_gif == "custom") if (p_gif == "custom")
custom_path = ao_app->get_character_path(p_char) + p_gif + ".gif"; custom_path = ao_app->get_character_path(p_char, p_gif + ".gif");
else else
custom_path = ao_app->get_character_path(p_char) + p_gif + "_bubble.gif"; custom_path = ao_app->get_character_path(p_char, p_gif + "_bubble.gif");
QString custom_theme_path = ao_app->get_base_path() + "themes/" + p_custom_theme + "/" + p_gif + ".gif"; QString custom_theme_path = ao_app->get_base_path() + "themes/" + p_custom_theme + "/" + p_gif + ".gif";
QString theme_path = ao_app->get_theme_path() + p_gif + ".gif"; QString theme_path = ao_app->get_theme_path(p_gif + ".gif");
QString default_theme_path = ao_app->get_default_theme_path() + p_gif + ".gif"; QString default_theme_path = ao_app->get_default_theme_path(p_gif + ".gif");
QString placeholder_path = ao_app->get_theme_path() + "placeholder.gif"; QString placeholder_path = ao_app->get_theme_path("placeholder.gif");
QString default_placeholder_path = ao_app->get_default_theme_path() + "placeholder.gif"; QString default_placeholder_path = ao_app->get_default_theme_path("placeholder.gif");
if (file_exists(custom_path)) if (file_exists(custom_path))
gif_path = custom_path; gif_path = custom_path;

View File

@ -10,9 +10,9 @@ AOScene::AOScene(QWidget *parent, AOApplication *p_ao_app) : QLabel(parent)
void AOScene::set_image(QString p_image) void AOScene::set_image(QString p_image)
{ {
QString background_path = ao_app->get_background_path() + p_image + ".png"; QString background_path = ao_app->get_background_path(p_image + ".png");
QString animated_background_path = ao_app->get_background_path() + p_image + ".gif"; QString animated_background_path = ao_app->get_background_path(p_image + ".gif");
QString default_path = ao_app->get_default_background_path() + p_image; QString default_path = ao_app->get_default_background_path(p_image + ".png");
QPixmap background(background_path); QPixmap background(background_path);
QPixmap animated_background(animated_background_path); QPixmap animated_background(animated_background_path);
@ -34,8 +34,8 @@ void AOScene::set_legacy_desk(QString p_image)
//vanilla desks vary in both width and height. in order to make that work with viewport rescaling, //vanilla desks vary in both width and height. in order to make that work with viewport rescaling,
//some INTENSE math is needed. //some INTENSE math is needed.
QString desk_path = ao_app->get_background_path() + p_image; QString desk_path = ao_app->get_background_path(p_image);
QString default_path = ao_app->get_default_background_path() + p_image; QString default_path = ao_app->get_default_background_path(p_image);
QPixmap f_desk; QPixmap f_desk;
@ -53,7 +53,7 @@ void AOScene::set_legacy_desk(QString p_image)
//int final_y = y_modifier * vp_height; //int final_y = y_modifier * vp_height;
//int final_w = w_modifier * f_desk.width(); //int final_w = w_modifier * f_desk.width();
int final_h = h_modifier * f_desk.height(); int final_h = static_cast<int>(h_modifier * f_desk.height());
//this->resize(final_w, final_h); //this->resize(final_w, final_h);
//this->setPixmap(f_desk.scaled(final_w, final_h)); //this->setPixmap(f_desk.scaled(final_w, final_h));

View File

@ -19,7 +19,7 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char)
p_sfx = p_sfx.toLower(); p_sfx = p_sfx.toLower();
QString f_path; QString f_path;
if (p_char != "") if (p_char != "")
f_path = ao_app->get_character_path(p_char) + p_sfx; f_path = ao_app->get_character_path(p_char, p_sfx);
else else
f_path = ao_app->get_sounds_path() + p_sfx; f_path = ao_app->get_sounds_path() + p_sfx;

View File

@ -140,12 +140,11 @@ void Courtroom::char_clicked(int n_char)
{ {
int n_real_char = n_char + current_char_page * max_chars_on_page; int n_real_char = n_char + current_char_page * max_chars_on_page;
QString char_ini_path = ao_app->get_character_path(char_list.at(n_real_char).name) + "char.ini"; QString char_ini_path = ao_app->get_character_path(char_list.at(n_real_char).name, "char.ini");
qDebug() << "char_ini_path" << char_ini_path; qDebug() << "char_ini_path" << char_ini_path;
if (!file_exists(char_ini_path)) if (!file_exists(char_ini_path))
{ {
qDebug() << "did not find " << char_ini_path;
call_notice("Could not find " + char_ini_path); call_notice("Could not find " + char_ini_path);
return; return;
} }

View File

@ -319,7 +319,7 @@ void Courtroom::set_widgets()
//the size of the ui_vp_legacy_desk element relies on various factors and is set in set_scene() //the size of the ui_vp_legacy_desk element relies on various factors and is set in set_scene()
double y_modifier = 147.0 / 192.0; double y_modifier = 147.0 / 192.0;
int final_y = y_modifier * ui_viewport->height(); int final_y = static_cast<int>(y_modifier * ui_viewport->height());
ui_vp_legacy_desk->move(0, final_y); ui_vp_legacy_desk->move(0, final_y);
ui_vp_legacy_desk->hide(); ui_vp_legacy_desk->hide();
@ -620,11 +620,10 @@ void Courtroom::set_background(QString p_background)
testimony_in_progress = false; testimony_in_progress = false;
current_background = p_background; current_background = p_background;
QString bg_path = get_background_path();
is_ao2_bg = file_exists(bg_path + "defensedesk.png") && is_ao2_bg = file_exists(ao_app->get_background_path("defensedesk.png")) &&
file_exists(bg_path + "prosecutiondesk.png") && file_exists(ao_app->get_background_path("prosecutiondesk.png")) &&
file_exists(bg_path + "stand.png"); file_exists(ao_app->get_background_path("stand.png"));
if (is_ao2_bg) if (is_ao2_bg)
{ {
@ -696,11 +695,9 @@ void Courtroom::enter_courtroom(int p_cid)
ui_prosecution_plus->hide(); ui_prosecution_plus->hide();
} }
QString char_path = ao_app->get_character_path(current_char);
if (ao_app->custom_objection_enabled && if (ao_app->custom_objection_enabled &&
file_exists(char_path + "custom.gif") && file_exists(ao_app->get_character_path(current_char, "custom.gif")) &&
file_exists(char_path + "custom.wav")) file_exists(ao_app->get_character_path(current_char, "custom.wav")))
ui_custom_objection->show(); ui_custom_objection->show();
else else
ui_custom_objection->hide(); ui_custom_objection->hide();
@ -1197,12 +1194,12 @@ void Courtroom::play_preanim()
sfx_delay_timer->start(sfx_delay); sfx_delay_timer->start(sfx_delay);
if (!file_exists(ao_app->get_character_path(f_char) + f_preanim.toLower() + ".gif") || if (!file_exists(ao_app->get_character_path(f_char, f_preanim.toLower() + ".gif")) ||
preanim_duration < 0) preanim_duration < 0)
{ {
anim_state = 1; anim_state = 1;
preanim_done(); preanim_done();
qDebug() << "could not find " + ao_app->get_character_path(f_char) + f_preanim.toLower() + ".gif"; qDebug() << "could not find " + ao_app->get_character_path(f_char, f_preanim.toLower() + ".gif");
return; return;
} }

View File

@ -100,13 +100,10 @@ public:
//send a message that the player is banned and quits the server //send a message that the player is banned and quits the server
void set_ban(int p_cid); void set_ban(int p_cid);
//implementations in path_functions.cpp
QString get_background_path();
QString get_default_background_path(QString p_file);
//cid = character id, returns the cid of the currently selected character //cid = character id, returns the cid of the currently selected character
int get_cid() {return m_cid;} int get_cid() {return m_cid;}
QString get_current_char() {return current_char;} QString get_current_char() {return current_char;}
QString get_current_background() {return current_background;}
//properly sets up some varibles: resets user state //properly sets up some varibles: resets user state
void enter_courtroom(int p_cid); void enter_courtroom(int p_cid);

View File

@ -195,7 +195,7 @@ void Courtroom::on_evidence_image_button_clicked()
dialog.setFileMode(QFileDialog::ExistingFile); dialog.setFileMode(QFileDialog::ExistingFile);
dialog.setNameFilter(tr("Images (*.png)")); dialog.setNameFilter(tr("Images (*.png)"));
dialog.setViewMode(QFileDialog::List); dialog.setViewMode(QFileDialog::List);
dialog.setDirectory(ao_app->get_evidence_path()); dialog.setDirectory(ao_app->get_base_path() + "evidence");
QStringList filenames; QStringList filenames;

View File

@ -46,91 +46,128 @@ QString AOApplication::get_data_path()
return get_base_path() + "data/"; return get_base_path() + "data/";
} }
QString AOApplication::get_theme_path() QString AOApplication::get_default_theme_path(QString p_file)
{
return get_base_path() + "themes/" + current_theme.toLower() + "/";
}
QString AOApplication::get_default_theme_path()
{
return get_base_path() + "themes/default/";
}
QString AOApplication::get_character_path(QString p_character)
{
return get_base_path() + "characters/" + p_character.toLower() + "/";
}
QString AOApplication::get_demothings_path()
{
QString default_path = "misc/demothings/";
QString alt_path = "misc/RosterImages";
if (dir_exists(default_path))
return get_base_path() + default_path;
else if (dir_exists(alt_path))
return get_base_path() + alt_path;
else
return get_base_path() + default_path;
}
QString AOApplication::get_sounds_path()
{
return get_base_path() + "sounds/general/";
}
QString AOApplication::get_music_path(QString p_song)
{ {
QString path = get_base_path() + "themes/default/" + p_file;
#ifndef CASE_SENSITIVE_FILESYSTEM #ifndef CASE_SENSITIVE_FILESYSTEM
return get_base_path() + "sounds/music/" + p_song; return path;
#else #else
return get_case_sensitive_path(get_base_path() + "sounds/music/", p_song); return get_case_sensitive_path(path);
#endif #endif
} }
QString AOApplication::get_background_path() //assume that the capitalization of the theme in config is correct
QString AOApplication::get_theme_path(QString p_file)
{ {
if (courtroom_constructed) QString path = get_base_path() + "themes/" + current_theme + "/" + p_file;
return w_courtroom->get_background_path(); #ifndef CASE_SENSITIVE_FILESYSTEM
return path;
#else
return get_case_sensitive_path(path);
#endif
}
QString AOApplication::get_character_path(QString p_character, QString p_file)
{
QString char_path = get_base_path() + "characters/" + p_character;
#ifndef CASE_SENSITIVE_FILESYSTEM
return char_path + "/" + p_file;
#else
//need two calls to get_case_sensitive_path because character folder name may be wrong as well as the filename
return get_case_sensitive_path(
get_case_sensitive_path(char_path) + "/" + p_file);
#endif
}
QString AOApplication::get_character_emotions_path(QString p_character, QString p_file)
{
QString char_path = get_base_path() + "characters/" + p_character;
#ifndef CASE_SENSITIVE_FILESYSTEM
return char_path + "/emotions/" + p_file;
#else
return get_case_sensitive_path(
get_case_sensitive_path(char_path) + "/emotions/" + p_file);
#endif
}
QString AOApplication::get_sounds_path()
{
QString path = get_base_path() + "sounds/general/";
#ifndef CASE_SENSITIVE_FILESYSTEM
return path;
#else
return get_case_sensitive_path(path);
#endif
}
QString AOApplication::get_music_path(QString p_song)
{
QString path = get_base_path() + "sounds/music/" + p_song;
#ifndef CASE_SENSITIVE_FILESYSTEM
return path;
#else
return get_case_sensitive_path(path);
#endif
}
QString AOApplication::get_background_path(QString p_file)
{
QString bg_path = get_base_path() + "background/" + w_courtroom->get_current_background();
if (courtroom_constructed) {
#ifndef CASE_SENSITIVE_FILESYSTEM
return bg_path + "/" + p_file;
#else
return get_case_sensitive_path(
get_case_sensitive_path(bg_path) + "/" + p_file);
#endif
}
//this function being called when the courtroom isn't constructed makes no sense //this function being called when the courtroom isn't constructed makes no sense
return ""; return "";
} }
QString AOApplication::get_default_background_path() QString AOApplication::get_default_background_path(QString p_file)
{ {
return get_base_path() + "background/default/"; QString path = get_base_path() + "background/default/" + p_file;
#ifndef CASE_SENSITIVE_FILESYSTEM
return path;
#else
return get_case_sensitive_path(path);
#endif
} }
QString AOApplication::get_evidence_path() QString AOApplication::get_evidence_path(QString p_file)
{ {
QString default_path = "evidence/"; QString path = get_base_path() + "evidence/" + p_file;
QString alt_path = "items/"; #ifndef CASE_SENSITIVE_FILESYSTEM
if (dir_exists(default_path)) return path;
return get_base_path() + default_path; #else
else if (dir_exists(alt_path)) return get_case_sensitive_path(path);
return get_base_path() + alt_path; #endif
else
return get_base_path() + default_path;
} }
QString AOApplication::get_case_sensitive_path(QString p_dir, QString p_file) { QString AOApplication::get_case_sensitive_path(QString p_file) {
qDebug() << "calling get_case_sensitive_path"; qDebug() << "calling get_case_sensitive_path: " << p_file;
QRegExp file_rx = QRegExp(p_file, Qt::CaseInsensitive);
QStringList files = QDir(p_dir).entryList(); QFileInfo file(p_file);
//quick check to see if it's actually there first
if (file.exists()) return p_file;
QString file_name = file.fileName();
qDebug() << "file_name: " << file_name;
QString file_path = file.absolutePath();
qDebug() << "file_path: " << file_path;
QRegExp file_rx = QRegExp(file_name, Qt::CaseInsensitive);
QStringList files = QDir(file_path).entryList();
int result = files.indexOf(file_rx); int result = files.indexOf(file_rx);
if (result != -1) { if (result != -1)
QString path = p_dir + files.at(result); return file_path + "/" + files.at(result);
qDebug() << "returning " << path;
return path;
}
//if nothing is found, let the caller handle the missing file //if nothing is found, let the caller handle the missing file
return p_dir + p_file; return p_file;
}
QString Courtroom::get_background_path()
{
return ao_app->get_base_path() + "background/" + current_background.toLower() + "/";
}
QString Courtroom::get_default_background_path()
{
return ao_app->get_base_path() + "background/default/";
} }

View File

@ -212,8 +212,8 @@ QString AOApplication::read_design_ini(QString p_identifier, QString p_design_pa
QPoint AOApplication::get_button_spacing(QString p_identifier, QString p_file) QPoint AOApplication::get_button_spacing(QString p_identifier, QString p_file)
{ {
QString design_ini_path = get_theme_path() + p_file; QString design_ini_path = get_theme_path(p_file);
QString default_path = get_default_theme_path() + p_file; QString default_path = get_default_theme_path(p_file);
QString f_result = read_design_ini(p_identifier, design_ini_path); QString f_result = read_design_ini(p_identifier, design_ini_path);
QPoint return_value; QPoint return_value;
@ -242,8 +242,8 @@ QPoint AOApplication::get_button_spacing(QString p_identifier, QString p_file)
pos_size_type AOApplication::get_element_dimensions(QString p_identifier, QString p_file) pos_size_type AOApplication::get_element_dimensions(QString p_identifier, QString p_file)
{ {
QString design_ini_path = get_theme_path() + p_file; QString design_ini_path = get_theme_path(p_file);
QString default_path = get_default_theme_path() + p_file; QString default_path = get_default_theme_path(p_file);
QString f_result = read_design_ini(p_identifier, design_ini_path); QString f_result = read_design_ini(p_identifier, design_ini_path);
pos_size_type return_value; pos_size_type return_value;
@ -276,8 +276,8 @@ pos_size_type AOApplication::get_element_dimensions(QString p_identifier, QStrin
int AOApplication::get_font_size(QString p_identifier, QString p_file) int AOApplication::get_font_size(QString p_identifier, QString p_file)
{ {
QString design_ini_path = get_theme_path() + p_file; QString design_ini_path = get_theme_path(p_file);
QString default_path = get_default_theme_path() + p_file; QString default_path = get_default_theme_path(p_file);
QString f_result = read_design_ini(p_identifier, design_ini_path); QString f_result = read_design_ini(p_identifier, design_ini_path);
if (f_result == "") if (f_result == "")
@ -293,8 +293,8 @@ int AOApplication::get_font_size(QString p_identifier, QString p_file)
QColor AOApplication::get_color(QString p_identifier, QString p_file) QColor AOApplication::get_color(QString p_identifier, QString p_file)
{ {
QString design_ini_path = get_theme_path() + p_file; QString design_ini_path = get_theme_path(p_file);
QString default_path = get_default_theme_path() + p_file; QString default_path = get_default_theme_path(p_file);
QString f_result = read_design_ini(p_identifier, design_ini_path); QString f_result = read_design_ini(p_identifier, design_ini_path);
QColor return_color(255, 255, 255); QColor return_color(255, 255, 255);
@ -321,8 +321,8 @@ QColor AOApplication::get_color(QString p_identifier, QString p_file)
QString AOApplication::get_sfx(QString p_identifier) QString AOApplication::get_sfx(QString p_identifier)
{ {
QString design_ini_path = get_theme_path() + "courtroom_sounds.ini"; QString design_ini_path = get_theme_path("courtroom_sounds.ini");
QString default_path = get_default_theme_path() + "courtroom_sounds.ini"; QString default_path = get_default_theme_path("courtroom_sounds.ini");
QString f_result = read_design_ini(p_identifier, design_ini_path); QString f_result = read_design_ini(p_identifier, design_ini_path);
QString return_sfx = ""; QString return_sfx = "";
@ -344,7 +344,7 @@ QString AOApplication::get_sfx(QString p_identifier)
//returns the empty string if the search line couldnt be found //returns the empty string if the search line couldnt be found
QString AOApplication::read_char_ini(QString p_char, QString p_search_line, QString target_tag, QString terminator_tag) QString AOApplication::read_char_ini(QString p_char, QString p_search_line, QString target_tag, QString terminator_tag)
{ {
QString char_ini_path = get_character_path(p_char) + "char.ini"; QString char_ini_path = get_character_path(p_char, "char.ini");
QFile char_ini; QFile char_ini;