AssistantSocket Class Reference

Inheritance diagram for AssistantSocket:

Inheritance graph
[legend]
Collaboration diagram for AssistantSocket:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 75 of file main.cpp.

Signals

void showLinkRequest (const QString &)

Public Member Functions

 AssistantSocket (int sock, QObject *parent=0)
 ~AssistantSocket ()

Private Slots

void readClient ()
void connectionClosed ()


Constructor & Destructor Documentation

AssistantSocket::AssistantSocket ( int  sock,
QObject parent = 0 
)

Definition at line 109 of file main.cpp.

References QObject::connect(), connectionClosed(), QAbstractSocket::disconnected(), readClient(), QIODevice::readyRead(), QAbstractSocket::setSocketDescriptor(), SIGNAL, and SLOT.

00110     : QTcpSocket( parent )
00111 {
00112     connect( this, SIGNAL(readyRead()), SLOT(readClient()) );
00113     connect( this, SIGNAL(disconnected()), SLOT(connectionClosed()) );
00114     setSocketDescriptor( sock );
00115 }

Here is the call graph for this function:

AssistantSocket::~AssistantSocket (  )  [inline]

Definition at line 80 of file main.cpp.

00080 {}


Member Function Documentation

void AssistantSocket::showLinkRequest ( const QString  )  [signal]

Referenced by readClient().

void AssistantSocket::readClient (  )  [private, slot]

Definition at line 117 of file main.cpp.

References QFileInfo::absoluteFilePath(), QAbstractSocket::canReadLine(), emit, QString::isNull(), QIODevice::readLine(), QString::replace(), and showLinkRequest().

Referenced by AssistantSocket().

00118 {
00119     QString link = QString();
00120     while ( canReadLine() )
00121         link = readLine();
00122     if ( !link.isNull() ) {
00123         link = link.replace(QLatin1String("\n"), QLatin1String(""));
00124         link = link.replace(QLatin1String("\r"), QLatin1String(""));
00125         QFileInfo fi(link);
00126         link = fi.absoluteFilePath();
00127         emit showLinkRequest( link );
00128     }
00129 }

void AssistantSocket::connectionClosed (  )  [private, slot]

Definition at line 131 of file main.cpp.

References QObject::deleteLater().

Referenced by AssistantSocket().

00132 {
00133     deleteLater();
00134 }


The documentation for this class was generated from the following file:
Generated on Thu Mar 15 14:44:49 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1