qa: Avoid deprecation warnings for QList/QSet conversions
[quassel.git] / src / common / compressor.h
index 85817f1..47a4350 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
+ *   Copyright (C) 2005-2019 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COMPRESSOR_H
-#define COMPRESSOR_H
+#pragma once
 
 #include <QObject>
 
-class QTcpSocket;
+#include <zlib.h>
 
-typedef struct mz_stream_s *z_streamp;
+class QTcpSocket;
 
 class Compressor : public QObject
 {
     Q_OBJECT
 
 public:
-    enum CompressionLevel {
+    enum CompressionLevel
+    {
         NoCompression,
         DefaultCompression,
         BestCompression,
         BestSpeed
     };
 
-    enum Error {
+    enum Error
+    {
         NoError,
         StreamError,
         DeviceError
     };
 
-    enum WriteBufferHint {
+    enum WriteBufferHint
+    {
         NoFlush,
         Flush
     };
 
-    Compressor(QTcpSocket *socket, CompressionLevel level, QObject *parent = 0);
-    ~Compressor();
+    Compressor(QTcpSocket* socket, CompressionLevel level, QObject* parent = nullptr);
+    ~Compressor() override;
 
     CompressionLevel compressionLevel() const { return _level; }
 
     qint64 bytesAvailable() const;
 
-    qint64 read(char *data, qint64 maxSize);
-    qint64 write(const char *data, qint64 count, WriteBufferHint flush = Flush);
+    qint64 read(chardata, qint64 maxSize);
+    qint64 write(const chardata, qint64 count, WriteBufferHint flush = Flush);
 
     void flush();
 
@@ -74,7 +76,7 @@ private:
     void writeData();
 
 private:
-    QTcpSocket *_socket;
+    QTcpSocket_socket;
     CompressionLevel _level;
 
     QByteArray _readBuffer;
@@ -86,5 +88,3 @@ private:
     z_streamp _inflater;
     z_streamp _deflater;
 };
-
-#endif