You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ctransferthread.cpp 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /***************************************************************************
  2. * Copyright (C) 2008 by Oliver Groß *
  3. * z.o.gross@gmx.de *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 2 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  19. ***************************************************************************/
  20. #include "ctransferthread.h"
  21. #include "csocketmanager.h"
  22. #include <QTcpServer>
  23. namespace qftrans {
  24. CTransferThread::CTransferThread(QObject * parent) : QThread(parent),
  25. m_SocketManager(NULL) {
  26. }
  27. CTransferThread::~CTransferThread() {
  28. if (m_SocketManager)
  29. m_SocketManager->deleteLater();
  30. /* if (m_Socket)
  31. delete m_Socket;
  32. if (m_Worker)
  33. delete m_Worker;
  34. if (m_Server)
  35. delete m_Server;*/
  36. }
  37. void CTransferThread::run() {
  38. qDebug() << "start transfer thread" << currentThreadId();
  39. m_SocketManager = new CSocketManager();
  40. emit socketManagerReady();
  41. exec();
  42. qDebug() << "exit transfer thread" << currentThreadId();
  43. if (m_SocketManager) {
  44. delete m_SocketManager;
  45. // m_SocketManager->deleteLater();
  46. m_SocketManager = NULL;
  47. }
  48. /* if (m_Worker) {
  49. delete m_Worker;
  50. m_Worker = NULL;
  51. }
  52. if (m_Server) {
  53. delete m_Server;
  54. m_Server = NULL;
  55. }
  56. if (m_Socket) {
  57. delete m_Socket;
  58. m_Socket = NULL;
  59. }*/
  60. // emit connectionChanged(false);
  61. }
  62. }