/[projects]/smsdaemon/SmsDaemon.cpp
ViewVC logotype

Diff of /smsdaemon/SmsDaemon.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 180 by torben, Fri Dec 12 12:54:27 2008 UTC revision 208 by torben, Sun Dec 21 18:41:08 2008 UTC
# Line 52  void SmsDaemon::CheckSms() Line 52  void SmsDaemon::CheckSms()
52          for (unsigned int i=0; i<sms.size(); ++i)          for (unsigned int i=0; i<sms.size(); ++i)
53          {          {
54                  string cmd = sms[i].ExtractCommand();                  string cmd = sms[i].ExtractCommand();
55                            
56                  cmd = Util::str_tolower(cmd);                  cmd = Util::str_tolower(cmd);
57    
58                  Plugin* pl = manager->GetPlugin(cmd);                  Plugin* pl = manager->GetPlugin(cmd);
# Line 77  void SmsDaemon::MainLoop() Line 77  void SmsDaemon::MainLoop()
77  {  {
78          Common* cmn = Common::instance();          Common* cmn = Common::instance();
79          volatile bool& mainContinue = cmn->mainContinue;          volatile bool& mainContinue = cmn->mainContinue;
80            volatile bool& reloadConfig = cmn->reloadConfig;
81    
82          mainContinue = true;          mainContinue = true;
83    
# Line 91  void SmsDaemon::MainLoop() Line 91  void SmsDaemon::MainLoop()
91                  if (cmn->isDebug && kbhit())                  if (cmn->isDebug && kbhit())
92                          break;                          break;
93    
94                    if (reloadConfig)
95                            ReloadConfig();
96    
97                  Util::Sleep(100);                  Util::Sleep(100);
98    
99          }          }
100  }  }
101    
102    void SmsDaemon::ReloadConfig()
103    {
104            Common* cmn = Common::instance();
105            cmn->reloadConfig = false;
106    
107            cmn->GetConfigfile()->Reload();
108    
109            cmn->GetPluginManager()->DestroyPlugins();
110            cmn->GetPluginManager()->LoadPlugins();
111    
112            cmn->GetTaskManager()->DestroyTasks();
113            cmn->GetTaskManager()->LoadTasks();
114    
115    }
116    
117  void SmsDaemon::Start()  void SmsDaemon::Start()
118  {  {
119          Common* cmn = Common::instance();          Common* cmn = Common::instance();
# Line 116  void SmsDaemon::Start() Line 134  void SmsDaemon::Start()
134          Logger::logMessage("SMS daemon started");          Logger::logMessage("SMS daemon started");
135    
136          _modem.DeleteAllSms();          _modem.DeleteAllSms();
137            
138          try          try
139          {          {
140                  MainLoop();                  MainLoop();
# Line 130  void SmsDaemon::Start() Line 148  void SmsDaemon::Start()
148                  Logger::logMessage( "Caught unknown exception" );                  Logger::logMessage( "Caught unknown exception" );
149          }          }
150    
151            cmn->GetPluginManager()->DestroyPlugins();
152    
153          Logger::logMessage( cmn->getStatusMessage() );          Logger::logMessage( cmn->getStatusMessage() );
154  }  }

Legend:
Removed from v.180  
changed lines
  Added in v.208

  ViewVC Help
Powered by ViewVC 1.1.20