sure, i also knew that someone will say that theyre made const, i had them this way.
anyway here:
void MainWindow::Connect()
{
Startup s;
int port = p.toInt();
socket->connectToHost(host, port);
std::string tmp = "USER " + t.toStdString() + " * * :" + t.toStdString() + "\r\n";
socket->write(tmp.c_str());
tmp = "NICK " + t.toStdString() + "\r\n";
socket->write(tmp.c_str());
tmp = "JOIN " + f.toStdString() + "\r\n";
socket->write(tmp.c_str());
}
void MainWindow::Connect()
{
Startup s;
QString p = s.getPort();
int port = p.toInt();
QString host = s.getServer();
socket->connectToHost(host, port);
QString t = s.getNick();
std::string tmp = "USER " + t.toStdString() + " * * :" + t.toStdString() + "\r\n";
socket->write(tmp.c_str());
tmp = "NICK " + t.toStdString() + "\r\n";
socket->write(tmp.c_str());
QString f = s.getChannel();
tmp = "JOIN " + f.toStdString() + "\r\n";
socket->write(tmp.c_str());
}
To copy to clipboard, switch view to plain text mode
i also tried putting "Startup* s" then new it in the constructor didnt work, since i called both classes in both headers.
Bookmarks