From: Manuel Nickschas Date: Thu, 8 Oct 2015 21:57:05 +0000 (+0200) Subject: Merge pull request #145 from Scheirle/enh_usertooltip X-Git-Tag: travis-deploy-test~553 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=52f0d47d0cb1932c9e86ebb75cdd4dd0d625dd6f;hp=a2e0951abbe2d545836fb25fd6010aa085f17d82 Merge pull request #145 from Scheirle/enh_usertooltip Adds nicer ircuser tooltips --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a22fac9..a35fa8f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,9 +217,9 @@ if (USE_QT5) PURPOSE "Required for audio notifications" ) - find_package(LibsnoreQt5 QUIET) + find_package(LibsnoreQt5 0.5.70 QUIET) set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL - URL "https://github.com/TheOneRing/Snorenotify" + URL "https://projects.kde.org/projects/playground/libs/snorenotify" DESCRIPTION "a cross-platform notification framework" PURPOSE "Enable support for the snorenotify framework" ) @@ -361,13 +361,6 @@ else(USE_QT5) DESCRIPTION "a multimedia abstraction library" PURPOSE "Required for audio notifications" ) - - find_package(Libsnore QUIET) - set_package_properties(Libsnore PROPERTIES TYPE OPTIONAL - URL "https://github.com/TheOneRing/Snorenotify" - DESCRIPTION "a cross-platform notification framework" - PURPOSE "Enable support for the snorenotify framework" - ) endif(WITH_KDE) find_package(IndicateQt QUIET) diff --git a/src/client/bufferviewoverlay.cpp b/src/client/bufferviewoverlay.cpp index f04b4531..91cad716 100644 --- a/src/client/bufferviewoverlay.cpp +++ b/src/client/bufferviewoverlay.cpp @@ -70,7 +70,7 @@ void BufferViewOverlay::restore() currentIds += CoreAccountSettings().bufferViewOverlay(); QSet::const_iterator iter; - for (iter = currentIds.constBegin(); iter != currentIds.constEnd(); iter++) { + for (iter = currentIds.constBegin(); iter != currentIds.constEnd(); ++iter) { addView(*iter); } } @@ -144,7 +144,7 @@ void BufferViewOverlay::removeView(int viewId) else { if (!config->isInitialized()) _uninitializedViewCount++; - viewIter++; + ++viewIter; } } @@ -211,7 +211,7 @@ void BufferViewOverlay::updateHelper() if (Client::bufferViewManager()) { BufferViewConfig *config = 0; QSet::const_iterator viewIter; - for (viewIter = _bufferViewIds.constBegin(); viewIter != _bufferViewIds.constEnd(); viewIter++) { + for (viewIter = _bufferViewIds.constBegin(); viewIter != _bufferViewIds.constEnd(); ++viewIter) { config = Client::bufferViewManager()->bufferViewConfig(*viewIter); if (!config) continue; diff --git a/src/client/client.cpp b/src/client/client.cpp index 54a93fb3..0c6ad25c 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -535,7 +535,7 @@ void Client::networkDestroyed() break; } else { - netIter++; + ++netIter; } } } diff --git a/src/client/clientauthhandler.cpp b/src/client/clientauthhandler.cpp index 7ed231c2..eeca2cff 100644 --- a/src/client/clientauthhandler.cpp +++ b/src/client/clientauthhandler.cpp @@ -34,6 +34,10 @@ #include "clientsettings.h" #include "peerfactory.h" +#if QT_VERSION < 0x050000 +# include "../../3rdparty/sha512/sha512.h" +#endif + using namespace Protocol; ClientAuthHandler::ClientAuthHandler(CoreAccount account, QObject *parent) @@ -423,6 +427,7 @@ void ClientAuthHandler::checkAndEnableSsl(bool coreSupportsSsl) } s.setAccountValue("ShowNoCoreSslWarning", false); s.setAccountValue("SslCert", QString()); + s.setAccountValue("SslCertDigestVersion", QVariant(QVariant::Int)); } if (_legacy) onConnectionReady(); @@ -444,6 +449,7 @@ void ClientAuthHandler::onSslSocketEncrypted() // That way, a warning will appear in case it becomes invalid at some point CoreAccountSettings s; s.setAccountValue("SSLCert", QString()); + s.setAccountValue("SslCertDigestVersion", QVariant(QVariant::Int)); } emit encrypted(true); @@ -462,8 +468,27 @@ void ClientAuthHandler::onSslErrors() CoreAccountSettings s; QByteArray knownDigest = s.accountValue("SslCert").toByteArray(); + ClientAuthHandler::DigestVersion knownDigestVersion = static_cast(s.accountValue("SslCertDigestVersion").toInt()); + + QByteArray calculatedDigest; + switch (knownDigestVersion) { + case ClientAuthHandler::DigestVersion::Md5: + calculatedDigest = socket->peerCertificate().digest(QCryptographicHash::Md5); + break; - if (knownDigest != socket->peerCertificate().digest()) { + case ClientAuthHandler::DigestVersion::Sha2_512: +#if QT_VERSION >= 0x050000 + calculatedDigest = socket->peerCertificate().digest(QCryptographicHash::Sha512); +#else + calculatedDigest = sha2_512(socket->peerCertificate().toDer()); +#endif + break; + + default: + qWarning() << "Certificate digest version" << QString(knownDigestVersion) << "is not supported"; + } + + if (knownDigest != calculatedDigest) { bool accepted = false; bool permanently = false; emit handleSslErrors(socket, &accepted, &permanently); @@ -473,13 +498,42 @@ void ClientAuthHandler::onSslErrors() return; } - if (permanently) - s.setAccountValue("SslCert", socket->peerCertificate().digest()); - else + if (permanently) { +#if QT_VERSION >= 0x050000 + s.setAccountValue("SslCert", socket->peerCertificate().digest(QCryptographicHash::Sha512)); +#else + s.setAccountValue("SslCert", sha2_512(socket->peerCertificate().toDer())); +#endif + s.setAccountValue("SslCertDigestVersion", ClientAuthHandler::DigestVersion::Latest); + } + else { s.setAccountValue("SslCert", QString()); + s.setAccountValue("SslCertDigestVersion", QVariant(QVariant::Int)); + } + } + else if (knownDigestVersion != ClientAuthHandler::DigestVersion::Latest) { +#if QT_VERSION >= 0x050000 + s.setAccountValue("SslCert", socket->peerCertificate().digest(QCryptographicHash::Sha512)); +#else + s.setAccountValue("SslCert", sha2_512(socket->peerCertificate().toDer())); +#endif + s.setAccountValue("SslCertDigestVersion", ClientAuthHandler::DigestVersion::Latest); } socket->ignoreSslErrors(); } +#if QT_VERSION < 0x050000 +QByteArray ClientAuthHandler::sha2_512(const QByteArray &input) { + unsigned char output[64]; + sha512((unsigned char*) input.constData(), input.size(), output, false); + // QByteArray::fromRawData() cannot be used here because that constructor + // does not copy "output" and the data is clobbered when the variable goes + // out of scope. + QByteArray result; + result.append((char*) output, 64); + return result; +} +#endif + #endif /* HAVE_SSL */ diff --git a/src/client/clientauthhandler.h b/src/client/clientauthhandler.h index 7d6c9357..00c2986e 100644 --- a/src/client/clientauthhandler.h +++ b/src/client/clientauthhandler.h @@ -36,6 +36,12 @@ class ClientAuthHandler : public AuthHandler public: ClientAuthHandler(CoreAccount account, QObject *parent = 0); + enum DigestVersion { + Md5, + Sha2_512, + Latest=Sha2_512 + }; + public slots: void connectToCore(); @@ -83,6 +89,10 @@ private: void checkAndEnableSsl(bool coreSupportsSsl); void startRegistration(); +#if QT_VERSION < 0x050000 + QByteArray sha2_512(const QByteArray &input); +#endif + private slots: void onSocketConnected(); void onSocketStateChanged(QAbstractSocket::SocketState state); diff --git a/src/client/clientirclisthelper.cpp b/src/client/clientirclisthelper.cpp index 229e1576..1af7bc59 100644 --- a/src/client/clientirclisthelper.cpp +++ b/src/client/clientirclisthelper.cpp @@ -43,7 +43,7 @@ void ClientIrcListHelper::receiveChannelList(const NetworkId &netId, const QStri QVariantList channelVar = iter->toList(); ChannelDescription channelDescription(channelVar[0].toString(), channelVar[1].toUInt(), channelVar[2].toString()); channelList << channelDescription; - iter++; + ++iter; } emit channelListReceived(netId, channelFilters, channelList); diff --git a/src/client/clientsettings.cpp b/src/client/clientsettings.cpp index dc8e5c18..812e5328 100644 --- a/src/client/clientsettings.cpp +++ b/src/client/clientsettings.cpp @@ -216,7 +216,7 @@ QSet CoreAccountSettings::bufferViewOverlay() { QSet viewIds; QVariantList variants = accountValue("BufferViewOverlay").toList(); - for (QVariantList::const_iterator iter = variants.constBegin(); iter != variants.constEnd(); iter++) { + for (QVariantList::const_iterator iter = variants.constBegin(); iter != variants.constEnd(); ++iter) { viewIds << iter->toInt(); } return viewIds; diff --git a/src/client/coreconnection.cpp b/src/client/coreconnection.cpp index 0e4b4f94..9f876f91 100644 --- a/src/client/coreconnection.cpp +++ b/src/client/coreconnection.cpp @@ -216,6 +216,8 @@ void CoreConnection::setState(ConnectionState state) if (state != _state) { _state = state; emit stateChanged(state); + if (state == Connected) + _wantReconnect = true; if (state == Disconnected) emit disconnected(); } diff --git a/src/client/messagefilter.cpp b/src/client/messagefilter.cpp index 5efed2c1..1001ea32 100644 --- a/src/client/messagefilter.cpp +++ b/src/client/messagefilter.cpp @@ -201,7 +201,7 @@ bool MessageFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourcePar while (idIter != _validBuffers.constEnd()) { if (Client::networkModel()->bufferType(*idIter) == BufferInfo::StatusBuffer) return true; - idIter++; + ++idIter; } } @@ -241,6 +241,6 @@ void MessageFilter::requestBacklog() QSet::const_iterator bufferIdIter = _validBuffers.constBegin(); while (bufferIdIter != _validBuffers.constEnd()) { Client::messageModel()->requestBacklog(*bufferIdIter); - bufferIdIter++; + ++bufferIdIter; } } diff --git a/src/client/messagemodel.cpp b/src/client/messagemodel.cpp index cbcfceb2..97d8f0ac 100644 --- a/src/client/messagemodel.cpp +++ b/src/client/messagemodel.cpp @@ -206,7 +206,7 @@ int MessageModel::insertMessagesGracefully(const QList &msglist) QList::const_iterator iter; if (inOrder) { iter = msglist.constEnd(); - iter--; // this op is safe as we've allready passed an empty check + --iter; // this op is safe as we've allready passed an empty check } else { iter = msglist.constBegin(); @@ -229,11 +229,11 @@ int MessageModel::insertMessagesGracefully(const QList &msglist) } if (!inOrder) - iter++; + ++iter; if (inOrder) { while (iter != msglist.constBegin()) { - iter--; + --iter; if (!fastForward && (*iter).msgId() <= minId) break; @@ -295,7 +295,7 @@ int MessageModel::insertMessagesGracefully(const QList &msglist) dupeId = (*iter).msgId(); grouplist.prepend(*iter); } - iter++; + ++iter; } } diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 364c0e79..2adbe08a 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -723,7 +723,7 @@ void ChannelBufferItem::addUsersToCategory(const QList &ircUsers) QHash >::const_iterator catIter = categories.constBegin(); while (catIter != categories.constEnd()) { catIter.key()->addUsers(catIter.value()); - catIter++; + ++catIter; } } diff --git a/src/client/selectionmodelsynchronizer.cpp b/src/client/selectionmodelsynchronizer.cpp index 4d2ed232..0dcf7f8e 100644 --- a/src/client/selectionmodelsynchronizer.cpp +++ b/src/client/selectionmodelsynchronizer.cpp @@ -96,7 +96,7 @@ void SelectionModelSynchronizer::selectionModelDestroyed(QObject *object) iter = _selectionModels.erase(iter); } else { - iter++; + ++iter; } } } @@ -252,7 +252,7 @@ void SelectionModelSynchronizer::currentChanged(const QModelIndex ¤t, cons QSet::iterator iter = _selectionModels.begin(); while (iter != _selectionModels.end()) { (*iter)->setCurrentIndex(mapFromSource(current, (*iter)), QItemSelectionModel::Current); - iter++; + ++iter; } _changeCurrentEnabled = true; } @@ -267,7 +267,7 @@ void SelectionModelSynchronizer::selectionChanged(const QItemSelection &selected QSet::iterator iter = _selectionModels.begin(); while (iter != _selectionModels.end()) { (*iter)->select(mapSelectionFromSource(currentSelection(), (*iter)), QItemSelectionModel::ClearAndSelect); - iter++; + ++iter; } _changeSelectionEnabled = true; } diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index fd47bc04..220c843f 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -105,7 +105,7 @@ void AbstractTreeItem::removeAllChilds() child = *childIter; child->setTreeItemFlags(0); // disable self deletion, as this would only fuck up consitency and the child gets deleted anyways child->removeAllChilds(); - childIter++; + ++childIter; } emit beginRemoveChilds(0, numChilds - 1); @@ -220,7 +220,7 @@ void AbstractTreeItem::dumpChildList() while (childIter != _childItems.constEnd()) { child = *childIter; qDebug() << "Row:" << child->row() << child << child->data(0, Qt::DisplayRole); - childIter++; + ++childIter; } } qDebug() << "==== End Of Childlist ===="; diff --git a/src/common/abstractcliparser.h b/src/common/abstractcliparser.h index 293ccd92..9ef194be 100644 --- a/src/common/abstractcliparser.h +++ b/src/common/abstractcliparser.h @@ -54,7 +54,7 @@ protected: CliArgOption }; - CliParserArg(const CliArgType type = CliArgInvalid, const char shortName = 0, const QString &help = QString(), const QString &valueName = QString(), const QString def = QString()) + CliParserArg(const CliArgType type = CliArgInvalid, const char shortName = 0, const QString &help = QString(), const QString &valueName = QString(), const QString &def = QString()) : type(type) , shortName(shortName) , help(help) diff --git a/src/common/bufferviewmanager.cpp b/src/common/bufferviewmanager.cpp index 33ba5288..580b4ad2 100644 --- a/src/common/bufferviewmanager.cpp +++ b/src/common/bufferviewmanager.cpp @@ -88,7 +88,7 @@ QVariantList BufferViewManager::initBufferViewIds() const BufferViewConfigHash::const_iterator iterEnd = _bufferViewConfigs.constEnd(); while (iter != iterEnd) { bufferViewIds << (*iter)->bufferViewId(); - iter++; + ++iter; } return bufferViewIds; } @@ -100,6 +100,6 @@ void BufferViewManager::initSetBufferViewIds(const QVariantList bufferViewIds) QVariantList::const_iterator iterEnd = bufferViewIds.constEnd(); while (iter != iterEnd) { newBufferViewConfig((*iter).value()); - iter++; + ++iter; } } diff --git a/src/common/cliparser.cpp b/src/common/cliparser.cpp index 2e94e559..ba653df4 100644 --- a/src/common/cliparser.cpp +++ b/src/common/cliparser.cpp @@ -146,7 +146,7 @@ bool CliParser::init(const QStringList &args) else value = currentArg->toLocal8Bit(); name = currentArg->mid(1).toLatin1().at(0); // we took one argument as argument to an option so skip it next time - if (skipNext) currentArg++; + if (skipNext) ++currentArg; if (!addShortArg(CliParserArg::CliArgOption, name, value)) return false; } } diff --git a/src/common/ircchannel.cpp b/src/common/ircchannel.cpp index 89b3b330..7a1230c7 100644 --- a/src/common/ircchannel.cpp +++ b/src/common/ircchannel.cpp @@ -321,7 +321,7 @@ QVariantMap IrcChannel::initUserModes() const QHash::const_iterator iter = _userModes.constBegin(); while (iter != _userModes.constEnd()) { usermodes[iter.key()->nick()] = iter.value(); - iter++; + ++iter; } return usermodes; } @@ -335,7 +335,7 @@ void IrcChannel::initSetUserModes(const QVariantMap &usermodes) while (iter != usermodes.constEnd()) { users << network()->newIrcUser(iter.key()); modes << iter.value().toString(); - iter++; + ++iter; } joinIrcUsers(users, modes); } @@ -349,7 +349,7 @@ QVariantMap IrcChannel::initChanModes() const QHash::const_iterator A_iter = _A_channelModes.constBegin(); while (A_iter != _A_channelModes.constEnd()) { A_modes[A_iter.key()] = A_iter.value(); - A_iter++; + ++A_iter; } channelModes["A"] = A_modes; @@ -357,7 +357,7 @@ QVariantMap IrcChannel::initChanModes() const QHash::const_iterator B_iter = _B_channelModes.constBegin(); while (B_iter != _B_channelModes.constEnd()) { B_modes[B_iter.key()] = B_iter.value(); - B_iter++; + ++B_iter; } channelModes["B"] = B_modes; @@ -365,7 +365,7 @@ QVariantMap IrcChannel::initChanModes() const QHash::const_iterator C_iter = _C_channelModes.constBegin(); while (C_iter != _C_channelModes.constEnd()) { C_modes[C_iter.key()] = C_iter.value(); - C_iter++; + ++C_iter; } channelModes["C"] = C_modes; @@ -373,7 +373,7 @@ QVariantMap IrcChannel::initChanModes() const QSet::const_iterator D_iter = _D_channelModes.constBegin(); while (D_iter != _D_channelModes.constEnd()) { D_modes += *D_iter; - D_iter++; + ++D_iter; } channelModes["D"] = D_modes; @@ -387,21 +387,21 @@ void IrcChannel::initSetChanModes(const QVariantMap &channelModes) QVariantMap::const_iterator iterEnd = channelModes["A"].toMap().constEnd(); while (iter != iterEnd) { _A_channelModes[iter.key()[0]] = iter.value().toStringList(); - iter++; + ++iter; } iter = channelModes["B"].toMap().constBegin(); iterEnd = channelModes["B"].toMap().constEnd(); while (iter != iterEnd) { _B_channelModes[iter.key()[0]] = iter.value().toString(); - iter++; + ++iter; } iter = channelModes["C"].toMap().constBegin(); iterEnd = channelModes["C"].toMap().constEnd(); while (iter != iterEnd) { _C_channelModes[iter.key()[0]] = iter.value().toString(); - iter++; + ++iter; } QString D_modes = channelModes["D"].toString(); @@ -596,21 +596,21 @@ QString IrcChannel::channelModeString() const QSet::const_iterator D_iter = _D_channelModes.constBegin(); while (D_iter != _D_channelModes.constEnd()) { modeString += *D_iter; - D_iter++; + ++D_iter; } QHash::const_iterator BC_iter = _C_channelModes.constBegin(); while (BC_iter != _C_channelModes.constEnd()) { modeString += BC_iter.key(); params << BC_iter.value(); - BC_iter++; + ++BC_iter; } BC_iter = _B_channelModes.constBegin(); while (BC_iter != _B_channelModes.constEnd()) { modeString += BC_iter.key(); params << BC_iter.value(); - BC_iter++; + ++BC_iter; } if (modeString.isEmpty()) return modeString; diff --git a/src/common/signalproxy.cpp b/src/common/signalproxy.cpp index d9102fd3..754e9dbb 100644 --- a/src/common/signalproxy.cpp +++ b/src/common/signalproxy.cpp @@ -119,7 +119,7 @@ void SignalProxy::SignalRelay::detachSignal(QObject *sender, int signalId) break; } else { - slotIter++; + ++slotIter; } } } @@ -197,7 +197,7 @@ SignalProxy::~SignalProxy() objIter = classIter->erase(objIter); obj->stopSynchronize(this); } - classIter++; + ++classIter; } _syncSlave.clear(); @@ -482,7 +482,7 @@ void SignalProxy::detachSlots(QObject *receiver) slotIter = _attachedSlots.erase(slotIter); } else - slotIter++; + ++slotIter; } } @@ -497,7 +497,7 @@ void SignalProxy::stopSynchronize(SyncableObject *obj) classIter->remove(obj->objectName()); break; } - classIter++; + ++classIter; } obj->stopSynchronize(this); } diff --git a/src/common/syncableobject.cpp b/src/common/syncableobject.cpp index b4f395fe..3a1799e2 100644 --- a/src/common/syncableobject.cpp +++ b/src/common/syncableobject.cpp @@ -141,7 +141,7 @@ void SyncableObject::fromVariantMap(const QVariantMap &properties) while (iterator != properties.constEnd()) { propName = iterator.key(); if (propName == "objectName") { - iterator++; + ++iterator; continue; } @@ -152,7 +152,7 @@ void SyncableObject::fromVariantMap(const QVariantMap &properties) else setProperty(propName.toLatin1(), iterator.value()); // qDebug() << "<<< SYNC:" << name << iterator.value(); - iterator++; + ++iterator; } } diff --git a/src/core/abstractsqlstorage.cpp b/src/core/abstractsqlstorage.cpp index dce39cb2..fb4409a0 100644 --- a/src/core/abstractsqlstorage.cpp +++ b/src/core/abstractsqlstorage.cpp @@ -41,7 +41,7 @@ AbstractSqlStorage::~AbstractSqlStorage() { // disconnect the connections, so their deletion is no longer interessting for us QHash::iterator conIter; - for (conIter = _connectionPool.begin(); conIter != _connectionPool.end(); conIter++) { + for (conIter = _connectionPool.begin(); conIter != _connectionPool.end(); ++conIter) { QSqlDatabase::removeDatabase(conIter.value()->name()); disconnect(conIter.value(), 0, this, 0); } @@ -275,7 +275,7 @@ bool AbstractSqlStorage::watchQuery(QSqlQuery &query) QVariantMap boundValues = query.boundValues(); QStringList valueStrings; QVariantMap::const_iterator iter; - for (iter = boundValues.constBegin(); iter != boundValues.constEnd(); iter++) { + for (iter = boundValues.constBegin(); iter != boundValues.constEnd(); ++iter) { QString value; QSqlField field; if (query.driver()) { diff --git a/src/core/coreauthhandler.cpp b/src/core/coreauthhandler.cpp index 92b32c5c..e3809246 100644 --- a/src/core/coreauthhandler.cpp +++ b/src/core/coreauthhandler.cpp @@ -159,6 +159,7 @@ void CoreAuthHandler::handle(const RegisterClient &msg) useSsl = _connectionFeatures & Protocol::Encryption; if (Quassel::isOptionSet("require-ssl") && !useSsl && !_peer->isLocal()) { + quInfo() << qPrintable(tr("SSL required but non-SSL connection attempt from %1").arg(socket()->peerAddress().toString())); _peer->dispatch(ClientDenied(tr("SSL is required!
You need to use SSL in order to connect to this core."))); _peer->close(); return; @@ -209,6 +210,7 @@ void CoreAuthHandler::handle(const Login &msg) UserId uid = Core::validateUser(msg.user, msg.password); if (uid == 0) { + quInfo() << qPrintable(tr("Invalid login attempt from %1 as \"%2\"").arg(socket()->peerAddress().toString(), msg.user)); _peer->dispatch(LoginFailed(tr("Invalid username or password!
The username/password combination you supplied could not be found in the database."))); return; } diff --git a/src/core/corebacklogmanager.cpp b/src/core/corebacklogmanager.cpp index bb1d93f5..90004caf 100644 --- a/src/core/corebacklogmanager.cpp +++ b/src/core/corebacklogmanager.cpp @@ -42,7 +42,7 @@ QVariantList CoreBacklogManager::requestBacklog(BufferId bufferId, MsgId first, QList::const_iterator msgListEnd = msgList.constEnd(); while (msgIter != msgListEnd) { backlog << qVariantFromValue(*msgIter); - msgIter++; + ++msgIter; } if (additional && limit != 0) { @@ -69,7 +69,7 @@ QVariantList CoreBacklogManager::requestBacklog(BufferId bufferId, MsgId first, msgListEnd = msgList.constEnd(); while (msgIter != msgListEnd) { backlog << qVariantFromValue(*msgIter); - msgIter++; + ++msgIter; } } } @@ -88,7 +88,7 @@ QVariantList CoreBacklogManager::requestBacklogAll(MsgId first, MsgId last, int QList::const_iterator msgListEnd = msgList.constEnd(); while (msgIter != msgListEnd) { backlog << qVariantFromValue(*msgIter); - msgIter++; + ++msgIter; } if (additional) { @@ -109,7 +109,7 @@ QVariantList CoreBacklogManager::requestBacklogAll(MsgId first, MsgId last, int msgListEnd = msgList.constEnd(); while (msgIter != msgListEnd) { backlog << qVariantFromValue(*msgIter); - msgIter++; + ++msgIter; } } diff --git a/src/core/corebufferviewmanager.cpp b/src/core/corebufferviewmanager.cpp index 2c63d921..23417c3b 100644 --- a/src/core/corebufferviewmanager.cpp +++ b/src/core/corebufferviewmanager.cpp @@ -37,7 +37,7 @@ CoreBufferViewManager::CoreBufferViewManager(SignalProxy *proxy, CoreSession *pa while (iter != iterEnd) { config = new CoreBufferViewConfig(iter.key().toInt(), iter.value().toMap(), this); addBufferViewConfig(config); - iter++; + ++iter; } } @@ -50,7 +50,7 @@ void CoreBufferViewManager::saveBufferViews() BufferViewConfigHash::const_iterator iterEnd = bufferViewConfigHash().constEnd(); while (iter != iterEnd) { views[QString::number((*iter)->bufferViewId())] = (*iter)->toVariantMap(); - iter++; + ++iter; } Core::setUserSetting(_coreSession->user(), "BufferViews", views); @@ -70,7 +70,7 @@ void CoreBufferViewManager::requestCreateBufferView(const QVariantMap &propertie if ((*iter)->bufferViewId() > maxId) maxId = (*iter)->bufferViewId(); - iter++; + ++iter; } maxId++; @@ -85,7 +85,7 @@ void CoreBufferViewManager::requestCreateBufferViews(const QVariantList &propert QVariantList::const_iterator iterEnd = properties.constEnd(); while (iter != iterEnd) { requestCreateBufferView((*iter).toMap()); - iter++; + ++iter; } } diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 932af6fc..942e32f6 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -71,7 +71,6 @@ CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session) connect(&_tokenBucketTimer, SIGNAL(timeout()), this, SLOT(fillBucketAndProcessQueue())); connect(&socket, SIGNAL(connected()), this, SLOT(socketInitialized())); - connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected())); connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError))); connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState))); connect(&socket, SIGNAL(readyRead()), this, SLOT(socketHasData())); @@ -538,6 +537,7 @@ void CoreNetwork::socketStateChanged(QAbstractSocket::SocketState socketState) switch (socketState) { case QAbstractSocket::UnconnectedState: state = Network::Disconnected; + socketDisconnected(); break; case QAbstractSocket::HostLookupState: case QAbstractSocket::ConnectingState: diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 5fd5bdcf..1d0d5c5f 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -175,7 +175,7 @@ void CoreSession::loadSettings() networkIter = networkInfos.erase(networkIter); } else { - networkIter++; + ++networkIter; } } s.removeIdentity(id); @@ -548,7 +548,7 @@ void CoreSession::destroyNetwork(NetworkId id) messageIter = _messageQueue.erase(messageIter); } else { - messageIter++; + ++messageIter; } } // remove buffers from syncer @@ -578,7 +578,7 @@ void CoreSession::clientsConnected() IrcUser *me = 0; while (netIter != _networks.end()) { net = *netIter; - netIter++; + ++netIter; if (!net->isConnected()) continue; @@ -605,7 +605,7 @@ void CoreSession::clientsDisconnected() QString awayReason; while (netIter != _networks.end()) { net = *netIter; - netIter++; + ++netIter; if (!net->isConnected()) continue; @@ -633,7 +633,7 @@ void CoreSession::globalAway(const QString &msg) CoreNetwork *net = 0; while (netIter != _networks.end()) { net = *netIter; - netIter++; + ++netIter; if (!net->isConnected()) continue; diff --git a/src/core/ctcpparser.cpp b/src/core/ctcpparser.cpp index 37b0af3e..d2da8413 100644 --- a/src/core/ctcpparser.cpp +++ b/src/core/ctcpparser.cpp @@ -81,7 +81,7 @@ QByteArray CtcpParser::lowLevelQuote(const QByteArray &message) QHash::const_iterator quoteIter = quoteHash.constBegin(); while (quoteIter != quoteHash.constEnd()) { quotedMessage.replace(quoteIter.value(), quoteIter.key()); - quoteIter++; + ++quoteIter; } return quotedMessage; } @@ -117,7 +117,7 @@ QByteArray CtcpParser::xdelimQuote(const QByteArray &message) QHash::const_iterator quoteIter = _ctcpXDelimDequoteHash.constBegin(); while (quoteIter != _ctcpXDelimDequoteHash.constEnd()) { quotedMessage.replace(quoteIter.value(), quoteIter.key()); - quoteIter++; + ++quoteIter; } return quotedMessage; } @@ -185,7 +185,7 @@ void CtcpParser::parseSimple(IrcEventRawMessage *e, Message::Type messagetype, Q if (dequotedMessage.count(XDELIM) != 2 || dequotedMessage[0] != '\001' || dequotedMessage[dequotedMessage.count() -1] != '\001') { displayMsg(e, messagetype, targetDecode(e, dequotedMessage), e->prefix(), e->target(), flags); } else { - int spacePos = -1; + int spacePos; QString ctcpcmd, ctcpparam; QByteArray ctcp = xdelimDequote(dequotedMessage.mid(1, dequotedMessage.count() - 2)); diff --git a/src/core/postgresqlstorage.cpp b/src/core/postgresqlstorage.cpp index e7a71e7b..b16f4b0a 100644 --- a/src/core/postgresqlstorage.cpp +++ b/src/core/postgresqlstorage.cpp @@ -2004,7 +2004,7 @@ bool PostgreSqlMigrationWriter::postProcess() << Sequence("quasseluser", "userid") << Sequence("sender", "senderid"); QList::const_iterator iter; - for (iter = sequences.constBegin(); iter != sequences.constEnd(); iter++) { + for (iter = sequences.constBegin(); iter != sequences.constEnd(); ++iter) { resetQuery(); newQuery(QString("SELECT setval('%1_%2_seq', max(%2)) FROM %1").arg(iter->table, iter->field), db); if (!exec()) diff --git a/src/qtui/CMakeLists.txt b/src/qtui/CMakeLists.txt index 13279baa..6987ec60 100644 --- a/src/qtui/CMakeLists.txt +++ b/src/qtui/CMakeLists.txt @@ -95,12 +95,11 @@ if (WITH_KF5) list(APPEND LIBS KF5::ConfigWidgets KF5::Notifications KF5::NotifyConfig KF5::WidgetsAddons KF5::XmlGui) endif() -if (LIBSNORE_FOUND) +if (LibsnoreQt5_FOUND) add_definitions(-DHAVE_LIBSNORE) - include_directories(${LIBSNORE_INCLUDE_DIRS}) list(APPEND SOURCES snorenotificationbackend.cpp) list(APPEND FORMS snorentificationconfigwidget.ui) - list(APPEND LIBS ${LIBSNORE_LIBRARIES}) + list(APPEND LIBS Snore::Libsnore) endif() if (PHONON_FOUND OR Phonon4Qt5_FOUND) diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index e03d7cad..3d5534dd 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -651,7 +651,7 @@ void ChatScene::firstHandlePositionChanged(qreal xpos) QPointF senderPos(firstColumnHandle()->sceneRight(), 0); while (lineIter != lineIterBegin) { - lineIter--; + --lineIter; (*lineIter)->setFirstColumn(timestampWidth, senderWidth, senderPos); } //setItemIndexMethod(QGraphicsScene::BspTreeIndex); @@ -687,7 +687,7 @@ void ChatScene::secondHandlePositionChanged(qreal xpos) qreal contentsWidth = _sceneRect.width() - secondColumnHandle()->sceneRight(); QPointF contentsPos(secondColumnHandle()->sceneRight(), 0); while (lineIter != lineIterBegin) { - lineIter--; + --lineIter; (*lineIter)->setSecondColumn(senderWidth, contentsWidth, contentsPos, linePos); } //setItemIndexMethod(QGraphicsScene::BspTreeIndex); diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 8f022cac..bd8727ac 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -104,15 +104,17 @@ # ifdef HAVE_PHONON # include "phononnotificationbackend.h" # endif -# ifdef HAVE_LIBSNORE -# include "snorenotificationbackend.h" -# endif # include "systraynotificationbackend.h" # include "taskbarnotificationbackend.h" #else /* HAVE_KDE */ # include "knotificationbackend.h" #endif /* HAVE_KDE */ + +#ifdef HAVE_LIBSNORE +# include "snorenotificationbackend.h" +#endif + #ifdef HAVE_SSL # include "sslinfodlg.h" #endif @@ -224,18 +226,18 @@ void MainWin::init() # ifdef HAVE_PHONON QtUi::registerNotificationBackend(new PhononNotificationBackend(this)); # endif -# ifdef HAVE_LIBSNORE - QtUi::registerNotificationBackend(new SnoreNotificationBackend(this)); -# elif !defined(QT_NO_SYSTEMTRAYICON) - QtUi::registerNotificationBackend(new SystrayNotificationBackend(this)); -# endif - QtUi::registerNotificationBackend(new TaskbarNotificationBackend(this)); - #else /* HAVE_KDE */ QtUi::registerNotificationBackend(new KNotificationBackend(this)); #endif /* HAVE_KDE */ + +#ifdef HAVE_LIBSNORE + QtUi::registerNotificationBackend(new SnoreNotificationBackend(this)); +#elif !defined(QT_NO_SYSTEMTRAYICON) && !defined(HAVE_KDE) + QtUi::registerNotificationBackend(new SystrayNotificationBackend(this)); +#endif + #ifdef HAVE_INDICATEQT QtUi::registerNotificationBackend(new IndicatorNotificationBackend(this)); #endif diff --git a/src/qtui/qtuimessageprocessor.cpp b/src/qtui/qtuimessageprocessor.cpp index 68690f84..84deebee 100644 --- a/src/qtui/qtuimessageprocessor.cpp +++ b/src/qtui/qtuimessageprocessor.cpp @@ -70,7 +70,7 @@ void QtUiMessageProcessor::process(QList &msgs) while (msgIter != msgIterEnd) { checkForHighlight(*msgIter); preProcess(*msgIter); - msgIter++; + ++msgIter; } Client::messageModel()->insertMessages(msgs); return; @@ -190,7 +190,7 @@ void QtUiMessageProcessor::highlightListChanged(const QVariant &variant) rule["CS"].toBool() ? Qt::CaseSensitive : Qt::CaseInsensitive, rule["RegEx"].toBool(), rule["Channel"].toString()); - iter++; + ++iter; } } diff --git a/src/qtui/settingspages/bufferviewsettingspage.cpp b/src/qtui/settingspages/bufferviewsettingspage.cpp index a3308f9b..a438af97 100644 --- a/src/qtui/settingspages/bufferviewsettingspage.cpp +++ b/src/qtui/settingspages/bufferviewsettingspage.cpp @@ -400,7 +400,7 @@ void BufferViewSettingsPage::on_deleteBufferView_clicked() break; } else { - iter++; + ++iter; } } delete config; @@ -524,7 +524,7 @@ bool BufferViewSettingsPage::testHasChanged() } else { changed = true; - iter++; + ++iter; } } return changed; diff --git a/src/qtui/settingspages/identitiessettingspage.cpp b/src/qtui/settingspages/identitiessettingspage.cpp index d75a1c0b..72267fca 100644 --- a/src/qtui/settingspages/identitiessettingspage.cpp +++ b/src/qtui/settingspages/identitiessettingspage.cpp @@ -84,7 +84,7 @@ void IdentitiesSettingsPage::continueUnsecured() _editSsl = true; QHash::iterator idIter; - for (idIter = identities.begin(); idIter != identities.end(); idIter++) { + for (idIter = identities.begin(); idIter != identities.end(); ++idIter) { idIter.value()->enableEditSsl(); } diff --git a/src/qtui/snorenotificationbackend.cpp b/src/qtui/snorenotificationbackend.cpp index 6732c549..72873c1e 100644 --- a/src/qtui/snorenotificationbackend.cpp +++ b/src/qtui/snorenotificationbackend.cpp @@ -22,6 +22,7 @@ #include #include +#include #include "client.h" #include "networkmodel.h" @@ -31,83 +32,66 @@ #include -#include -#include +#include +#include SnoreNotificationBackend::SnoreNotificationBackend (QObject *parent) : AbstractNotificationBackend(parent), - m_systrayBackend(NULL) + m_icon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png"))) { - NotificationSettings notificationSettings; - QString backend = notificationSettings.value("Snore/Backend", "Default").toString(); - m_timeout = notificationSettings.value("Snore/Timeout", 10).toInt(); - - notificationSettings.notify("Snore/Backend", this, SLOT(backendChanged(const QVariant &))); - notificationSettings.notify("Snore/Timeout", this, SLOT(timeoutChanged(const QVariant &))); - //TODO: try to get an instance of the tray icon to be able to show popups - m_snore = new Snore::SnoreCore(); - m_snore->loadPlugins(Snore::SnorePlugin::BACKEND); - m_icon = Snore::Icon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")).pixmap(48).toImage()); + Snore::SnoreCore::instance().loadPlugins( +#ifndef HAVE_KDE + Snore::SnorePlugin::BACKEND | +#endif + Snore::SnorePlugin::SECONDARY_BACKEND); m_application = Snore::Application("Quassel", m_icon); - m_application.hints().setValue("WINDOWS_APP_ID","QuasselProject.QuasselIRC"); + m_application.hints().setValue("windows-app-id","QuasselProject.QuasselIRC"); + m_application.hints().setValue("pushover-token", "arNtsi983QSZUqU3KAZrFLKHGFPkdL"); - connect(m_snore, SIGNAL(actionInvoked(Snore::Notification)), this, SLOT(actionInvoked(Snore::Notification))); + connect(&Snore::SnoreCore::instance(), SIGNAL(actionInvoked(Snore::Notification)), this, SLOT(actionInvoked(Snore::Notification))); m_alert = Snore::Alert(tr("Private Message"), m_icon); m_application.addAlert(m_alert); + Snore::SnoreCore::instance().setDefaultApplication(m_application); - m_snore->registerApplication(m_application); - - backendChanged(QVariant::fromValue(backend)); - - + NotificationSettings notificationSettings; + bool enabled = notificationSettings.value("Snore/Enabled", false).toBool(); + setTraybackend(enabled); + notificationSettings.notify("Snore/Enabled", this, SLOT(setTraybackend(const QVariant &))); } SnoreNotificationBackend::~SnoreNotificationBackend() { - m_snore->deregisterApplication(m_application); - m_snore->deleteLater(); -} - -void SnoreNotificationBackend::backendChanged(const QVariant &v) -{ - QString backend = v.toString(); - if (backend != "Default") { - if (setSnoreBackend(backend)) { - return; - } - } - setTraybackend(); -} - -void SnoreNotificationBackend::timeoutChanged(const QVariant &v) -{ - m_timeout = v.toInt(); + Snore::SnoreCore::instance().deregisterApplication(m_application); } void SnoreNotificationBackend::notify(const Notification &n) { - if (m_systrayBackend != NULL) { +#ifndef HAVE_KDE + if (m_systrayBackend != nullptr) { return; } - QString title = Client::networkModel()->networkName(n.bufferId) + " - " + Client::networkModel()->bufferName(n.bufferId); +#endif + QString title = QString("%1 - %2").arg(Client::networkModel()->networkName(n.bufferId), Client::networkModel()->bufferName(n.bufferId)); QString message = QString("<%1> %2").arg(n.sender, n.message); - Snore::Notification noti(m_application, m_alert, title, message, m_icon, m_timeout); + Snore::Notification noti(m_application, m_alert, title, message, m_icon); noti.hints().setValue("QUASSEL_ID", n.notificationId); m_notificationIds.insert(n.notificationId, noti.id()); - m_snore->broadcastNotification(noti); + Snore::SnoreCore::instance().broadcastNotification(noti); } void SnoreNotificationBackend::close(uint notificationId) { - if (m_systrayBackend != NULL) { +#ifndef HAVE_KDE + if (m_systrayBackend != nullptr) { return; } - Snore::Notification n = m_snore->getActiveNotificationByID(m_notificationIds.take(notificationId)); - m_snore->requestCloseNotification(n, Snore::Notification::CLOSED); +#endif + Snore::Notification n = Snore::SnoreCore::instance().getActiveNotificationByID(m_notificationIds.take(notificationId)); + Snore::SnoreCore::instance().requestCloseNotification(n, Snore::Notification::CLOSED); } void SnoreNotificationBackend::actionInvoked(Snore::Notification n) @@ -117,57 +101,40 @@ void SnoreNotificationBackend::actionInvoked(Snore::Notification n) SettingsPage *SnoreNotificationBackend::createConfigWidget()const { - return new ConfigWidget(m_snore); + return new ConfigWidget(); } -void SnoreNotificationBackend::setTraybackend() -{ - if (m_systrayBackend == NULL) { - m_systrayBackend = new SystrayNotificationBackend(this); - QtUi::registerNotificationBackend(m_systrayBackend); - } -} -bool SnoreNotificationBackend::setSnoreBackend(const QString &backend) +void SnoreNotificationBackend::setTraybackend(const QVariant &b) { - if (m_systrayBackend != NULL) { - QtUi::unregisterNotificationBackend(m_systrayBackend); - delete m_systrayBackend; - m_systrayBackend = NULL; +#ifndef HAVE_KDE + if (!b.toBool()) { + if (m_systrayBackend == nullptr) { + m_systrayBackend = new SystrayNotificationBackend(this); + QtUi::registerNotificationBackend(m_systrayBackend); + } + } else { + if (m_systrayBackend != nullptr) { + QtUi::unregisterNotificationBackend(m_systrayBackend); + m_systrayBackend->deleteLater(); + m_systrayBackend = nullptr; + } + } +#endif + if (b.toBool()) { + Snore::SnoreCore::instance().registerApplication(m_application); + } else { + Snore::SnoreCore::instance().deregisterApplication(m_application); } - return m_snore->setPrimaryNotificationBackend(backend); } - - - /***************************************************************************/ -SnoreNotificationBackend::ConfigWidget::ConfigWidget(Snore::SnoreCore *snore, QWidget *parent) - :SettingsPage("Internal", "SnoreNotification", parent), - m_snore(snore) +SnoreNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) + :SettingsPage("Internal", "SnoreNotification", parent) { ui.setupUi(this); - QStringList backends = m_snore->notificationBackends(); - backends.append("Default"); - qSort(backends); - ui.backends->insertItems(0, backends); - - connect(ui.backends, SIGNAL(currentIndexChanged(QString)), SLOT(backendChanged(QString))); - connect(ui.timeout, SIGNAL(valueChanged(int)), this, SLOT(timeoutChanged(int))); -} - -void SnoreNotificationBackend::ConfigWidget::backendChanged(const QString &b) -{ - ui.backends->setCurrentIndex(ui.backends->findText(b)); - setChangedState(true); -} - -void SnoreNotificationBackend::ConfigWidget::timeoutChanged(int i) -{ - ui.timeout->setValue(i); - setChangedState(true); - + connect(ui.useSnoreCheckBox, SIGNAL(toggled(bool)), this, SLOT(useSnnoreChanged(bool))); } bool SnoreNotificationBackend::ConfigWidget::hasDefaults() const @@ -177,24 +144,33 @@ bool SnoreNotificationBackend::ConfigWidget::hasDefaults() const void SnoreNotificationBackend::ConfigWidget::defaults() { - backendChanged("Default"); - timeoutChanged(10); + useSnnoreChanged(false); + ui.widget->reset(); } void SnoreNotificationBackend::ConfigWidget::load() { NotificationSettings s; - QString backend = s.value("Snore/Backend", "Default").toString(); - int timeout = s.value("Snore/Timeout", 10).toInt(); - ui.backends->setCurrentIndex(ui.backends->findText(backend)); - ui.timeout->setValue(timeout); + bool enabled = s.value("Snore/Enabled", false).toBool(); + ui.useSnoreCheckBox->setChecked(enabled); + ui.widget->setEnabled(enabled); setChangedState(false); + QMetaObject::invokeMethod(this, "changed", Qt::QueuedConnection);//hack to make apply and accept button work for snore settings widget } void SnoreNotificationBackend::ConfigWidget::save() { NotificationSettings s; - s.setValue("Snore/Backend", ui.backends->currentText()); - s.setValue("Snore/Timeout", ui.timeout->value()); + s.setValue("Snore/Enabled", ui.useSnoreCheckBox->isChecked()); + ui.widget->accept(); load(); } + +void SnoreNotificationBackend::ConfigWidget::useSnnoreChanged(bool b) +{ + ui.useSnoreCheckBox->setChecked(b); + ui.widget->setEnabled(b); + setChangedState(true); +} + + diff --git a/src/qtui/snorenotificationbackend.h b/src/qtui/snorenotificationbackend.h index fa57adc2..e0abdf7f 100644 --- a/src/qtui/snorenotificationbackend.h +++ b/src/qtui/snorenotificationbackend.h @@ -27,8 +27,8 @@ #include "ui_snorentificationconfigwidget.h" -#include -#include +#include +#include class SystrayNotificationBackend; @@ -41,53 +41,44 @@ public: void notify(const Notification &); void close(uint notificationId); - virtual SettingsPage *createConfigWidget()const; + virtual SettingsPage *createConfigWidget() const; signals: void activated(uint notificationId = 0); public slots: void actionInvoked(Snore::Notification); + private slots: - void backendChanged(const QVariant &); - void timeoutChanged(const QVariant &); + void setTraybackend(const QVariant &b); private: - void setTraybackend(); - bool setSnoreBackend(const QString &backend); class ConfigWidget; - SystrayNotificationBackend * m_systrayBackend; - Snore::SnoreCore *m_snore; +#ifndef HAVE_KDE + SystrayNotificationBackend * m_systrayBackend = nullptr; +#endif QHash m_notificationIds; Snore::Icon m_icon; Snore::Application m_application; Snore::Alert m_alert; - int m_timeout; }; class SnoreNotificationBackend::ConfigWidget : public SettingsPage { Q_OBJECT public: - ConfigWidget(Snore::SnoreCore *snore, QWidget *parent = 0); - void save(); - void load(); + ConfigWidget(QWidget *parent = 0); + bool hasDefaults() const; void defaults(); - + void load(); + void save(); private slots: - void backendChanged(const QString&); - void timeoutChanged(int); + void useSnnoreChanged(bool); private: Ui::SnoreNotificationConfigWidget ui; - Snore::SnoreCore *m_snore; - - // QSpinBox *timeoutBox; - - // bool enabled; - // int timeout; }; #endif diff --git a/src/qtui/ui/snorentificationconfigwidget.ui b/src/qtui/ui/snorentificationconfigwidget.ui index 0e33248b..991e37b6 100644 --- a/src/qtui/ui/snorentificationconfigwidget.ui +++ b/src/qtui/ui/snorentificationconfigwidget.ui @@ -28,78 +28,37 @@ Snore - - - - 10 - 25 - 46 - 13 - - - - Backend: - - - - - - 70 - 20 - 331 - 22 - - - - - - - 10 - 65 - 46 - 13 - - - - Timeout: - - - - - - 70 - 60 - 81 - 22 - - - - - - - s - - - 0 - - - - - - 170 - 65 - 101 - 16 - - - - 0 means infinite - - + + + + + + + + + + Enable Snore + + + + + + + + + + + + Snore::SettingsDialog + QWidget +
libsnore/settingsdialog.h
+ 1 +
+
diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index 970f037a..c829267a 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -161,12 +161,12 @@ void BufferViewFilter::enableEditMode(bool enable) if (enable == false) { addBuffers(QList::fromSet(_toAdd)); QSet::const_iterator iter; - for (iter = _toTempRemove.constBegin(); iter != _toTempRemove.constEnd(); iter++) { + for (iter = _toTempRemove.constBegin(); iter != _toTempRemove.constEnd(); ++iter) { if (config()->temporarilyRemovedBuffers().contains(*iter)) continue; config()->requestRemoveBuffer(*iter); } - for (iter = _toRemove.constBegin(); iter != _toRemove.constEnd(); iter++) { + for (iter = _toRemove.constBegin(); iter != _toRemove.constEnd(); ++iter) { if (config()->removedBuffers().contains(*iter)) continue; config()->requestRemoveBufferPermanently(*iter); diff --git a/src/uisupport/contextmenuactionprovider.cpp b/src/uisupport/contextmenuactionprovider.cpp index 87d104fd..62d7aac1 100644 --- a/src/uisupport/contextmenuactionprovider.cpp +++ b/src/uisupport/contextmenuactionprovider.cpp @@ -514,7 +514,7 @@ void ContextMenuActionProvider::addIgnoreMenu(QMenu *menu, const QString &hostma ignoreMenu->addAction(act); } counter++; - ruleIter++; + ++ruleIter; } if (counter) ignoreMenu->addSeparator();