Revert rudimentary DCC support for the 0.10 release
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 16 Mar 2014 15:00:49 +0000 (16:00 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 16 Mar 2014 15:11:59 +0000 (16:11 +0100)
We've added the first bits for supporting DCC file transfers in Quassel
recently, but didn't manage to get it anywhere near ready for public
consumption before the 0.10.0 release. So in order to not have experimental
or even unused code in the final release, we'll revert it in this branch.

29 files changed:
src/client/CMakeLists.txt
src/client/client.cpp
src/client/client.h
src/client/clienttransfer.cpp [deleted file]
src/client/clienttransfer.h [deleted file]
src/client/clienttransfermanager.cpp [deleted file]
src/client/clienttransfermanager.h [deleted file]
src/common/CMakeLists.txt
src/common/main.cpp
src/common/quassel.cpp
src/common/transfer.cpp [deleted file]
src/common/transfer.h [deleted file]
src/common/transfermanager.cpp [deleted file]
src/common/transfermanager.h [deleted file]
src/core/CMakeLists.txt
src/core/coresession.cpp
src/core/coresession.h
src/core/coresessioneventprocessor.cpp
src/core/coresessioneventprocessor.h
src/core/coretransfer.cpp [deleted file]
src/core/coretransfer.h [deleted file]
src/core/coretransfermanager.cpp [deleted file]
src/core/coretransfermanager.h [deleted file]
src/qtui/CMakeLists.txt
src/qtui/mainwin.cpp
src/qtui/mainwin.h
src/qtui/receivefiledlg.cpp [deleted file]
src/qtui/receivefiledlg.h [deleted file]
src/qtui/ui/receivefiledlg.ui [deleted file]

index c7b3ee3..3377771 100644 (file)
@@ -33,8 +33,6 @@ set(SOURCES
     clientignorelistmanager.cpp
     clientirclisthelper.cpp
     clientsettings.cpp
-    clienttransfer.cpp
-    clienttransfermanager.cpp
     clientuserinputhandler.cpp
     coreaccount.cpp
     coreaccountmodel.cpp
@@ -62,8 +60,6 @@ set(MOC_HDRS
     clientidentity.h
     clientignorelistmanager.h
     clientirclisthelper.h
-    clienttransfer.h
-    clienttransfermanager.h
     clientuserinputhandler.h
     coreaccountmodel.h
     coreconnection.h
index 9ef23ef..1b32f53 100644 (file)
@@ -34,7 +34,6 @@
 #include "clientirclisthelper.h"
 #include "clientidentity.h"
 #include "clientignorelistmanager.h"
-#include "clienttransfermanager.h"
 #include "clientuserinputhandler.h"
 #include "coreaccountmodel.h"
 #include "coreconnection.h"
@@ -103,7 +102,6 @@ Client::Client(QObject *parent)
     _inputHandler(0),
     _networkConfig(0),
     _ignoreListManager(0),
-    _transferManager(0),
     _messageModel(0),
     _messageProcessor(0),
     _coreAccountModel(new CoreAccountModel(this)),
@@ -406,10 +404,6 @@ void Client::setSyncedToCore()
     _ignoreListManager = new ClientIgnoreListManager(this);
     signalProxy()->synchronize(ignoreListManager());
 
-    Q_ASSERT(!_transferManager);
-    _transferManager = new ClientTransferManager(this);
-    signalProxy()->synchronize(transferManager());
-
     // trigger backlog request once all active bufferviews are initialized
     connect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
 
@@ -479,12 +473,6 @@ void Client::setDisconnectedFromCore()
         _ignoreListManager->deleteLater();
         _ignoreListManager = 0;
     }
-
-    if (_transferManager) {
-        _transferManager->deleteLater();
-        _transferManager = 0;
-    }
-
     // we probably don't want to save pending input for reconnect
     _userInputBuffer.clear();
 
index e3aacd0..9968bd1 100644 (file)
@@ -49,7 +49,6 @@ class ClientBacklogManager;
 class ClientBufferViewManager;
 class ClientIgnoreListManager;
 class ClientIrcListHelper;
-class ClientTransferManager;
 class ClientUserInputHandler;
 class CoreAccountModel;
 class CoreConnection;
@@ -57,7 +56,6 @@ class IrcUser;
 class IrcChannel;
 class NetworkConfig;
 class SignalProxy;
-
 struct NetworkInfo;
 
 class Client : public QObject
@@ -119,7 +117,6 @@ public:
     static inline ClientUserInputHandler *inputHandler() { return instance()->_inputHandler; }
     static inline NetworkConfig *networkConfig() { return instance()->_networkConfig; }
     static inline ClientIgnoreListManager *ignoreListManager() { return instance()->_ignoreListManager; }
-    static inline ClientTransferManager *transferManager() { return instance()->_transferManager; }
 
     static inline CoreAccountModel *coreAccountModel() { return instance()->_coreAccountModel; }
     static inline CoreConnection *coreConnection() { return instance()->_coreConnection; }
@@ -237,7 +234,6 @@ private:
     ClientUserInputHandler *_inputHandler;
     NetworkConfig *_networkConfig;
     ClientIgnoreListManager *_ignoreListManager;
-    ClientTransferManager *_transferManager;
 
     MessageModel *_messageModel;
     AbstractMessageProcessor *_messageProcessor;
diff --git a/src/client/clienttransfer.cpp b/src/client/clienttransfer.cpp
deleted file mode 100644 (file)
index 9f70e63..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#include <QFile>
-
-#include "clienttransfer.h"
-
-INIT_SYNCABLE_OBJECT(ClientTransfer)
-ClientTransfer::ClientTransfer(const QUuid &uuid, QObject *parent)
-    : Transfer(uuid, parent),
-    _file(0)
-{
-    connect(this, SIGNAL(stateChanged(State)), SLOT(onStateChanged(State)));
-}
-
-
-void ClientTransfer::cleanUp()
-{
-    if (_file) {
-        _file->close();
-        _file->deleteLater();
-        _file = 0;
-    }
-}
-
-
-QString ClientTransfer::savePath() const
-{
-    return _savePath;
-}
-
-
-void ClientTransfer::accept(const QString &savePath) const
-{
-    _savePath = savePath;
-    PeerPtr ptr = 0;
-    REQUEST_OTHER(requestAccepted, ARG(ptr));
-    emit accepted();
-}
-
-
-void ClientTransfer::reject() const
-{
-    PeerPtr ptr = 0;
-    REQUEST_OTHER(requestRejected, ARG(ptr));
-    emit rejected();
-}
-
-
-void ClientTransfer::dataReceived(PeerPtr, const QByteArray &data)
-{
-    // TODO: proper error handling (relay to core)
-    if (!_file) {
-        _file = new QFile(_savePath, this);
-        if (!_file->open(QFile::WriteOnly|QFile::Truncate)) {
-            qWarning() << Q_FUNC_INFO << "Could not open file:" << _file->errorString();
-            return;
-        }
-    }
-
-    if (!_file->isOpen())
-        return;
-
-    if (_file->write(data) < 0) {
-        qWarning() << Q_FUNC_INFO << "Could not write to file:" << _file->errorString();
-        return;
-    }
-}
-
-
-void ClientTransfer::onStateChanged(Transfer::State state)
-{
-    switch(state) {
-        case Completed:
-            if (_file)
-                _file->close();
-            break;
-        case Failed:
-            if (_file)
-                _file->remove();
-            break;
-        default:
-            ;
-    }
-}
diff --git a/src/client/clienttransfer.h b/src/client/clienttransfer.h
deleted file mode 100644 (file)
index 9753f41..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef CLIENTTRANSFER_H
-#define CLIENTTRANSFER_H
-
-#include <QUuid>
-
-#include "transfer.h"
-
-class QFile;
-
-class ClientTransfer : public Transfer
-{
-    Q_OBJECT
-    SYNCABLE_OBJECT
-
-public:
-    ClientTransfer(const QUuid &uuid, QObject *parent = 0);
-
-    QString savePath() const;
-
-public slots:
-    // called on the client side
-    void accept(const QString &savePath) const;
-    void reject() const;
-
-private slots:
-    void dataReceived(PeerPtr peer, const QByteArray &data);
-    void onStateChanged(State state);
-
-private:
-    virtual void cleanUp();
-
-    mutable QString _savePath;
-
-    QFile *_file;
-};
-
-#endif
diff --git a/src/client/clienttransfermanager.cpp b/src/client/clienttransfermanager.cpp
deleted file mode 100644 (file)
index 1860e48..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#include "clienttransfermanager.h"
-
-#include "client.h"
-#include "clienttransfer.h"
-
-
-INIT_SYNCABLE_OBJECT(ClientTransferManager)
-ClientTransferManager::ClientTransferManager(QObject *parent)
-    : TransferManager(parent)
-{
-    connect(this, SIGNAL(transferAdded(const Transfer*)), SLOT(onTransferAdded(const Transfer*)));
-}
-
-
-const ClientTransfer *ClientTransferManager::transfer(const QUuid &uuid) const
-{
-    return qobject_cast<const ClientTransfer *>(transfer_(uuid));
-}
-
-
-void ClientTransferManager::onCoreTransferAdded(const QUuid &uuid)
-{
-    if (uuid.isNull()) {
-        qWarning() << Q_FUNC_INFO << "Invalid transfer uuid" << uuid.toString();
-        return;
-    }
-
-    ClientTransfer *transfer = new ClientTransfer(uuid, this);
-    connect(transfer, SIGNAL(initDone()), SLOT(onTransferInitDone())); // we only want to add initialized transfers
-    Client::signalProxy()->synchronize(transfer);
-}
-
-
-void ClientTransferManager::onTransferInitDone()
-{
-    Transfer *transfer = qobject_cast<Transfer *>(sender());
-    Q_ASSERT(transfer);
-    addTransfer(transfer);
-}
-
-
-void ClientTransferManager::onTransferAdded(const Transfer *transfer)
-{
-    const ClientTransfer *t = qobject_cast<const ClientTransfer *>(transfer);
-    if (!t) {
-        qWarning() << "Invalid Transfer added to ClientTransferManager!";
-        return;
-    }
-
-    emit transferAdded(t);
-}
diff --git a/src/client/clienttransfermanager.h b/src/client/clienttransfermanager.h
deleted file mode 100644 (file)
index 9004d3b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef CLIENTTRANSFERMANAGER_H
-#define CLIENTTRANSFERMANAGER_H
-
-#include "transfermanager.h"
-
-#include <QUuid>
-
-class ClientTransfer;
-
-class ClientTransferManager : public TransferManager
-{
-    Q_OBJECT
-    SYNCABLE_OBJECT
-
-public:
-    ClientTransferManager(QObject *parent = 0);
-
-    const ClientTransfer *transfer(const QUuid &uuid) const;
-
-public slots:
-    void onCoreTransferAdded(const QUuid &uuid);
-    void onTransferInitDone();
-
-signals:
-    void transferAdded(const ClientTransfer *transfer);
-
-private slots:
-    void onTransferAdded(const Transfer *transfer);
-
-};
-
-#endif
index 87a08d2..4e835cd 100644 (file)
@@ -37,8 +37,6 @@ set(SOURCES
     settings.cpp
     signalproxy.cpp
     syncableobject.cpp
-    transfer.cpp
-    transfermanager.cpp
     util.cpp
 
     protocols/datastream/datastreampeer.cpp
@@ -69,8 +67,6 @@ set(MOC_HDRS
     settings.h
     signalproxy.h
     syncableobject.h
-    transfer.h
-    transfermanager.h
 
     protocols/datastream/datastreampeer.h
     protocols/legacy/legacypeer.h
index 2036194..b026d47 100644 (file)
@@ -118,7 +118,6 @@ int main(int argc, char **argv)
 #ifdef HAVE_SSL
     cliParser->addSwitch("require-ssl", 0, "Require SSL for client connections");
 #endif
-    cliParser->addSwitch("enable-experimental-dcc", 0, "Enable highly experimental and unfinished support for CTCP DCC (DANGEROUS)");
 #endif
 
 #ifdef HAVE_KDE
index 23202a7..13567d3 100644 (file)
@@ -35,7 +35,6 @@
 #include <QLibraryInfo>
 #include <QSettings>
 #include <QTranslator>
-#include <QUuid>
 
 #include "bufferinfo.h"
 #include "identity.h"
@@ -190,7 +189,6 @@ void Quassel::registerMetaTypes()
     qRegisterMetaType<MsgId>("MsgId");
 
     qRegisterMetaType<QHostAddress>("QHostAddress");
-    qRegisterMetaType<QUuid>("QUuid");
 
     qRegisterMetaTypeStreamOperators<IdentityId>("IdentityId");
     qRegisterMetaTypeStreamOperators<BufferId>("BufferId");
diff --git a/src/common/transfer.cpp b/src/common/transfer.cpp
deleted file mode 100644 (file)
index 6037513..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#include "transfer.h"
-
-INIT_SYNCABLE_OBJECT(Transfer)
-Transfer::Transfer(const QUuid &uuid, QObject *parent)
-    : SyncableObject(parent),
-    _state(New),
-    _direction(Receive),
-    _port(0),
-    _fileSize(0),
-    _uuid(uuid)
-{
-    init();
-}
-
-Transfer::Transfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 fileSize, QObject *parent)
-    : SyncableObject(parent),
-    _state(New),
-    _direction(direction),
-    _fileName(fileName),
-    _address(address),
-    _port(port),
-    _fileSize(fileSize),
-    _nick(nick),
-    _uuid(QUuid::createUuid())
-{
-    init();
-}
-
-
-void Transfer::init()
-{
-    renameObject(QString("Transfer/%1").arg(_uuid.toString()));
-    setAllowClientUpdates(true);
-}
-
-
-QUuid Transfer::uuid() const
-{
-    return _uuid;
-}
-
-
-Transfer::State Transfer::state() const
-{
-    return _state;
-}
-
-
-void Transfer::setState(Transfer::State state)
-{
-    if (_state != state) {
-        _state = state;
-        SYNC(ARG(state));
-        emit stateChanged(state);
-    }
-}
-
-
-
-Transfer::Direction Transfer::direction() const
-{
-    return _direction;
-}
-
-
-void Transfer::setDirection(Transfer::Direction direction)
-{
-    if (_direction != direction) {
-        _direction = direction;
-        SYNC(ARG(direction));
-        emit directionChanged(direction);
-    }
-}
-
-
-QHostAddress Transfer::address() const
-{
-    return _address;
-}
-
-
-void Transfer::setAddress(const QHostAddress &address)
-{
-    if (_address != address) {
-        _address = address;
-        SYNC(ARG(address));
-        emit addressChanged(address);
-    }
-}
-
-
-quint16 Transfer::port() const
-{
-    return _port;
-}
-
-
-void Transfer::setPort(quint16 port)
-{
-    if (_port != port) {
-        _port = port;
-        SYNC(ARG(port));
-        emit portChanged(port);
-    }
-}
-
-
-QString Transfer::fileName() const
-{
-    return _fileName;
-}
-
-
-void Transfer::setFileName(const QString &fileName)
-{
-    if (_fileName != fileName) {
-        _fileName = fileName;
-        SYNC(ARG(fileName));
-        emit fileNameChanged(fileName);
-    }
-}
-
-
-quint64 Transfer::fileSize() const
-{
-    return _fileSize;
-}
-
-
-void Transfer::setFileSize(quint64 fileSize)
-{
-    if (_fileSize != fileSize) {
-        _fileSize = fileSize;
-        SYNC(ARG(fileSize));
-        emit fileSizeChanged(fileSize);
-    }
-}
-
-
-QString Transfer::nick() const
-{
-    return _nick;
-}
-
-
-void Transfer::setNick(const QString &nick)
-{
-    if (_nick != nick) {
-        _nick = nick;
-        SYNC(ARG(nick));
-        emit nickChanged(nick);
-    }
-}
-
-
-void Transfer::setError(const QString &errorString)
-{
-    qWarning() << Q_FUNC_INFO << errorString;
-    emit error(errorString);
-    setState(Failed);
-    cleanUp();
-}
diff --git a/src/common/transfer.h b/src/common/transfer.h
deleted file mode 100644 (file)
index 31421cd..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef TRANSFER_H
-#define TRANSFER_H
-
-#include <QHostAddress>
-#include <QUuid>
-
-#include "syncableobject.h"
-#include "types.h"
-
-class Transfer : public SyncableObject
-{
-    Q_OBJECT
-    SYNCABLE_OBJECT
-
-    Q_PROPERTY(QUuid uuid READ uuid);
-    Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged);
-    Q_PROPERTY(Direction direction READ direction WRITE setDirection NOTIFY directionChanged);
-    Q_PROPERTY(QHostAddress address READ address WRITE setAddress NOTIFY addressChanged);
-    Q_PROPERTY(quint16 port READ port WRITE setPort NOTIFY portChanged);
-    Q_PROPERTY(QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged);
-    Q_PROPERTY(quint64 fileSize READ fileSize WRITE setFileSize NOTIFY fileSizeChanged);
-    Q_PROPERTY(QString nick READ nick WRITE setNick NOTIFY nickChanged);
-
-public:
-    enum State {
-        New,
-        Pending,
-        Connecting,
-        Transferring,
-        Paused,
-        Completed,
-        Failed,
-        Rejected
-    };
-    Q_ENUMS(State)
-
-    enum Direction {
-        Send,
-        Receive
-    };
-    Q_ENUMS(Direction)
-
-    Transfer(const QUuid &uuid, QObject *parent = 0); // for creating a syncable object client-side
-    Transfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = 0);
-    inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
-
-    QUuid uuid() const;
-    State state() const;
-    Direction direction() const;
-    QString fileName() const;
-    QHostAddress address() const;
-    quint16 port() const;
-    quint64 fileSize() const;
-    QString nick() const;
-
-public slots:
-    // called on the client side
-    virtual void accept(const QString &savePath) const { Q_UNUSED(savePath); }
-    virtual void reject() const {}
-
-    // called on the core side through sync calls
-    virtual void requestAccepted(PeerPtr peer) { Q_UNUSED(peer); }
-    virtual void requestRejected(PeerPtr peer) { Q_UNUSED(peer); }
-
-signals:
-    void stateChanged(State state);
-    void directionChanged(Direction direction);
-    void addressChanged(const QHostAddress &address);
-    void portChanged(quint16 port);
-    void fileNameChanged(const QString &fileName);
-    void fileSizeChanged(quint64 fileSize);
-    void nickChanged(const QString &nick);
-
-    void error(const QString &errorString);
-
-    void accepted(PeerPtr peer = 0) const;
-    void rejected(PeerPtr peer = 0) const;
-
-protected slots:
-    void setState(State state);
-    void setError(const QString &errorString);
-
-    // called on the client side through sync calls
-    virtual void dataReceived(PeerPtr, const QByteArray &data) { Q_UNUSED(data); }
-
-    virtual void cleanUp() = 0;
-
-private:
-    void init();
-
-    void setDirection(Direction direction);
-    void setAddress(const QHostAddress &address);
-    void setPort(quint16 port);
-    void setFileName(const QString &fileName);
-    void setFileSize(quint64 fileSize);
-    void setNick(const QString &nick);
-
-
-    State _state;
-    Direction _direction;
-    QString _fileName;
-    QHostAddress _address;
-    quint16 _port;
-    quint64 _fileSize;
-    QString _nick;
-    QUuid _uuid;
-};
-
-#endif
diff --git a/src/common/transfermanager.cpp b/src/common/transfermanager.cpp
deleted file mode 100644 (file)
index 257f4b2..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#include "transfermanager.h"
-
-#include "transfer.h"
-
-
-INIT_SYNCABLE_OBJECT(TransferManager)
-TransferManager::TransferManager(QObject *parent)
-    : SyncableObject(parent)
-{
-
-}
-
-
-Transfer *TransferManager::transfer_(const QUuid &uuid) const
-{
-    return _transfers.value(uuid, 0);
-}
-
-
-QList<QUuid> TransferManager::transferIds() const
-{
-    return _transfers.keys();
-}
-
-
-void TransferManager::addTransfer(Transfer *transfer)
-{
-    QUuid uuid = transfer->uuid();
-    if (_transfers.contains(uuid)) {
-        qWarning() << "Cannot add the same file transfer twice!";
-        transfer->deleteLater();
-        return;
-    }
-    transfer->setParent(this);
-    _transfers[uuid] = transfer;
-
-    SYNC_OTHER(onCoreTransferAdded, ARG(uuid));
-    emit transferAdded(transfer);
-}
diff --git a/src/common/transfermanager.h b/src/common/transfermanager.h
deleted file mode 100644 (file)
index d2a888b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef TRANSFERMANAGER_H
-#define TRANSFERMANAGER_H
-
-#include "syncableobject.h"
-
-#include <QUuid>
-
-class Transfer;
-
-class TransferManager : public SyncableObject
-{
-    Q_OBJECT
-    SYNCABLE_OBJECT
-
-public:
-    TransferManager(QObject *parent = 0);
-    inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
-
-    QList<QUuid> transferIds() const;
-
-signals:
-    void transferAdded(const Transfer *transfer);
-
-protected:
-    Transfer *transfer_(const QUuid &uuid) const;
-    void addTransfer(Transfer *transfer);
-
-protected slots:
-    virtual void onCoreTransferAdded(const QUuid &uuid) { Q_UNUSED(uuid) };
-
-private:
-    QHash<QUuid, Transfer *> _transfers;
-
-};
-
-#endif
index dfb0289..42dac8f 100644 (file)
@@ -24,8 +24,6 @@ set(SOURCES
     coresession.cpp
     coresessioneventprocessor.cpp
     coresettings.cpp
-    coretransfer.cpp
-    coretransfermanager.cpp
     coreuserinputhandler.cpp
     coreusersettings.cpp
     ctcpparser.cpp
@@ -60,8 +58,6 @@ set(MOC_HDRS
     corenetworkconfig.h
     coresession.h
     coresessioneventprocessor.h
-    coretransfer.h
-    coretransfermanager.h
     coreuserinputhandler.h
     ctcpparser.h
     eventstringifier.h
index d28ddfb..bd09d43 100644 (file)
@@ -34,7 +34,6 @@
 #include "corenetwork.h"
 #include "corenetworkconfig.h"
 #include "coresessioneventprocessor.h"
-#include "coretransfermanager.h"
 #include "coreusersettings.h"
 #include "ctcpparser.h"
 #include "eventstringifier.h"
@@ -67,7 +66,6 @@ CoreSession::CoreSession(UserId uid, bool restoreState, QObject *parent)
     _ircListHelper(new CoreIrcListHelper(this)),
     _networkConfig(new CoreNetworkConfig("GlobalNetworkConfig", this)),
     _coreInfo(this),
-    _transferManager(new CoreTransferManager(this)),
     _eventManager(new CoreEventManager(this)),
     _eventStringifier(new EventStringifier(this)),
     _sessionEventProcessor(new CoreSessionEventProcessor(this)),
@@ -122,7 +120,6 @@ CoreSession::CoreSession(UserId uid, bool restoreState, QObject *parent)
     p->synchronize(networkConfig());
     p->synchronize(&_coreInfo);
     p->synchronize(&_ignoreListManager);
-    p->synchronize(transferManager());
     // Restore session state
     if (restoreState)
         restoreSessionState();
index ade372a..810d772 100644 (file)
@@ -39,7 +39,6 @@ class CoreIrcListHelper;
 class CoreNetwork;
 class CoreNetworkConfig;
 class CoreSessionEventProcessor;
-class CoreTransferManager;
 class CtcpParser;
 class EventManager;
 class EventStringifier;
@@ -86,8 +85,6 @@ public:
     inline CoreIrcListHelper *ircListHelper() const { return _ircListHelper; }
 
     inline CoreIgnoreListManager *ignoreListManager() { return &_ignoreListManager; }
-    inline CoreTransferManager *transferManager() const { return _transferManager; }
-
 //   void attachNetworkConnection(NetworkConnection *conn);
 
     //! Return necessary data for restoring the session after restarting the core
@@ -202,7 +199,6 @@ private:
     CoreIrcListHelper *_ircListHelper;
     CoreNetworkConfig *_networkConfig;
     CoreCoreInfo _coreInfo;
-    CoreTransferManager *_transferManager;
 
     EventManager *_eventManager;
     EventStringifier *_eventStringifier; // should eventually move into client
index 9a00537..e31c20d 100644 (file)
 #include "coreirclisthelper.h"
 #include "corenetwork.h"
 #include "coresession.h"
-#include "coretransfer.h"
-#include "coretransfermanager.h"
 #include "ctcpevent.h"
 #include "ircevent.h"
 #include "ircuser.h"
-#include "logger.h"
 #include "messageevent.h"
 #include "netsplit.h"
 #include "quassel.h"
@@ -1017,67 +1014,6 @@ void CoreSessionEventProcessor::handleCtcpClientinfo(CtcpEvent *e)
 }
 
 
-// http://www.irchelp.org/irchelp/rfc/ctcpspec.html
-// http://en.wikipedia.org/wiki/Direct_Client-to-Client
-void CoreSessionEventProcessor::handleCtcpDcc(CtcpEvent *e)
-{
-    // DCC support is unfinished, experimental and potentially dangerous, so make it opt-in
-    if (!Quassel::isOptionSet("enable-experimental-dcc")) {
-        quInfo() << "DCC disabled, start core with --enable-experimental-dcc if you really want to try it out";
-        return;
-    }
-
-    // normal:  SEND <filename> <ip> <port> [<filesize>]
-    // reverse: SEND <filename> <ip> 0 <filesize> <token>
-    QStringList params = e->param().split(' ');
-    if (params.count()) {
-        QString cmd = params[0].toUpper();
-        if (cmd == "SEND") {
-            if (params.count() < 4) {
-                qWarning() << "Invalid DCC SEND request:" << e;  // TODO emit proper error to client
-                return;
-            }
-            QString filename = params[1];
-            QHostAddress address;
-            quint16 port = params[3].toUShort();
-            quint64 size = 0;
-            QString numIp = params[2]; // this is either IPv4 as a 32 bit value, or IPv6 (which always contains a colon)
-            if (numIp.contains(':')) { // IPv6
-                if (!address.setAddress(numIp)) {
-                    qWarning() << "Invalid IPv6:" << numIp;
-                    return;
-                }
-            }
-            else {
-                address.setAddress(numIp.toUInt());
-            }
-
-            if (port == 0) { // Reverse DCC is indicated by a 0 port
-                emit newEvent(new MessageEvent(Message::Error, e->network(), tr("Reverse DCC SEND not supported"), e->prefix(), e->target(), Message::None, e->timestamp()));
-                return;
-            }
-            if (port < 1024) {
-                qWarning() << "Privileged port requested:" << port; // FIXME ask user if this is ok
-            }
-
-
-            if (params.count() > 4) { // filesize is optional
-                size = params[4].toULong();
-            }
-
-            // TODO: check if target is the right thing to use for the partner
-            CoreTransfer *transfer = new CoreTransfer(Transfer::Receive, e->target(), filename, address, port, size, this);
-            coreSession()->signalProxy()->synchronize(transfer);
-            coreSession()->transferManager()->addTransfer(transfer);
-        }
-        else {
-            emit newEvent(new MessageEvent(Message::Error, e->network(), tr("DCC %1 not supported").arg(cmd), e->prefix(), e->target(), Message::None, e->timestamp()));
-            return;
-        }
-    }
-}
-
-
 void CoreSessionEventProcessor::handleCtcpPing(CtcpEvent *e)
 {
     e->setReply(e->param().isNull() ? "" : e->param());
index 47acf08..6854d18 100644 (file)
@@ -97,7 +97,6 @@ public:
 
     Q_INVOKABLE void handleCtcpAction(CtcpEvent *event);
     Q_INVOKABLE void handleCtcpClientinfo(CtcpEvent *event);
-    Q_INVOKABLE void handleCtcpDcc(CtcpEvent *event);
     Q_INVOKABLE void handleCtcpPing(CtcpEvent *event);
     Q_INVOKABLE void handleCtcpTime(CtcpEvent *event);
     Q_INVOKABLE void handleCtcpVersion(CtcpEvent *event);
diff --git a/src/core/coretransfer.cpp b/src/core/coretransfer.cpp
deleted file mode 100644 (file)
index 830c151..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#include <QtEndian>
-
-#include <QCoreApplication>
-#include <QTcpSocket>
-
-#include "coretransfer.h"
-
-const qint64 chunkSize = 16 * 1024;
-
-INIT_SYNCABLE_OBJECT(CoreTransfer)
-
-CoreTransfer::CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 fileSize, QObject *parent)
-    : Transfer(direction, nick, fileName, address, port, fileSize, parent),
-    _socket(0),
-    _pos(0),
-    _reading(false)
-{
-
-}
-
-
-void CoreTransfer::cleanUp()
-{
-    if (_socket) {
-        _socket->close();
-        _socket->deleteLater();
-        _socket = 0;
-    }
-
-    _buffer.clear();
-    _reading = false;
-}
-
-
-void CoreTransfer::onSocketDisconnected()
-{
-    if (state() == Connecting || state() == Transferring) {
-        setError(tr("Socket closed while still transferring!"));
-    }
-    else
-        cleanUp();
-}
-
-
-void CoreTransfer::onSocketError(QAbstractSocket::SocketError error)
-{
-    Q_UNUSED(error)
-
-    if (state() == Connecting || state() == Transferring) {
-        setError(tr("DCC connection error: %1").arg(_socket->errorString()));
-    }
-}
-
-
-void CoreTransfer::requestAccepted(PeerPtr peer)
-{
-    if (_peer || !peer || state() != New)
-        return; // transfer was already accepted
-
-    _peer = peer;
-    setState(Pending);
-
-    emit accepted(peer);
-
-    // FIXME temporary until we have queueing
-    start();
-}
-
-
-void CoreTransfer::requestRejected(PeerPtr peer)
-{
-    if (_peer || state() != New)
-        return;
-
-    _peer = peer;
-    setState(Rejected);
-
-    emit rejected(peer);
-}
-
-
-void CoreTransfer::start()
-{
-    if (!_peer || state() != Pending || direction() != Receive)
-        return;
-
-    setupConnectionForReceive();
-}
-
-
-void CoreTransfer::setupConnectionForReceive()
-{
-    if (port() == 0) {
-        setError(tr("Reverse DCC not supported yet!"));
-        return;
-    }
-
-    setState(Connecting);
-
-    _socket = new QTcpSocket(this);
-    connect(_socket, SIGNAL(connected()), SLOT(startReceiving()));
-    connect(_socket, SIGNAL(disconnected()), SLOT(onSocketDisconnected()));
-    connect(_socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(onSocketError(QAbstractSocket::SocketError)));
-    connect(_socket, SIGNAL(readyRead()), SLOT(onDataReceived()));
-
-    _socket->connectToHost(address(), port());
-}
-
-
-void CoreTransfer::startReceiving()
-{
-    setState(Transferring);
-}
-
-
-void CoreTransfer::onDataReceived()
-{
-    if (_reading) // since we're spinning the event loop, we may get another readyRead() and thus reentrancy
-        return;
-    _reading = true;
-
-    while (_socket->bytesAvailable()) {
-        QByteArray data = _socket->read(chunkSize);
-        _pos += data.size();
-        if (!relayData(data, true))
-            return;
-
-        QCoreApplication::processEvents();  // don't block the rest of the core/client communication
-        if (!_socket)  // just in case something happened during spinning the event loop that killed our socket
-            return;
-    }
-
-    // Send ack to sender. The DCC protocol only specifies 32 bit values, but modern clients (i.e. those who can send files
-    // larger than 4 GB) will ignore this anyway...
-    quint32 ack = qToBigEndian((quint32)_pos);// qDebug() << Q_FUNC_INFO << _pos;
-    _socket->write((char *)&ack, 4);
-
-    if (_pos > fileSize()) {
-        qWarning() << "DCC Receive: Got more data than expected!";
-        setError(tr("DCC Receive: Got more data than expected!"));
-    }
-    else if (_pos == fileSize()) {
-        qDebug() << "DCC Receive: Transfer finished";
-        if (relayData(QByteArray(), false)) // empty buffer
-            setState(Completed);
-    }
-
-    _reading = false;
-}
-
-
-bool CoreTransfer::relayData(const QByteArray &data, bool requireChunkSize)
-{
-    // safeguard against a disconnecting quasselclient
-    if (!_peer) {
-        setError(tr("DCC Receive: Quassel Client disconnected during transfer!"));
-        return false;
-    }
-    _buffer.append(data);
-
-    // we only want to send data to the client once we have reached the chunksize
-    if (_buffer.size() > 0 && (_buffer.size() >= chunkSize || !requireChunkSize)) {
-        SYNC_OTHER(dataReceived, ARG(_peer), ARG(_buffer));
-        _buffer.clear();
-    }
-
-    return true;
-}
diff --git a/src/core/coretransfer.h b/src/core/coretransfer.h
deleted file mode 100644 (file)
index 85248e6..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef CORETRANSFER_H
-#define CORETRANSFER_H
-
-#include <QPointer>
-
-#include "transfer.h"
-#include "peer.h"
-
-class QTcpSocket;
-
-class CoreTransfer : public Transfer
-{
-    Q_OBJECT
-    SYNCABLE_OBJECT
-
-public:
-    CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = 0);
-
-public slots:
-    void start();
-
-    // called through sync calls
-    void requestAccepted(PeerPtr peer);
-    void requestRejected(PeerPtr peer);
-
-private slots:
-    void startReceiving();
-    void onDataReceived();
-    void onSocketDisconnected();
-    void onSocketError(QAbstractSocket::SocketError error);
-
-private:
-    void setupConnectionForReceive();
-    bool relayData(const QByteArray &data, bool requireChunkSize);
-    virtual void cleanUp();
-
-    QPointer<Peer> _peer;
-    QTcpSocket *_socket;
-    quint64 _pos;
-    QByteArray _buffer;
-    bool _reading;
-};
-
-#endif
diff --git a/src/core/coretransfermanager.cpp b/src/core/coretransfermanager.cpp
deleted file mode 100644 (file)
index c8f79dd..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#include "coretransfermanager.h"
-
-#include "coretransfer.h"
-
-INIT_SYNCABLE_OBJECT(CoreTransferManager)
-CoreTransferManager::CoreTransferManager(QObject *parent)
-    : TransferManager(parent)
-{
-    connect(this, SIGNAL(transferAdded(const Transfer*)), SLOT(onTransferAdded(const Transfer*)));
-}
-
-
-CoreTransfer *CoreTransferManager::transfer(const QUuid &uuid) const
-{
-    return qobject_cast<CoreTransfer *>(transfer_(uuid));
-}
-
-
-void CoreTransferManager::addTransfer(CoreTransfer *transfer)
-{
-    TransferManager::addTransfer(transfer);
-}
-
-
-void CoreTransferManager::onTransferAdded(const Transfer *transfer)
-{
-    // for core-side use, publishing a non-const pointer is ok
-    CoreTransfer *t = const_cast<CoreTransfer *>(qobject_cast<const CoreTransfer *>(transfer));
-    if (!t) {
-        qWarning() << "Invalid Transfer added to CoreTransferManager!";
-        return;
-    }
-
-    emit transferAdded(t);
-}
diff --git a/src/core/coretransfermanager.h b/src/core/coretransfermanager.h
deleted file mode 100644 (file)
index a01e285..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef CORETRANSFERMANAGER_H
-#define CORETRANSFERMANAGER_H
-
-#include "transfermanager.h"
-#include "types.h"
-
-class CoreTransfer;
-
-class CoreTransferManager : public TransferManager
-{
-    Q_OBJECT
-    SYNCABLE_OBJECT
-
-public:
-    CoreTransferManager(QObject *parent = 0);
-
-    CoreTransfer *transfer(const QUuid &uuid) const;
-
-public slots:
-    void addTransfer(CoreTransfer *transfer);
-
-signals:
-    void transferAdded(CoreTransfer *transfer);
-
-private slots:
-    void onTransferAdded(const Transfer *transfer);
-
-};
-
-#endif
index e649d15..6cb6cdb 100644 (file)
@@ -55,7 +55,6 @@ set(SOURCES
     qtuimessageprocessor.cpp
     qtuisettings.cpp
     qtuistyle.cpp
-    receivefiledlg.cpp
     settingsdlg.cpp
     settingspagedlg.cpp
     simplenetworkeditor.cpp
@@ -102,7 +101,6 @@ set(MOC_HDRS
     qtuiapplication.h
     qtuimessageprocessor.h
     qtuistyle.h
-    receivefiledlg.h
     settingsdlg.h
     settingspagedlg.h
     simplenetworkeditor.h
@@ -142,7 +140,6 @@ set(FORMS
     settingsdlg.ui
     settingspagedlg.ui
     simplenetworkeditor.ui
-    receivefiledlg.ui
     topicwidget.ui)
 
 if(HAVE_KDE)
index 1399113..8e0172d 100644 (file)
@@ -62,8 +62,6 @@
 #include "clientbufferviewconfig.h"
 #include "clientbufferviewmanager.h"
 #include "clientignorelistmanager.h"
-#include "clienttransfer.h"
-#include "clienttransfermanager.h"
 #include "coreconfigwizard.h"
 #include "coreconnectdlg.h"
 #include "coreconnection.h"
@@ -85,7 +83,6 @@
 #include "qtuimessageprocessor.h"
 #include "qtuisettings.h"
 #include "qtuistyle.h"
-#include "receivefiledlg.h"
 #include "settingsdlg.h"
 #include "settingspagedlg.h"
 #include "statusnotifieritem.h"
@@ -1041,8 +1038,6 @@ void MainWin::connectedToCore()
     connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigDeleted(int)), this, SLOT(removeBufferView(int)));
     connect(Client::bufferViewManager(), SIGNAL(initDone()), this, SLOT(loadLayout()));
 
-    connect(Client::transferManager(), SIGNAL(transferAdded(const ClientTransfer*)), SLOT(showNewTransferDlg(const ClientTransfer*)));
-
     setConnectedState();
 }
 
@@ -1379,13 +1374,6 @@ void MainWin::showShortcutsDlg()
 }
 
 
-void MainWin::showNewTransferDlg(const ClientTransfer *transfer)
-{
-    ReceiveFileDlg *dlg = new ReceiveFileDlg(transfer, this);
-    dlg->show();
-}
-
-
 void MainWin::onFullScreenToggled()
 {
     // Relying on QWidget::isFullScreen is discouraged, see the KToggleFullScreenAction docs
index 49e4cef..e1ff7ea 100644 (file)
@@ -36,7 +36,6 @@ class BufferHotListFilter;
 class BufferView;
 class BufferViewConfig;
 class ClientBufferViewConfig;
-class ClientTransfer;
 class CoreAccount;
 class CoreConnectionStatusWidget;
 class BufferViewDock;
@@ -123,7 +122,6 @@ private slots:
     void showNotificationsDlg();
     void showIgnoreList(QString newRule = QString());
     void showShortcutsDlg();
-    void showNewTransferDlg(const ClientTransfer *transfer);
     void onFullScreenToggled();
 
     void handleCoreConnectionError(const QString &errorMsg);
diff --git a/src/qtui/receivefiledlg.cpp b/src/qtui/receivefiledlg.cpp
deleted file mode 100644 (file)
index 3c09f83..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#include <QDir>
-#include <QFileDialog>
-
-#include "receivefiledlg.h"
-
-#include "transfer.h"
-
-ReceiveFileDlg::ReceiveFileDlg(const Transfer *transfer, QWidget *parent)
-    : QDialog(parent),
-    _transfer(transfer)
-{
-    setAttribute(Qt::WA_DeleteOnClose);
-    ui.setupUi(this);
-
-    QString label = tr("<b>%1</b> wants to send you a file:<br>%2 (%3 bytes)").arg(transfer->nick(), transfer->fileName()).arg(transfer->fileSize());
-    ui.infoText->setText(label);
-}
-
-
-void ReceiveFileDlg::on_buttonBox_clicked(QAbstractButton *button)
-{
-    if (ui.buttonBox->standardButton(button) == QDialogButtonBox::Save) {
-        QString name = QFileDialog::getSaveFileName(this, QString(), QDir::currentPath() + "/" + _transfer->fileName());
-        _transfer->accept(name);
-    }
-
-}
diff --git a/src/qtui/receivefiledlg.h b/src/qtui/receivefiledlg.h
deleted file mode 100644 (file)
index 99aa649..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   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.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef RECEIVEFILEDLG_H
-#define RECEIVEFILEDLG_H
-
-#include "ui_receivefiledlg.h"
-
-class Transfer;
-
-class ReceiveFileDlg : public QDialog
-{
-    Q_OBJECT
-
-public:
-    ReceiveFileDlg(const Transfer *transfer, QWidget *parent = 0);
-
-private slots:
-    void on_buttonBox_clicked(QAbstractButton *button);
-
-private:
-    Ui::ReceiveFileDlg ui;
-    const Transfer *_transfer;
-};
-
-#endif
diff --git a/src/qtui/ui/receivefiledlg.ui b/src/qtui/ui/receivefiledlg.ui
deleted file mode 100644 (file)
index 6cc7a4e..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ReceiveFileDlg</class>
- <widget class="QDialog" name="ReceiveFileDlg">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>354</width>
-    <height>97</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Incoming File Transfer</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <widget class="QLabel" name="infoText">
-     <property name="text">
-      <string notr="true">Someone is trying to send you a file.</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Discard|QDialogButtonBox::Ignore|QDialogButtonBox::Save</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>ReceiveFileDlg</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>248</x>
-     <y>254</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>157</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>ReceiveFileDlg</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>316</x>
-     <y>260</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>286</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>