|
|
|
@ -71,7 +71,7 @@ IdealIRC::IdealIRC(QWidget* parent) |
|
|
|
|
statusw->refreshWindowTitle(); |
|
|
|
|
|
|
|
|
|
ScriptManager::init(mdiManager, this); |
|
|
|
|
QTimer::singleShot(10, std::bind(&IdealIRC::startup, this)); |
|
|
|
|
QTimer::singleShot(10, [this]{ startup(); }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
IdealIRC::~IdealIRC() |
|
|
|
@ -284,7 +284,9 @@ void IdealIRC::connectToServer(bool newStatus) |
|
|
|
|
void IdealIRC::disconnectFromServer() |
|
|
|
|
{ |
|
|
|
|
IWinStatus* status = mdiManager->currentStatus(); |
|
|
|
|
if (status->getConnection().disconnectFromServer() == IRCError::NotConnected) |
|
|
|
|
auto& connection = status->getConnection(); |
|
|
|
|
connection.expectDisconnect(); |
|
|
|
|
if (connection.disconnectFromServer() == IRCError::NotConnected) |
|
|
|
|
qWarning() << "Trying to disconnect from an already closed connection."; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -300,6 +302,7 @@ void IdealIRC::on_actionConnect_triggered() |
|
|
|
|
if (!connection.isOnline()) |
|
|
|
|
setConnectButtonState(ConnectButtonState::Connect); |
|
|
|
|
|
|
|
|
|
connection.expectDisconnect(); |
|
|
|
|
auto e = connection.disconnectFromServer(conf.common("QuitMessage").toStdString()); |
|
|
|
|
if (e == IRCError::NotConnected) |
|
|
|
|
qWarning() << "Trying to disconnect from an already closed connection."; |
|
|
|
|