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:
2018-11-21 11:03:53 +00:00
parent a7c47140ae
commit a2ffc1e81c
121 changed files with 7832 additions and 6662 deletions

View File

@@ -80,9 +80,9 @@ void FstabChanged(PluginInfo & info)
*/
}
void InvalidateCache(long dir_id)
void InvalidateCache(PluginInfo & info, long dir_id)
{
log << log4 << "Menu: removing cache for dir id: " << dir_id << logend;
info.log << log4 << "Menu: removing cache for dir id: " << dir_id << logend;
cache.Remove(dir_id);
}
@@ -92,7 +92,7 @@ void InvalidateCacheByPointerParent(PluginInfo & info)
Item * pitem = reinterpret_cast<Item*>(info.p1);
if( pitem )
InvalidateCache(pitem->parent_id);
InvalidateCache(info, pitem->parent_id);
}
@@ -101,13 +101,13 @@ void InvalidateCacheByPointer(PluginInfo & info)
Item * pitem = reinterpret_cast<Item*>(info.p1);
if( pitem )
InvalidateCache(pitem->id);
InvalidateCache(info, pitem->id);
}
void InvalidateCacheById(PluginInfo & info)
{
InvalidateCache(info.l1);
InvalidateCache(info, info.l1);
}
@@ -119,7 +119,7 @@ void ProcessRequest(PluginInfo & info)
if( info.cur->request->IsParam(L"menu") )
{
cache.Clear();
log << log3 << "Menu: cache has been cleared" << logend;
info.log << log3 << "Menu: cache has been cleared" << logend;
}
}
}
@@ -139,25 +139,25 @@ using namespace Menu;
cache.SetDirs(&info.system->dirs);
plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions);
plugin.Assign(WINIX_ADD_MOUNTS, AddMountParams);
plugin.Assign(WINIX_FSTAB_CHANGED, FstabChanged);
info.plugin->Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions);
info.plugin->Assign(WINIX_ADD_MOUNTS, AddMountParams);
info.plugin->Assign(WINIX_FSTAB_CHANGED, FstabChanged);
// !! IMPROVE ME
// use modify parameter from a directory
// (not implemented yet)
plugin.Assign(WINIX_FILE_REMOVED, InvalidateCacheByPointerParent);
plugin.Assign(WINIX_DIR_ADDED, InvalidateCacheByPointerParent);
plugin.Assign(WINIX_DIR_PREPARE_TO_REMOVE, InvalidateCacheByPointerParent);
plugin.Assign(WINIX_DIR_REMOVED, InvalidateCacheById);
plugin.Assign(WINIX_FILE_ADDED, InvalidateCacheByPointerParent);
plugin.Assign(WINIX_FILE_CHANGED, InvalidateCacheByPointerParent);
plugin.Assign(WINIX_FILE_COPIED, InvalidateCacheByPointerParent);
plugin.Assign(WINIX_FILE_PREPARE_TO_MOVE, InvalidateCacheByPointerParent);
plugin.Assign(WINIX_FILE_MOVED, InvalidateCacheByPointerParent);
plugin.Assign(WINIX_DIR_CONTENT_SORTED, InvalidateCacheByPointer);
plugin.Assign(WINIX_PROCESS_REQUEST, ProcessRequest);
info.plugin->Assign(WINIX_FILE_REMOVED, InvalidateCacheByPointerParent);
info.plugin->Assign(WINIX_DIR_ADDED, InvalidateCacheByPointerParent);
info.plugin->Assign(WINIX_DIR_PREPARE_TO_REMOVE, InvalidateCacheByPointerParent);
info.plugin->Assign(WINIX_DIR_REMOVED, InvalidateCacheById);
info.plugin->Assign(WINIX_FILE_ADDED, InvalidateCacheByPointerParent);
info.plugin->Assign(WINIX_FILE_CHANGED, InvalidateCacheByPointerParent);
info.plugin->Assign(WINIX_FILE_COPIED, InvalidateCacheByPointerParent);
info.plugin->Assign(WINIX_FILE_PREPARE_TO_MOVE, InvalidateCacheByPointerParent);
info.plugin->Assign(WINIX_FILE_MOVED, InvalidateCacheByPointerParent);
info.plugin->Assign(WINIX_DIR_CONTENT_SORTED, InvalidateCacheByPointer);
info.plugin->Assign(WINIX_PROCESS_REQUEST, ProcessRequest);
// !! IMPROVE ME
// we need a WINIX_DIR_CHANGED message