start working on 0.7.x branch
- added FileLog which stores content to the file log - now Log is only a wrapper - it puts messages to the local buffer and when logsave is used then the buffer is put to FileLog - new base classes: WinixBase (Log, Config*, Synchro*) WinixModel : public WinixBase (morm::ModelConnector*, Plugin*) WinixSystem : public WinixModel (System*) WinixRequest : public WinixSystem (SLog, Cur*) - singletons: log, slog, plugin are depracated - now references to them are in base classses (WinixBase, WinixModel) - DbBase, DbConn and Db are depracated - now we are using Morm project (in WinixModel there is a model_connector pointer) each thread will have its own ModelConnector git-svn-id: svn://ttmath.org/publicrep/winix/branches/0.7.x@1146 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
#include "error.h"
|
||||
#include "templates/templates.h"
|
||||
#include "functions/functions.h"
|
||||
#include "plugin.h"
|
||||
|
||||
|
||||
|
||||
@@ -53,10 +52,10 @@ void System::SetCur(Cur * pcur)
|
||||
}
|
||||
|
||||
|
||||
void System::SetConfig(Config * pconfig)
|
||||
{
|
||||
config = pconfig;
|
||||
}
|
||||
//void System::SetConfig(Config * pconfig)
|
||||
//{
|
||||
// config = pconfig;
|
||||
//}
|
||||
|
||||
|
||||
void System::SetDb(Db * pdb)
|
||||
@@ -65,10 +64,10 @@ void System::SetDb(Db * pdb)
|
||||
}
|
||||
|
||||
|
||||
void System::SetSynchro(Synchro * psynchro)
|
||||
{
|
||||
synchro = psynchro;
|
||||
}
|
||||
//void System::SetSynchro(Synchro * psynchro)
|
||||
//{
|
||||
// synchro = psynchro;
|
||||
//}
|
||||
|
||||
|
||||
void System::SetFunctions(Functions * pfunctions)
|
||||
@@ -82,6 +81,14 @@ void System::SetSessionManager(SessionManager * sm)
|
||||
}
|
||||
|
||||
|
||||
void System::set_dependency(WinixModel * winix_model)
|
||||
{
|
||||
job.set_dependency(winix_model);
|
||||
time_zones.set_dependency(winix_model);
|
||||
WinixModel::set_dependency(winix_model);
|
||||
}
|
||||
|
||||
|
||||
void System::ReadTimeZones()
|
||||
{
|
||||
if( config->etc_dir.empty() )
|
||||
@@ -107,31 +114,39 @@ void System::ReadTimeZones()
|
||||
|
||||
void System::Init()
|
||||
{
|
||||
thread_manager.SetSynchro(synchro);
|
||||
//thread_manager.SetSynchro(synchro);
|
||||
thread_manager.set_dependency(this);
|
||||
thread_manager.Init();
|
||||
|
||||
dirs.set_dependency(this);
|
||||
dirs.SetDb(db);
|
||||
dirs.SetCur(cur);
|
||||
dirs.SetCur(cur); // only one method is using cur, can be passed as a parameter to the method
|
||||
dirs.SetNotify(¬ify);
|
||||
dirs.ReadDirs();
|
||||
|
||||
mounts.set_dependency(this);
|
||||
mounts.SkipStaticDirs(config->dont_use_static_dirs);
|
||||
mounts.SetDirs(&dirs);
|
||||
mounts.SetDb(db);
|
||||
mounts.SetCur(cur);
|
||||
mounts.SetCur(cur); // only one method is using cur, can be passed as a parameter to the method
|
||||
mounts.CreateMounts();
|
||||
mounts.ReadMounts();
|
||||
|
||||
users.set_dependency(this);
|
||||
users.SetCur(cur);
|
||||
users.SetSessionManager(session_manager);
|
||||
users.ReadUsers(db);
|
||||
|
||||
groups.set_dependency(this);
|
||||
groups.ReadGroups(db); // !! chwilowe przekazanie argumentu, db bedzie zmienione
|
||||
|
||||
rebus.set_dependency(this);
|
||||
rebus.SetCur(cur);
|
||||
rebus.Init();
|
||||
|
||||
notify.set_dependency(this);
|
||||
notify.SetCur(cur);
|
||||
notify.SetConfig(config);
|
||||
//notify.SetConfig(config);
|
||||
notify.SetUsers(&users);
|
||||
notify.SetDirs(&dirs);
|
||||
notify.SetThreadManager(&thread_manager);
|
||||
@@ -142,7 +157,7 @@ void System::Init()
|
||||
image.SetSystem(this);
|
||||
thread_manager.Add(&image, L"image");
|
||||
|
||||
crypt.SetConfig(config);
|
||||
crypt.set_dependency(this);
|
||||
|
||||
// SetSynchro will be called by ThreadManager itself
|
||||
// job.ReadFromFile();
|
||||
@@ -1020,7 +1035,7 @@ Error System::AddFile(Item & item, int notify_code, bool call_plugins)
|
||||
notify.ItemChanged(notify_code, item);
|
||||
|
||||
if( call_plugins )
|
||||
plugin.Call(WINIX_FILE_ADDED, &item);
|
||||
plugin->Call(WINIX_FILE_ADDED, &item);
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -1052,7 +1067,7 @@ Error System::EditFile(Item & item, bool with_url, int notify_code, bool call_pl
|
||||
notify.ItemChanged(notify_code, item);
|
||||
|
||||
if( call_plugins )
|
||||
plugin.Call(WINIX_FILE_CHANGED, &item);
|
||||
plugin->Call(WINIX_FILE_CHANGED, &item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user