Merge pull request #72 from jpnurmi/datastream
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 2 Jul 2014 22:22:57 +0000 (00:22 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 2 Jul 2014 22:22:57 +0000 (00:22 +0200)
DataStreamPeer: add missing include <QDataStream>

ChangeLog
src/client/coreconnection.cpp
src/common/authhandler.cpp
src/common/authhandler.h
src/core/corenetwork.cpp
src/uisupport/tabcompleter.cpp

index b4dfc9b..f5958a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,8 +13,14 @@ changes, the git history at <http://git.quassel-irc.org> is your friend.
 
 Without further ado, let's start:
 
-Version 0.10-rc1 (2014-03-16)
-=============================
+Version 0.11.x (TBD)
+====================
+
+* Full support for Qt 5.2+ in addition to Qt 4.6+
+* Completely revamp the build system, making use of "new" CMake features
+
+Version 0.10.0 (2014-03-25)
+===========================
 
 * Refactor lots of the protocol and connection code
 * Introduce connection probing for reliably negotiating protocol features
@@ -28,11 +34,12 @@ Version 0.10-rc1 (2014-03-16)
 * Show backlog messages in the Chat Monitor
 * Remove SSL protocol selection, always use auto-negotiation for best results
 * Highlight rules are now case-insensitive by default
-* New translations
+* New and updated translations
 * Bump inxi version (for /sysinfo)
+* Use the raster rendering engine by default on OSX (should improve performance)
 
-Version 0.9.3 (TBD)
-===================
+Version 0.9.3 (2014-03-25)
+==========================
 
 * Notification fixes
 * Improve reliability of SSL connections
index 3650385..4928a8b 100644 (file)
@@ -211,8 +211,10 @@ bool CoreConnection::isLocalConnection() const
         return false;
     if (currentAccount().isInternal())
         return true;
-    if (_peer->isLocal())
-        return true;
+    if (_authHandler)
+        return _authHandler->isLocal();
+    if (_peer)
+        return _peer->isLocal();
 
     return false;
 }
index 9148e21..7c2905d 100644 (file)
@@ -18,6 +18,8 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
+#include <QHostAddress>
+
 #include "authhandler.h"
 
 AuthHandler::AuthHandler(QObject *parent)
@@ -43,6 +45,16 @@ void AuthHandler::setSocket(QTcpSocket *socket)
 }
 
 
+bool AuthHandler::isLocal() const
+{
+    if (socket()) {
+        if (socket()->peerAddress() == QHostAddress::LocalHost || socket()->peerAddress() == QHostAddress::LocalHostIPv6)
+            return true;
+    }
+    return false;
+}
+
+
 // Some errors (e.g. connection refused) don't trigger a disconnected() from the socket, so send this explicitly
 // (but make sure it's only sent once!)
 void AuthHandler::onSocketError(QAbstractSocket::SocketError error)
index cfed51e..cc03588 100644 (file)
@@ -36,6 +36,8 @@ public:
 
     QTcpSocket *socket() const;
 
+    bool isLocal() const;
+
     virtual void handle(const Protocol::RegisterClient &) { invalidMessage(); }
     virtual void handle(const Protocol::ClientDenied &) { invalidMessage(); }
     virtual void handle(const Protocol::ClientRegistered &) { invalidMessage(); }
index b7d496a..80986f0 100644 (file)
@@ -411,7 +411,10 @@ void CoreNetwork::socketHasData()
 {
     while (socket.canReadLine()) {
         QByteArray s = socket.readLine();
-        s.chop(2);
+        if (s.endsWith("\r\n"))
+            s.chop(2);
+        else if (s.endsWith("\n"))
+            s.chop(1);
         NetworkDataEvent *event = new NetworkDataEvent(EventManager::NetworkIncoming, this, s);
 #if QT_VERSION >= 0x040700
         event->setTimestamp(QDateTime::currentDateTimeUtc());
index 9a83416..5cc80c9 100644 (file)
@@ -45,18 +45,19 @@ TabCompleter::TabCompleter(MultiLineEdit *_lineEdit)
     _enabled(false),
     _nickSuffix(": ")
 {
-    // use both an Action and generic eventFilter, to make the shortcut configurable
-    // yet still be able to reset() when required
+    // This Action just serves as a container for the custom shortcut and isn't actually handled;
+    // apparently, using tab as an Action shortcut  in an input widget is unreliable on some platforms (e.g. OS/2)
     _lineEdit->installEventFilter(this);
     ActionCollection *coll = GraphicalUi::actionCollection("General");
-    coll->addAction("TabCompletionKey", new Action(tr("Tab completion"), coll,
+    QAction *a = coll->addAction("TabCompletionKey", new Action(tr("Tab completion"), coll,
             this, SLOT(onTabCompletionKey()), QKeySequence(Qt::Key_Tab)));
+    a->setEnabled(false); // avoid catching the shortcut
 }
 
 
 void TabCompleter::onTabCompletionKey()
 {
-    complete();
+    // do nothing; we use the event filter instead
 }
 
 
@@ -179,9 +180,11 @@ bool TabCompleter::eventFilter(QObject *obj, QEvent *event)
 
     QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
 
-    if (keyEvent->key() != GraphicalUi::actionCollection("General")->action("TabCompletionKey")->shortcut()[0]) {
+    if (keyEvent->key() == GraphicalUi::actionCollection("General")->action("TabCompletionKey")->shortcut()[0])
+        complete();
+    else
         reset();
-    }
+
     return false;
 }