Changeset View
Changeset View
Standalone View
Standalone View
src/irc/query.cpp
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 108 | QMetaObject::invokeMethod(m_server, "addQuery", Qt::QueuedConnection, | |||
---|---|---|---|---|---|
109 | Q_ARG(NickInfoPtr, m_nickInfo), Q_ARG(bool, true)); | 109 | Q_ARG(NickInfoPtr, m_nickInfo), Q_ARG(bool, true)); | ||
110 | } | 110 | } | ||
111 | } | 111 | } | ||
112 | 112 | | |||
113 | void Query::setServer(Server* newServer) | 113 | void Query::setServer(Server* newServer) | ||
114 | { | 114 | { | ||
115 | if (m_server != newServer) | 115 | if (m_server != newServer) | ||
116 | { | 116 | { | ||
117 | connect(newServer, SIGNAL(connectionStateChanged(Server*,Konversation::ConnectionState)), | 117 | connect(newServer, &Server::connectionStateChanged, | ||
118 | SLOT(connectionStateChanged(Server*,Konversation::ConnectionState))); | 118 | this, &Query::connectionStateChanged); | ||
119 | connect(newServer, SIGNAL(nickInfoChanged(Server*,NickInfoPtr)), | 119 | connect(newServer, SIGNAL(nickInfoChanged(Server*,NickInfoPtr)), | ||
120 | this, SLOT(updateNickInfo(Server*,NickInfoPtr))); | 120 | this, SLOT(updateNickInfo(Server*,NickInfoPtr))); | ||
121 | } | 121 | } | ||
122 | 122 | | |||
123 | ChatWindow::setServer(newServer); | 123 | ChatWindow::setServer(newServer); | ||
124 | 124 | | |||
125 | if (!(newServer->getKeyForRecipient(getName()).isEmpty())) | 125 | if (!(newServer->getKeyForRecipient(getName()).isEmpty())) | ||
126 | blowfishLabel->show(); | 126 | blowfishLabel->show(); | ||
127 | 127 | | |||
128 | connect(awayLabel, SIGNAL(unaway()), m_server, SLOT(requestUnaway())); | 128 | connect(awayLabel, SIGNAL(unaway()), m_server, SLOT(requestUnaway())); | ||
129 | connect(awayLabel, SIGNAL(awayMessageChanged(QString)), m_server, SLOT(requestAway(QString))); | 129 | connect(awayLabel, SIGNAL(awayMessageChanged(QString)), m_server, SLOT(requestAway(QString))); | ||
130 | } | 130 | } | ||
131 | 131 | | |||
132 | void Query::connectionStateChanged(Server* server, Konversation::ConnectionState state) | 132 | void Query::connectionStateChanged(Server::ConnectionState state) | ||
133 | { | 133 | { | ||
134 | auto server = static_cast<Server *>(sender()); | ||||
134 | if (server == m_server) | 135 | if (server == m_server) | ||
135 | { | 136 | { | ||
136 | ViewContainer* viewContainer = Application::instance()->getMainWindow()->getViewContainer(); | 137 | ViewContainer* viewContainer = Application::instance()->getMainWindow()->getViewContainer(); | ||
137 | 138 | | |||
138 | if (state == Konversation::SSConnected) | 139 | if (state == Server::SSConnected) | ||
139 | { | 140 | { | ||
140 | //HACK the way the notification priorities work sucks, this forces the tab text color to ungray right now. | 141 | //HACK the way the notification priorities work sucks, this forces the tab text color to ungray right now. | ||
141 | if (viewContainer->getFrontView() == this | 142 | if (viewContainer->getFrontView() == this | ||
142 | || m_currentTabNotify == Konversation::tnfNone | 143 | || m_currentTabNotify == Konversation::tnfNone | ||
143 | || !Preferences::self()->tabNotificationsEvents()) | 144 | || !Preferences::self()->tabNotificationsEvents()) | ||
144 | { | 145 | { | ||
145 | viewContainer->unsetViewNotification(this); | 146 | viewContainer->unsetViewNotification(this); | ||
146 | } | 147 | } | ||
▲ Show 20 Lines • Show All 327 Lines • Show Last 20 Lines |