mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Add support for loading image plugins through the settings folder of the apps.
This commit is contained in:
@ -15,6 +15,9 @@ Version counting is based on semantic versioning (Major.Feature.Patch)
|
|||||||
* Add a theme editor and support for custom themes.
|
* Add a theme editor and support for custom themes.
|
||||||
* Add an application language setting with a system default option in YACReader and YACReaderLibrary.
|
* Add an application language setting with a system default option in YACReader and YACReaderLibrary.
|
||||||
|
|
||||||
|
### All apps
|
||||||
|
* Add support for user-installed Qt image format plugins via the shared `plugins/imageformats` folder in the YACReader settings directory.
|
||||||
|
|
||||||
## 9.16.4
|
## 9.16.4
|
||||||
|
|
||||||
### YACReaderLibrary
|
### YACReaderLibrary
|
||||||
|
|||||||
@ -114,6 +114,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
app.setApplicationName("YACReader");
|
app.setApplicationName("YACReader");
|
||||||
app.setOrganizationName("YACReader");
|
app.setOrganizationName("YACReader");
|
||||||
|
YACReader::initializeSharedPluginPaths();
|
||||||
|
|
||||||
auto *appearanceConfig = new AppearanceConfiguration(
|
auto *appearanceConfig = new AppearanceConfiguration(
|
||||||
YACReader::getSettingsPath() + "/YACReader.ini", qApp);
|
YACReader::getSettingsPath() + "/YACReader.ini", qApp);
|
||||||
|
|||||||
@ -140,6 +140,7 @@ int main(int argc, char **argv)
|
|||||||
app.setApplicationName("YACReaderLibrary");
|
app.setApplicationName("YACReaderLibrary");
|
||||||
app.setOrganizationName("YACReader");
|
app.setOrganizationName("YACReader");
|
||||||
app.setApplicationVersion(VERSION);
|
app.setApplicationVersion(VERSION);
|
||||||
|
YACReader::initializeSharedPluginPaths();
|
||||||
|
|
||||||
// Theme initialization
|
// Theme initialization
|
||||||
auto *appearanceConfig = new AppearanceConfiguration(
|
auto *appearanceConfig = new AppearanceConfiguration(
|
||||||
|
|||||||
@ -48,6 +48,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
app.setApplicationName("YACReaderLibrary");
|
app.setApplicationName("YACReaderLibrary");
|
||||||
app.setOrganizationName("YACReader");
|
app.setOrganizationName("YACReader");
|
||||||
|
YACReader::initializeSharedPluginPaths();
|
||||||
|
|
||||||
QString buildNumber = ".0";
|
QString buildNumber = ".0";
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#include "global_info_provider.h"
|
#include "global_info_provider.h"
|
||||||
|
|
||||||
|
#include "yacreader_global.h"
|
||||||
|
|
||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
#include <QPaintDevice>
|
#include <QPaintDevice>
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
@ -24,6 +26,7 @@ QString YACReader::getGlobalInfo()
|
|||||||
text.append("\nAPP INFORMATION\n");
|
text.append("\nAPP INFORMATION\n");
|
||||||
QString supportedImageFormats = QImageReader::supportedImageFormats().join(", ");
|
QString supportedImageFormats = QImageReader::supportedImageFormats().join(", ");
|
||||||
text.append(QString("Image formats supported: %1\n").arg(supportedImageFormats));
|
text.append(QString("Image formats supported: %1\n").arg(supportedImageFormats));
|
||||||
|
text.append(QString("User image plugin folder: %1\n").arg(YACReader::getImageFormatsPluginsPath()));
|
||||||
// append if sqlite driver is available
|
// append if sqlite driver is available
|
||||||
#ifdef YACREADER_LIBRARY
|
#ifdef YACREADER_LIBRARY
|
||||||
text.append(QString("SQLite driver available: %1\n").arg(QSqlDatabase::isDriverAvailable("QSQLITE") ? "yes" : "no"));
|
text.append(QString("SQLite driver available: %1\n").arg(QSqlDatabase::isDriverAvailable("QSQLITE") ? "yes" : "no"));
|
||||||
|
|||||||
@ -12,6 +12,40 @@ QString YACReader::getSettingsPath()
|
|||||||
return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
|
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)
|
QString YACReader::colorToName(LabelColors colors)
|
||||||
{
|
{
|
||||||
switch (colors) {
|
switch (colors) {
|
||||||
|
|||||||
@ -103,6 +103,11 @@ QDataStream &operator<<(QDataStream &stream, const OpenComicSource &source);
|
|||||||
QDataStream &operator>>(QDataStream &stream, OpenComicSource &source);
|
QDataStream &operator>>(QDataStream &stream, OpenComicSource &source);
|
||||||
|
|
||||||
QString getSettingsPath();
|
QString getSettingsPath();
|
||||||
|
QString getCommonSettingsPath();
|
||||||
|
QString getCommonSettingsFilePath();
|
||||||
|
QString getPluginsPath();
|
||||||
|
QString getImageFormatsPluginsPath();
|
||||||
|
void initializeSharedPluginPaths();
|
||||||
QString colorToName(LabelColors colors);
|
QString colorToName(LabelColors colors);
|
||||||
QString labelColorToRGBString(LabelColors color);
|
QString labelColorToRGBString(LabelColors color);
|
||||||
QLibrary *load7zLibrary();
|
QLibrary *load7zLibrary();
|
||||||
|
|||||||
@ -7,9 +7,7 @@ YACReader::WhatsNewController::WhatsNewController() { }
|
|||||||
|
|
||||||
void YACReader::WhatsNewController::showWhatsNewIfNeeded(QWidget *fromParent)
|
void YACReader::WhatsNewController::showWhatsNewIfNeeded(QWidget *fromParent)
|
||||||
{
|
{
|
||||||
QSettings commonSettings(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
|
QSettings commonSettings(YACReader::getCommonSettingsFilePath(), QSettings::IniFormat);
|
||||||
"/YACReader/YACReaderCommon.ini",
|
|
||||||
QSettings::IniFormat);
|
|
||||||
|
|
||||||
if (commonSettings.value("LAST_VERSION_INSTALLED").toString() != VERSION) {
|
if (commonSettings.value("LAST_VERSION_INSTALLED").toString() != VERSION) {
|
||||||
showWhatsNew(fromParent);
|
showWhatsNew(fromParent);
|
||||||
|
|||||||
@ -57,6 +57,9 @@ YACReader::WhatsNewDialog::WhatsNewDialog(QWidget *parent)
|
|||||||
" • Add a theme editor and support for custom themes<br/>"
|
" • Add a theme editor and support for custom themes<br/>"
|
||||||
" • Add an application language setting with a system default option in YACReader and YACReaderLibrary<br/>"
|
" • Add an application language setting with a system default option in YACReader and YACReaderLibrary<br/>"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
|
"<span style=\"font-weight:600\">All apps</span><br/>"
|
||||||
|
" • Add support for user-installed Qt image format plugins via the shared <i>plugins/imageformats</i> folder in the YACReader settings directory<br/>"
|
||||||
|
"<br/>"
|
||||||
"I hope you enjoy the new update. Please, if you like YACReader consider to become a patron in <a href=\"https://www.patreon.com/yacreader\" style=\"color:%1;\">Patreon</a> "
|
"I hope you enjoy the new update. Please, if you like YACReader consider to become a patron in <a href=\"https://www.patreon.com/yacreader\" style=\"color:%1;\">Patreon</a> "
|
||||||
"or donate some money using <a href=\"https://www.paypal.com/donate?business=5TAMNQCDDMVP8&item_name=Support+YACReader\" style=\"color:%1;\">Pay-Pal</a> and help keeping the project alive. "
|
"or donate some money using <a href=\"https://www.paypal.com/donate?business=5TAMNQCDDMVP8&item_name=Support+YACReader\" style=\"color:%1;\">Pay-Pal</a> and help keeping the project alive. "
|
||||||
"Remember that there is an iOS version available in the <a href=\"https://apps.apple.com/app/id635717885\" style=\"color:%1;\">Apple App Store</a>, "
|
"Remember that there is an iOS version available in the <a href=\"https://apps.apple.com/app/id635717885\" style=\"color:%1;\">Apple App Store</a>, "
|
||||||
|
|||||||
Reference in New Issue
Block a user