Add support for loading image plugins through the settings folder of the apps.

This commit is contained in:
luisangelsm
2026-03-14 09:23:20 +01:00
parent 3709b6e737
commit 754ea0c2f6
9 changed files with 52 additions and 3 deletions

View File

@ -12,6 +12,40 @@ QString YACReader::getSettingsPath()
return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
}
QString YACReader::getCommonSettingsPath()
{
const auto organizationName = QCoreApplication::organizationName().trimmed();
const auto basePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
if (organizationName.isEmpty())
return basePath;
return QDir(basePath).filePath(organizationName);
}
QString YACReader::getCommonSettingsFilePath()
{
return QDir(getCommonSettingsPath()).filePath("YACReaderCommon.ini");
}
QString YACReader::getPluginsPath()
{
return QDir(getCommonSettingsPath()).filePath("plugins");
}
QString YACReader::getImageFormatsPluginsPath()
{
return QDir(getPluginsPath()).filePath("imageformats");
}
void YACReader::initializeSharedPluginPaths()
{
QDir().mkpath(getImageFormatsPluginsPath());
const QString pluginsPath = QDir(getPluginsPath()).absolutePath();
QCoreApplication::addLibraryPath(pluginsPath);
}
QString YACReader::colorToName(LabelColors colors)
{
switch (colors) {