Exemplo n.º 1
0
WatchDog::WatchDog(Uint32 interval) : 
  theIPValue(globalData.getWatchDogPtr())
{
  setCheckInterval(interval);
  theStop = false;
  theThreadPtr = 0;
}
Exemplo n.º 2
0
WatchDog::WatchDog(Uint32 interval) : 
  m_watchedCount(0)
{
  setCheckInterval(interval);
  m_mutex = NdbMutex_Create();
  theStop = false;
  theThreadPtr = 0;
}
Exemplo n.º 3
0
void TrayUI::slotParsePeriodControls()
{
    int interval=0;
    if (checkEveryHour->isChecked())
        interval= 60;
    else if (checkEvery6hrs->isChecked())
        interval= 360;
    else if (checkEveryDay->isChecked())
        interval = 60 * 24;
    setCheckInterval(interval);
}
Exemplo n.º 4
0
void QMailAccount::readSettings(QSettings *conf)
{
    _accountName = conf->value("accountname").toString();
    _userName = conf->value("name").toString();
    _emailAddress = conf->value("email").toString();
    _mailUserName = conf->value("mailuser").toString();
    _mailPassword = conf->value("mailpassword").toString(); //TODO fix decipher
    _mailServer = conf->value("mailserver").toString();
    _mailPort = conf->value("mailport", 110).toInt();
    _accountType = static_cast<AccountType>( conf->value("type", POP ).toInt() );
    _baseFolder = conf->value("basefolder").toString();

    _useSig = conf->value("usesig").toBool();
    _maxMailSize = conf->value("maxmailsize", 100*1024).toInt();
    setCheckInterval( conf->value("checkinterval", -1).toInt() );

    // write signature to a file (to resolve problem with config.h)
    QString file = QString(QDir::homePath()) + "/Applications/qtmail/sig_" + _mailUserName + "_" + _mailServer;
    QFile f(file);
    if ( f.open(QIODevice::ReadOnly) ) {    // file opened successfully
        QTextStream t( &f );        // use a text stream
        _sig = t.readAll();
        f.close();
    }

    _smtpServer = conf->value("smtpserver").toString();
    _smtpPort = conf->value("smtpport", 25).toInt();
#ifndef QT_NO_OPENSSL
    _smtpUsername = conf->value("smtpUsername").toString();
    _smtpPassword = conf->value("smtpPassword").toString();

    int index = conf->value("smtpAuthentication",0).toInt();
    _smtpAuthentication = static_cast<AuthType>(index);
    index = conf->value("smtpEncryption",0).toInt();
    _smtpEncryption = static_cast<EncryptType>(index);
    index = conf->value("mailEncryption",0).toInt();
    _mailEncryption = static_cast<EncryptType>(index);
#endif
    _defaultMailServer = conf->value("defaultmailserver", Qt::CaseInsensitive).toBool();

    _synchronize = conf->value("synchronize").toBool();
    _deleteMail = conf->value("deletemail").toBool();

    _networkCfg = conf->value("networkConfig").toString();
    _autoDL = conf->value("autoDownload").toBool();

    QString oldGroup = conf->group();
    if ( _accountType == IMAP ) {
        uint count = conf->value("mailboxes", 0).toInt();
        Mailbox *box;
        for (uint x = 0; x < count; x++) {
            conf->beginGroup( id() + "_" + QString::number(x) );
            box = new Mailbox( this );
            box->readSettings(conf);
            _mailboxes.append(box);
            conf->endGroup();
        }
    } else {
        QString queueDelete = conf->value("queuedelete").toString().trimmed();
        if(!queueDelete.isEmpty())
            delList = queueDelete.split(",!;");
        conf->endGroup();
        conf->beginGroup( id() );
        int count = conf->value("idcount", 0).toInt();
        uidList.clear();
        for (int x = 1; x < (count + 1); x++) {
            uidList.append( conf->value( QString::number(x) ).toString() );
        }
        conf->endGroup();
        conf->beginGroup( oldGroup );
    }

    search->setFromAccount( id() );
}
Exemplo n.º 5
0
/*!
    Deserialize the account information from the current group of
    the given QSettings file \a conf.

  \sa saveSettings()
*/
void AccountConfiguration::readSettings(QSettings *conf)
{
    _accountName = conf->value("accountname").toString();
    _userName = conf->value("name").toString();
    _emailAddress = conf->value("email").toString();
    _mailUserName = conf->value("mailuser").toString();
    //backwards compatible for passwords
    _mailPassword = conf->value("mailpassword").toString();
    if (_mailPassword.isEmpty()) {
        QString obsfucated = conf->value("mailpasswordobs").toString();
        QByteArray encoded(obsfucated.toAscii());
        QMailBase64Codec codec(QMailBase64Codec::Text);
        _mailPassword = codec.decode(encoded, "ISO-8859-1");
    }

    _mailServer = conf->value("mailserver").toString();
    _mailPort = conf->value("mailport", 110).toInt();
    _accountType = static_cast<QMailAccount::AccountType>( conf->value("type", QMailAccount::POP ).toInt() );
    _baseFolder = conf->value("basefolder").toString();

    _useSig = conf->value("usesig").toBool();
    _maxMailSize = conf->value("maxmailsize", 100*1024).toInt();
    setCheckInterval( conf->value("checkinterval", -1).toInt() );
    setIntervalCheckRoamingEnabled(conf->value("intervalCheckRoamingEnabled").toBool());
    setPushEnabled(conf->value("pushEnabled").toBool());

    // write signature to a file (to resolve problem with config.h)
    if (_useSig) {
        QString path = Qtopia::applicationFileName("qtopiamail", "") + "sig_" + QString::number(_id.toULongLong());
        QFile file(path);
        if ( file.open(QIODevice::ReadOnly) ) {    // file opened successfully
            QTextStream t( &file );        // use a text stream
            _sig = t.readAll();
            file.close();
        }
    }

    _smtpServer = conf->value("smtpserver").toString();
    _smtpPort = conf->value("smtpport", 25).toInt();
#ifndef QT_NO_OPENSSL
    _smtpUsername = conf->value("smtpUsername").toString();

    //backwards compatible for passwords
    _smtpPassword = conf->value("smtpPassword").toString();
    if (_smtpPassword.isEmpty()) {
        QString obsfucated = conf->value("smtpPasswordObs").toString();
        QByteArray encoded(obsfucated.toAscii());
        QMailBase64Codec codec(QMailBase64Codec::Text);
        _smtpPassword = codec.decode(encoded, "ISO-8859-1");
    }

    int index = conf->value("smtpAuthentication",0).toInt();
    _smtpAuthentication = static_cast<AuthType>(index);
    index = conf->value("smtpEncryption",0).toInt();
    _smtpEncryption = static_cast<EncryptType>(index);
    index = conf->value("mailEncryption",0).toInt();
    _mailEncryption = static_cast<EncryptType>(index);
#endif
    _synchronize = conf->value("synchronize").toBool();
    _deleteMail = conf->value("deletemail").toBool();

    _networkCfg = conf->value("networkConfig").toString();
    _autoDL = conf->value("autoDownload").toBool();
}