Build system changed to Cmake, ORM changed to QxORM, Qt6 compatibility.
This commit is contained in:
+23
-23
@@ -18,24 +18,18 @@ class IPlugin
|
||||
{
|
||||
|
||||
public:
|
||||
IPlugin() {
|
||||
m_ui = NULL;
|
||||
m_service = NULL;
|
||||
m_settingsUi = NULL;
|
||||
}
|
||||
IPlugin() = default;
|
||||
|
||||
virtual ~IPlugin() {
|
||||
if (m_service != NULL)
|
||||
{
|
||||
delete m_service;
|
||||
}
|
||||
delete m_service;
|
||||
delete m_translator;
|
||||
|
||||
if (m_ui != NULL && m_ui->parent() == NULL)
|
||||
if (m_ui != nullptr && m_ui->parent() == nullptr)
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
if (m_settingsUi != NULL && m_settingsUi->parent() == NULL)
|
||||
if (m_settingsUi != nullptr && m_settingsUi->parent() == nullptr)
|
||||
{
|
||||
delete m_settingsUi;
|
||||
}
|
||||
@@ -56,18 +50,18 @@ public:
|
||||
if (!permEv.hasPermission(pluginId(), PERM_READ))
|
||||
{
|
||||
QMessageBox::critical(m_ui, QObject::tr("Permission denied"), QObject::tr("You don't have permission to open this plugin."));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IGridForm *form = qobject_cast<IGridForm*>(m_ui);
|
||||
bool filled = true;
|
||||
|
||||
if (form != NULL)
|
||||
if (form != nullptr)
|
||||
{
|
||||
filled = form->fillData();
|
||||
}
|
||||
|
||||
return filled ? m_ui : NULL;
|
||||
return filled ? m_ui : nullptr;
|
||||
}
|
||||
|
||||
QList<QFrame*> dasboardWidgets() {
|
||||
@@ -88,24 +82,30 @@ public:
|
||||
}
|
||||
|
||||
virtual bool showIcon() { return true; }
|
||||
virtual QTranslator* translator() { return NULL; }
|
||||
virtual QIcon pluginIcon() { return QIcon(); }
|
||||
virtual QTranslator* translator() { return nullptr; }
|
||||
virtual QIcon pluginIcon() { return {}; }
|
||||
QMap<QString, QString> translations() { return m_translations; }
|
||||
|
||||
virtual bool hasNumberSeries() { return false; }
|
||||
virtual QString numberSeriesPrefix() { return ""; }
|
||||
|
||||
protected:
|
||||
QTranslator* translatorFrom(QString fileName) {
|
||||
QTranslator *trans = new QTranslator();
|
||||
trans->load(fileName + QLocale::system().name());
|
||||
QTranslator* translatorFrom(const QString& fileName) {
|
||||
if (!m_translator) {
|
||||
m_translator = new QTranslator();
|
||||
|
||||
return trans;
|
||||
if (!m_translator->load(fileName + QLocale::system().name())) {
|
||||
qDebug() << "Cannot load translation";
|
||||
}
|
||||
}
|
||||
|
||||
return m_translator;
|
||||
}
|
||||
|
||||
QWidget *m_ui;
|
||||
QWidget *m_settingsUi;
|
||||
IService *m_service;
|
||||
QTranslator* m_translator{nullptr};
|
||||
QWidget *m_ui {nullptr};
|
||||
QWidget *m_settingsUi {nullptr};
|
||||
IService *m_service {nullptr};
|
||||
QMap<QString, QString> m_translations;
|
||||
QList<QFrame*> m_dashboardWidgets;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user