modernize: Pass arguments by value and move in constructors
[quassel.git] / src / common / bufferinfo.cpp
index fb6678f..8ac1f4b 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-09 by the Quassel Project                          *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
 #include <QString>
 #include <QDataStream>
 #include <QDebug>
 #include <QByteArray>
+#include <utility>
 
 #include "bufferinfo.h"
 
@@ -42,7 +43,7 @@ BufferInfo::BufferInfo(BufferId id,  NetworkId networkid, Type type, uint gid, Q
     _netid(networkid),
     _type(type),
     _groupId(gid),
-    _bufferName(buf)
+    _bufferName(std::move(buf))
 {
 }
 
@@ -62,6 +63,14 @@ QString BufferInfo::bufferName() const
 }
 
 
+bool BufferInfo::acceptsRegularMessages() const
+{
+    if(_type == StatusBuffer || _type == InvalidBuffer)
+        return false;
+    return true;
+}
+
+
 QDebug operator<<(QDebug dbg, const BufferInfo &b)
 {
     dbg.nospace() << "(bufId: " << b.bufferId() << ", netId: " << b.networkId() << ", groupId: " << b.groupId() << ", buf: " << b.bufferName() << ")";