Support relative paths in image API functions, combine projectDir calls

This commit is contained in:
GriffinR
2024-01-03 12:13:53 -05:00
parent d1c25a8eca
commit 2c61df578a
9 changed files with 62 additions and 44 deletions

View File

@@ -21,9 +21,7 @@ void SpeciesComboDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
if (path.isEmpty()) {
path = this->project->speciesToIconPath.value(species);
} else {
QFileInfo info(path);
if (info.isRelative())
path = QDir::cleanPath(projectConfig.getProjectDir() + QDir::separator() + path);
path = Project::getExistingFilepath(path);
}
QImage img(path);