Пример #1
0
void Server::queryFinished()
{
   ServerTask::Query* query(qobject_cast<ServerTask::Query*>(sender()));
   if (!query) return;

   Process* process(query->process());
   Process::Status oldStatus(process->status());
   Process::Status newStatus(query->newStatus());

   // Check for any error and bail cos, really, we don't know what's going on
   QString msg(query->errorMessage());
   if (!msg.isEmpty()) {
      process->setComment(msg);
      process->setStatus(Process::Unknown);
#ifndef Q_WS_WIN32
      query->deleteLater();
#endif
      return;
   }

   if (oldStatus == Process::Queued    || 
       oldStatus == Process::Running   || 
       oldStatus == Process::Suspended ||
       oldStatus == Process::Unknown) {

      if (newStatus == Process::Unknown) {
         ServerTask::Base* task(cleanUp(process));
         if (task) {
            connect(task, SIGNAL(finished()), this, SLOT(cleanUpFinished()));
            task->start();
         }
         removeFromWatchList(process);
#ifndef Q_WS_WIN32
         query->deleteLater();
#endif
         return;
      }else if (newStatus == Process::Queued    || 
                newStatus == Process::Running   || 
                newStatus == Process::Suspended) {
         process->setStatus(newStatus);
      }else {
         process->setStatus(newStatus);
         removeFromWatchList(process);
         QLOG_WARN() << "Inactive process found in Server::queryFinished";
      }
      
   }else {
      removeFromWatchList(process);
   }
#ifndef Q_WS_WIN32
   query->deleteLater();
#endif
}
Пример #2
0
bool EWrapperImpl::removeZombieSymbols(const std::vector<std::string> & wl){
	std::vector<std::string> rm;
	for( auto & e : watch_list){
		if ( std::find(wl.begin(), wl.end(), e.first) == wl.end() ){
			rm.push_back(e.first);
		}
	}
	return removeFromWatchList(rm);
}
Пример #3
0
void Server::queryFinished()
{
    ServerTask::Query* task = qobject_cast<ServerTask::Query*>(sender());
    if (!task) return;

    Process* process(task->process());
    Process::Status oldStatus(process->status());
    Process::Status newStatus(task->newStatus());
    task->deleteLater();

    if (oldStatus == Process::Queued    ||
            oldStatus == Process::Running   ||
            oldStatus == Process::Suspended ||
            oldStatus == Process::Unknown) {

        if (newStatus == Process::Unknown) {
            ServerTask::Base* task(cleanUp(process));
            if (task) {
                connect(task, SIGNAL(finished()), this, SLOT(cleanUpFinished()));
                task->start();
            }
            removeFromWatchList(process);
            return;
        } else if (newStatus == Process::Queued    ||
                   newStatus == Process::Running   ||
                   newStatus == Process::Suspended) {
            process->setStatus(newStatus);
        } else {
            process->setStatus(newStatus);
            removeFromWatchList(process);
            QLOG_WARN() << "Inactive process found in Server::queryFinished";
        }

    } else {
        removeFromWatchList(process);
    }
}