/* * Copyright 2008 Ben Boeckel * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ // Header include #include "ServerConnectionHandler.h" // Signet includes #include "Server.h" // KDE includes #include Signet::ServerConnectionHandler::ServerConnectionHandler(Server* server, QObject* parent) : ConnectionHandler(parent), m_server(server) { } void Signet::ServerConnectionHandler::connectToMaster(const KConfigGroup& group) { // TODO: Get the information from the configuration // TODO: Connect to the master // QHostAddress masterAddress; // int port; // QString key; // int timeout; // if (config->hasGroup("Master Server")) // { // const KConfigGroup& group = config->group("Master Server"); // QString address = group.readEntry("Address", ""); // if (!masterAddress.setAddress(address)) // qFatal(QString("Invalid address for the master server: %1").arg(address)); // port = group.readEntry("Port", -1); // if (port < 0) // qFatal(QString("Invalid port for the master server: %1").arg(port)); // key = group.readEntry("Key", ""); // timeout = group.readEntry("Timeout", 30000); // } // else // { // // TODO: Configuration not complete // } // // TODO: Proxy support? // m_masterServer->connectToHost(masterAddress, port); // if (!m_masterServer->waitForConnect(timeout)) // { // // TODO: Connect failed // } }