Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FileTransfer Class Reference

#include </home/clem/local/src/opie/noncore/apps/opie-console/filetransfer.h>

Inheritance diagram for FileTransfer:

Inheritance graph
[legend]
Collaboration diagram for FileTransfer:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Type { SZ = 0, SX, SY }

Public Member Functions

 FileTransfer (Type t, IOLayer *)
 ~FileTransfer ()
void sendFile (const QString &file)
void sendFile (const QFile &)
void cancel ()

Private Slots

void setupChild ()
void slotRead ()
void slotProgress (const QStringList &)
void slotExec ()

Private Attributes

Type m_type
pid_t m_pid
int m_fd
int m_prog
int m_info [2]
int m_comm [2]
int m_term [2]
QString m_file
QSocketNotifier * m_not
QSocketNotifier * m_proc

Friends

class FileTransferControl

Member Enumeration Documentation

enum FileTransfer::Type
 

Enumeration values:
SZ 
SX 
SY 

Definition at line 19 of file filetransfer.h.


Constructor & Destructor Documentation

FileTransfer::FileTransfer Type  t,
IOLayer
 

Definition at line 13 of file filetransfer.cpp.

References l, m_not, m_pid, and m_proc.

FileTransfer::~FileTransfer  ) 
 

Definition at line 21 of file filetransfer.cpp.


Member Function Documentation

void FileTransfer::cancel  )  [virtual]
 

Implements FileTransferLayer.

Definition at line 231 of file filetransfer.cpp.

References m_pid.

void FileTransfer::sendFile const QFile  )  [virtual]
 

Implements FileTransferLayer.

Definition at line 124 of file filetransfer.cpp.

References QFile::name(), and sendFile().

void FileTransfer::sendFile const QString file  )  [virtual]
 

now we will send the file.

we request an fd. The IOLayer should be closed then we will setup a pipe for progress communication then we will dup2 the m_fd in the forked process to do direct IO from and to the fd

Implements FileTransferLayer.

Definition at line 32 of file filetransfer.cpp.

References FileTransferLayer::error(), QString::latin1(), FileTransferLayer::layer(), len, m_comm, m_fd, m_file, m_info, m_not, m_pid, m_proc, m_prog, m_term, m_type, NULL, ProcCtl::self(), setupChild(), slotExec(), slotRead(), FileTransferLayer::StartError, SX, SY, SZ, tr, verbose, and write().

Referenced by sendFile(), and SenderUI::slotSendFile().

void FileTransfer::setupChild  )  [private, slot]
 

Definition at line 132 of file filetransfer.cpp.

References m_comm, m_fd, and m_info.

Referenced by sendFile().

void FileTransfer::slotExec  )  [private, slot]
 

Definition at line 235 of file filetransfer.cpp.

References buf, l, FileTransferLayer::layer(), m_comm, m_fd, m_not, m_pid, m_proc, m_term, and FileTransferLayer::sent().

Referenced by sendFile().

void FileTransfer::slotProgress const QStringList  )  [private, slot]
 

Definition at line 188 of file filetransfer.cpp.

References m_file, m_prog, m_type, min, FileTransferLayer::progress(), FileTransferLayer::sent(), QStringList::split(), and SZ.

Referenced by slotRead().

void FileTransfer::slotRead  )  [private, slot]
 

Definition at line 163 of file filetransfer.cpp.

References i, len, m_comm, slotProgress(), QStringList::split(), and str.

Referenced by sendFile().


Friends And Related Function Documentation

friend class FileTransferControl [friend]
 

Definition at line 16 of file filetransfer.h.


Member Data Documentation

int FileTransfer::m_comm[2] [private]
 

Definition at line 42 of file filetransfer.h.

Referenced by sendFile(), setupChild(), slotExec(), and slotRead().

int FileTransfer::m_fd [private]
 

Definition at line 39 of file filetransfer.h.

Referenced by sendFile(), setupChild(), and slotExec().

QString FileTransfer::m_file [private]
 

Definition at line 44 of file filetransfer.h.

Referenced by sendFile(), and slotProgress().

int FileTransfer::m_info[2] [private]
 

Definition at line 41 of file filetransfer.h.

Referenced by sendFile(), and setupChild().

QSocketNotifier* FileTransfer::m_not [private]
 

Definition at line 45 of file filetransfer.h.

Referenced by FileTransfer(), sendFile(), and slotExec().

pid_t FileTransfer::m_pid [private]
 

Definition at line 38 of file filetransfer.h.

Referenced by cancel(), FileTransfer(), sendFile(), and slotExec().

QSocketNotifier* FileTransfer::m_proc [private]
 

Definition at line 46 of file filetransfer.h.

Referenced by FileTransfer(), sendFile(), and slotExec().

int FileTransfer::m_prog [private]
 

Definition at line 40 of file filetransfer.h.

Referenced by sendFile(), and slotProgress().

int FileTransfer::m_term[2] [private]
 

Definition at line 43 of file filetransfer.h.

Referenced by sendFile(), and slotExec().

Type FileTransfer::m_type [private]
 

Definition at line 37 of file filetransfer.h.

Referenced by sendFile(), and slotProgress().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:32:44 2005 for OPIE by  doxygen 1.4.2