Exemplo n.º 1
0
void Kandas::Daemon::Engine::registerClient()
{
    ++m_clientCount;
    //make sure the client has up-to-date data
    refreshData(); //systemInfo(), slotInfo(), and clientInfo() signals are now sent out
    m_autoRefreshTimer.start(Kandas::Daemon::RefreshInterval);
    emit initComplete();
}
Exemplo n.º 2
0
//! Slot triggered when the QSocket is connected
void TelnetInterface::socketConnected()
{
	s->readAll();
	s->writeBlock( dev->telnetPassword() + "\r\n", dev->telnetPassword().length()+2 );
	connect(s, SIGNAL(readyRead()), this, SLOT(telnetDataReceived()));
	
	emit initComplete();
}
Exemplo n.º 3
0
Kandas::Console::BaseWorker::BaseWorker()
    : p(new BaseWorkerPrivate(this))
{
    //connect interface signals
    connect(p->m_interface, SIGNAL(systemInfo(int)), SLOT(systemInfo(int)));
    connect(p->m_interface, SIGNAL(deviceInfo(const QString&, const QString&, int, bool)), SLOT(deviceInfo(const QString&, const QString&, int, bool)));
    connect(p->m_interface, SIGNAL(slotInfo(int, const QString&, const QString&, int)), SLOT(slotInfo(int, const QString&, const QString&, int)));
    connect(p->m_interface, SIGNAL(initComplete()), SLOT(executeJobs()));
    //initiation sequence
    p->m_interface->registerClient();
}
Exemplo n.º 4
0
void DiskSensor::processExited(TDEProcess *)
{
    TQStringList stringList = TQStringList::split('\n',sensorResult);
    sensorResult = "";
    TQStringList::Iterator it = stringList.begin();
    //TQRegExp rx( "^(/dev/).*(/\\S*)$");
    TQRegExp rx( ".*\\s+(/\\S*)$");

    while( it != stringList.end())
    {
        rx.search( *it );
        if ( !rx.cap(0).isEmpty())
        {
            mntMap[rx.cap(1)] = *it;
        }
        it++;
    }
    stringList.clear();

    TQString format;
    TQString mntPt;
    SensorParams *sp;
    Meter *meter;

    TQObjectListIt lit( *objList );
    while (lit != 0)
    {
        sp = (SensorParams*)(*lit);
        meter = sp->getMeter();
        format = sp->getParam("FORMAT");
        mntPt = sp->getParam("MOUNTPOINT");
        if (mntPt.length() == 0)
            mntPt="/";

        if (format.length() == 0 )
        {
            format = "%u";
        }
        format.replace( TQRegExp("%fp", false),TQString::number(getPercentFree(mntPt)));
        format.replace( TQRegExp("%fg",false),
                        TQString::number(getFreeSpace(mntPt)/(1024*1024)));
        format.replace( TQRegExp("%fkb",false),
                        TQString::number(getFreeSpace(mntPt)*8) );
        format.replace( TQRegExp("%fk",false),
                        TQString::number(getFreeSpace(mntPt)) );
        format.replace( TQRegExp("%f", false),TQString::number(getFreeSpace(mntPt)/1024));
        
        format.replace( TQRegExp("%up", false),TQString::number(getPercentUsed(mntPt)));
        format.replace( TQRegExp("%ug",false),
                        TQString::number(getUsedSpace(mntPt)/(1024*1024)));
        format.replace( TQRegExp("%ukb",false),
                        TQString::number(getUsedSpace(mntPt)*8) );
        format.replace( TQRegExp("%uk",false),
                        TQString::number(getUsedSpace(mntPt)) );
        format.replace( TQRegExp("%u", false),TQString::number(getUsedSpace(mntPt)/1024));

        format.replace( TQRegExp("%tg",false),
                        TQString::number(getTotalSpace(mntPt)/(1024*1024)));
        format.replace( TQRegExp("%tkb",false),
                        TQString::number(getTotalSpace(mntPt)*8));
        format.replace( TQRegExp("%tk",false),
                        TQString::number(getTotalSpace(mntPt)));
        format.replace( TQRegExp("%t", false),TQString::number(getTotalSpace(mntPt)/1024));
        meter->setValue(format);
        ++lit;
    }
    if ( init == 1 )
    {
        emit initComplete();
        init = 0;
    }
}