Implemented application login.

Minor UI improvement.
Fixed memory leaks.
This commit is contained in:
2016-02-09 10:04:17 +01:00
parent 3d68281c87
commit c722fe743c
24 changed files with 455 additions and 33 deletions
+21 -1
View File
@@ -15,6 +15,11 @@
#include "roles/roles.h"
#include "permissionservice.h"
Context::~Context()
{
this->destroy();
}
Context &Context::instance()
{
static Context ctx;
@@ -91,7 +96,10 @@ void Context::destroy()
m_dbOpened = false;
}
delete m_settings;
if (m_settings != NULL && m_settings->parent() == NULL)
{
delete m_settings;
}
foreach (IPlugin *plugin, m_plugins)
{
@@ -112,6 +120,16 @@ Context::Context()
m_dbOpened = false;
}
QSharedPointer<User> Context::currentUser() const
{
return m_currentUser;
}
void Context::setCurrentUser(const QSharedPointer<User> &currentUser)
{
m_currentUser = currentUser;
}
void Context::checkDb(const QString &path)
{
{
@@ -226,4 +244,6 @@ void Context::checkPermissions()
}
}
}
permService.checkForAdmin();
}