Example #1
0
void RootMount::finish( int exitCode , QProcess::ExitStatus exitStatus )
{
    p->error_str = p->process->readAllStandardError();
    if( exitStatus == QProcess::CrashExit )
        p->error_str.append( "\nrootmount crashed" );

    QTest::qWait( 137 );
    read_mtab();

    while( !p->mounted.isEmpty() )
    {
        const QString & file = p->mounted.dequeue();

        if( isMount( file ) )
        {
            emit mounted( true );
        }
        else
        {
            emit mounted( false );
            p->error_str.append( "\n" + tr("Can't mount %1").arg(file) );
        }
    }

    while( !p->unmounted.isEmpty() )
    {
        const QString & file = p->unmounted.dequeue();

        if( !isMount( file ) )
        {
            emit unmounted( true );
        }
        else
        {
            emit unmounted( false );
            p->error_str.append( "\n" + tr("Can't unmount %1").arg(file) );
        }
    }

    emit finished( exitCode );

    if( !p->error_str.isEmpty() )
        emit error( p->error_str );

    if( p->queue.isEmpty() )
        dropProcess();
}
void CreatureImplementation::sendMessage(BasePacket* msg) {
	if (!isMount()) {
		delete msg;
		return;
	}

	ManagedReference<CreatureObject* > linkedCreature = this->linkedCreature.get();

	if (linkedCreature != NULL && linkedCreature->getParent().get() == _this.getReferenceUnsafeStaticCast())
		linkedCreature->sendMessage(msg);
	else
		delete msg;
}