Implemented application login.
Minor UI improvement. Fixed memory leaks.
This commit is contained in:
+21
-1
@@ -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> ¤tUser)
|
||||
{
|
||||
m_currentUser = currentUser;
|
||||
}
|
||||
|
||||
void Context::checkDb(const QString &path)
|
||||
{
|
||||
{
|
||||
@@ -226,4 +244,6 @@ void Context::checkPermissions()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
permService.checkForAdmin();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user