Ejemplo n.º 1
0
void DomainHandler::setHostname(const QString& hostname) {
    
    if (hostname != _hostname) {
        // re-set the domain info so that auth information is reloaded
        hardReset();
        
        int colonIndex = hostname.indexOf(':');
        
        if (colonIndex > 0) {
            // the user has included a custom DS port with the hostname
            
            // the new hostname is everything up to the colon
            _hostname = hostname.left(colonIndex);
            
            // grab the port by reading the string after the colon
            _sockAddr.setPort(atoi(hostname.mid(colonIndex + 1, hostname.size()).toLocal8Bit().constData()));
            
            qDebug() << "Updated hostname to" << _hostname << "and port to" << _sockAddr.getPort();
            
        } else {
            // no port included with the hostname, simply set the member variable and reset the domain server port to default
            _hostname = hostname;
            _sockAddr.setPort(DEFAULT_DOMAIN_SERVER_PORT);
        }
        
        // re-set the sock addr to null and fire off a lookup of the IP address for this domain-server's hostname
        qDebug("Looking up DS hostname %s.", _hostname.toLocal8Bit().constData());
        QHostInfo::lookupHost(_hostname, this, SLOT(completedHostnameLookup(const QHostInfo&)));
        
        UserActivityLogger::getInstance().changedDomain(_hostname);
        emit hostnameChanged(_hostname);
    }
Ejemplo n.º 2
0
void MeeTv::_connected()
{
    disconnect(m_htsp, SIGNAL(connected()), this, SLOT(_connected()));
    disconnect(this, SIGNAL(activeChanged()), this, SLOT(_connectHtsp()));
    disconnect(m_settings, SIGNAL(hostnameChanged()), this, SLOT(_connectionSettingsChanged()));
    disconnect(m_settings, SIGNAL(portChanged()), this, SLOT(_connectionSettingsChanged()));

    connect(this, SIGNAL(activeChanged()), this, SLOT(_idleHandler()));

    if(m_settings->hasUsername() && m_settings->hasPassword())
        authenticate();
    m_htsp->enableAsync();
}
Ejemplo n.º 3
0
void DomainHandler::setHostnameAndPort(const QString& hostname, quint16 port) {

    if (hostname != _hostname || _sockAddr.getPort() != port) {
        // re-set the domain info so that auth information is reloaded
        hardReset();

        if (hostname != _hostname) {
            // set the new hostname
            _hostname = hostname;

            qCDebug(networking) << "Updated domain hostname to" << _hostname;

            // re-set the sock addr to null and fire off a lookup of the IP address for this domain-server's hostname
            qCDebug(networking, "Looking up DS hostname %s.", _hostname.toLocal8Bit().constData());
            QHostInfo::lookupHost(_hostname, this, SLOT(completedHostnameLookup(const QHostInfo&)));

            UserActivityLogger::getInstance().changedDomain(_hostname);
            emit hostnameChanged(_hostname);
        }
Ejemplo n.º 4
0
void DomainHandler::setSocketAndID(const QString& hostname, quint16 port, const QUuid& domainID) {

    _pendingDomainID = domainID;

    if (hostname != _hostname || _sockAddr.getPort() != port) {
        // re-set the domain info so that auth information is reloaded
        hardReset();

        if (hostname != _hostname) {
            // set the new hostname
            _hostname = hostname;

            qCDebug(networking) << "Updated domain hostname to" << _hostname;

            // re-set the sock addr to null and fire off a lookup of the IP address for this domain-server's hostname
            qCDebug(networking, "Looking up DS hostname %s.", _hostname.toLocal8Bit().constData());
            QHostInfo::lookupHost(_hostname, this, SLOT(completedHostnameLookup(const QHostInfo&)));

            DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetDomainHostname);

            UserActivityLogger::getInstance().changedDomain(_hostname);
            emit hostnameChanged(_hostname);
        }
Ejemplo n.º 5
0
MeeTv::MeeTv(QObject *parent) :
    QObject(parent)
{
#ifndef QT_SIMULATOR
    m_settings = new MeeTvSettingsGConf(this);
#else
    m_settings = new MeeTvSettingsHard(this);
#endif
    m_active = false;
    m_authenticationSettingsChanged = false;
    m_connecting = false;
    m_connectionSettingsChanged = false;

    connect(m_settings, SIGNAL(hostnameChanged()), this, SLOT(_connectionSettingsChanged()));
    connect(m_settings, SIGNAL(portChanged()), this, SLOT(_connectionSettingsChanged()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(_connectHtsp()));

    connect(m_settings, SIGNAL(passwordChanged()), this, SLOT(_authenticationSettingsChanged()));
    connect(m_settings, SIGNAL(usernameChanged()), this, SLOT(_authenticationSettingsChanged()));

    m_idleTimer.setSingleShot(true);
    m_idleTimer.setMinimumInterval(60);
    m_idleTimer.setMaximumInterval(90);
}