App refactoring finished
This commit is contained in:
parent
3ce1ec708d
commit
aed688224b
7 changed files with 36 additions and 76 deletions
|
|
@ -36,15 +36,14 @@
|
|||
#include "ui/pages_logic/protocols/ShadowSocksLogic.h"
|
||||
|
||||
|
||||
AmneziaApplication::AmneziaApplication(int &argc, char *argv[], bool allowSecondary,
|
||||
SingleApplication::Options options, int timeout, const QString &userData):
|
||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||
QAPPLICATION_CLASS(argc, argv);
|
||||
#else
|
||||
SingleApplication(argc, argv, allowSecondary, options, timeout, userData)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||
AmneziaApplication::AmneziaApplication(int &argc, char *argv[]):
|
||||
AMNEZIA_BASE_CLASS(argc, argv)
|
||||
#else
|
||||
AmneziaApplication::AmneziaApplication(int &argc, char *argv[], bool allowSecondary,
|
||||
SingleApplication::Options options, int timeout, const QString &userData):
|
||||
SingleApplication(argc, argv, allowSecondary, options, timeout, userData)
|
||||
#endif
|
||||
{
|
||||
setQuitOnLastWindowClosed(false);
|
||||
m_settings = std::shared_ptr<Settings>(new Settings);
|
||||
|
|
@ -59,6 +58,9 @@ AmneziaApplication::~AmneziaApplication()
|
|||
|
||||
QObject::disconnect(m_uiLogic, 0,0,0);
|
||||
delete m_uiLogic;
|
||||
|
||||
delete m_protocolProps;
|
||||
delete m_containerProps;
|
||||
}
|
||||
|
||||
void AmneziaApplication::init()
|
||||
|
|
@ -112,7 +114,7 @@ void AmneziaApplication::init()
|
|||
if (m_parser.isSet("a")) m_uiLogic->showOnStartup();
|
||||
else emit m_uiLogic->show();
|
||||
#else
|
||||
uiLogic->showOnStartup();
|
||||
m_uiLogic->showOnStartup();
|
||||
#endif
|
||||
|
||||
// TODO - fix
|
||||
|
|
@ -144,7 +146,6 @@ void AmneziaApplication::registerTypes()
|
|||
qRegisterMetaType<PageProtocolLogicBase *>("PageProtocolLogicBase *");
|
||||
|
||||
|
||||
|
||||
declareQmlPageEnum();
|
||||
declareQmlProtocolEnum();
|
||||
declareQmlContainerEnum();
|
||||
|
|
@ -152,11 +153,11 @@ void AmneziaApplication::registerTypes()
|
|||
qmlRegisterType<PageType>("PageType", 1, 0, "PageType");
|
||||
qmlRegisterType<QRCodeReader>("QRCodeReader", 1, 0, "QRCodeReader");
|
||||
|
||||
QScopedPointer<ContainerProps> containerProps(new ContainerProps);
|
||||
qmlRegisterSingletonInstance("ContainerProps", 1, 0, "ContainerProps", containerProps.get());
|
||||
m_containerProps = new ContainerProps;
|
||||
qmlRegisterSingletonInstance("ContainerProps", 1, 0, "ContainerProps", m_containerProps);
|
||||
|
||||
QScopedPointer<ProtocolProps> protocolProps(new ProtocolProps);
|
||||
qmlRegisterSingletonInstance("ProtocolProps", 1, 0, "ProtocolProps", protocolProps.get());
|
||||
m_protocolProps = new ProtocolProps;
|
||||
qmlRegisterSingletonInstance("ProtocolProps", 1, 0, "ProtocolProps", m_protocolProps);
|
||||
}
|
||||
|
||||
void AmneziaApplication::loadFonts()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue