- now the mess with threads has gone away
- we have a class BaseThread -- this is a base class -- we can inherit from it when creating a new thread - others treads are correctly stopped (when signal comes) -- pthread_join - we have a special thread only for signals git-svn-id: svn://ttmath.org/publicrep/winix/trunk@685 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include "system.h"
|
||||
#include "misc.h"
|
||||
#include "error.h"
|
||||
#include "notify.h"
|
||||
#include "templates/templates.h"
|
||||
|
||||
|
||||
@@ -33,6 +32,11 @@ void System::SetDb(Db * pdb)
|
||||
}
|
||||
|
||||
|
||||
void System::SetSynchro(Synchro * psynchro)
|
||||
{
|
||||
synchro = psynchro;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +44,7 @@ void System::Init()
|
||||
{
|
||||
dirs.SetDb(db);
|
||||
dirs.SetRequest(request);
|
||||
|
||||
dirs.SetNotify(¬ify);
|
||||
dirs.ReadDirs();
|
||||
|
||||
mounts.SetDirs(&dirs);
|
||||
@@ -56,6 +60,13 @@ void System::Init()
|
||||
|
||||
rebus.SetRequest(request);
|
||||
rebus.Init();
|
||||
|
||||
notify.SetSynchro(synchro);
|
||||
notify.SetRequest(request);
|
||||
notify.SetConfig(config);
|
||||
notify.SetUsers(&users);
|
||||
notify.SetDirs(&dirs);
|
||||
notify.Init();
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +497,7 @@ bool System::MakePath(Item & item, bool create_dir)
|
||||
|
||||
|
||||
|
||||
Error System::AddFile(Item & item, bool notify)
|
||||
Error System::AddFile(Item & item, int notify_code)
|
||||
{
|
||||
if( item.type == Item::dir )
|
||||
return WINIX_ERR_FILE_EXPECTED;
|
||||
@@ -498,8 +509,8 @@ Error System::AddFile(Item & item, bool notify)
|
||||
log << log2 << "System: added a new file, url: " << item.url << ", id: " << item.id
|
||||
<< ", parent_id: " << item.parent_id << logend;
|
||||
|
||||
if( notify )
|
||||
request->notify_code |= WINIX_NOTIFY_ITEM_ADD;
|
||||
if( notify_code )
|
||||
notify.ItemChanged(notify_code, item);
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -508,7 +519,7 @@ return status;
|
||||
|
||||
|
||||
|
||||
Error System::EditFile(Item & item, bool with_url, bool notify)
|
||||
Error System::EditFile(Item & item, bool with_url, int notify_code)
|
||||
{
|
||||
if( item.type == Item::dir )
|
||||
return WINIX_ERR_FILE_EXPECTED;
|
||||
@@ -527,8 +538,8 @@ Error System::EditFile(Item & item, bool with_url, bool notify)
|
||||
|
||||
log << log2 << "System: modified an item" << logend;
|
||||
|
||||
if( notify )
|
||||
request->notify_code |= WINIX_NOTIFY_ITEM_EDIT;
|
||||
if( notify_code )
|
||||
notify.ItemChanged(notify_code, item);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user