| 22 | } |
| 23 | |
| 24 | int CService::Init() |
| 25 | { |
| 26 | int nRet = 0; |
| 27 | if(GetParameters()) |
| 28 | { |
| 29 | nRet = LoadConfigure(); |
| 30 | if(nRet) return nRet; |
| 31 | } |
| 32 | |
| 33 | if(!GetParameters() || !GetParameters()->getEnable()) |
| 34 | { |
| 35 | qInfo(Service) << "The service" << m_pPlugin->Name() << "is disable"; |
| 36 | return -2; |
| 37 | } else |
| 38 | qInfo(Service) << "The service" << m_pPlugin->Name() << "is start"; |
| 39 | |
| 40 | nRet = OnInit(); |
| 41 | if(0 == nRet) |
| 42 | QTimer::singleShot(0, this, SLOT(slotProcess())); |
| 43 | if(nRet > 0) return 0; |
| 44 | return nRet; |
| 45 | } |
| 46 | |
| 47 | int CService::Clean() |
| 48 | { |