9#include "cddbplookup.h"
16 CDDBPLookup::CDDBPLookup()
23 CDDBPLookup::~CDDBPLookup()
30 CDDBPLookup::sendHandshake()
34 .
arg( localHostName_ )
36 .
arg( clientVersion() );
38 writeLine( handshake );
42 CDDBPLookup::sendProto()
48 CDDBPLookup::sendQuery()
51 .
arg( trackOffsetListToId() )
52 .
arg( trackOffsetListToString() );
58 CDDBPLookup::sendRead(
const CDDBMatch & match )
60 category_ =
match.first;
61 discid_ =
match.second;
67 writeLine( readRequest );
71 CDDBPLookup::sendQuit()
79 qCDebug(LIBKCDDB) <<
"Disconnect from server...";
87 CDDBPLookup::parseGreeting(
const QString & line )
89 uint serverStatus = statusCode( line );
91 if ( 200 == serverStatus )
93 qCDebug(LIBKCDDB) <<
"Server response: read-only";
96 else if ( 201 == serverStatus )
98 qCDebug(LIBKCDDB) <<
"Server response: read-write";
102 qCDebug(LIBKCDDB) <<
"Server response: bugger off";
110 CDDBPLookup::parseHandshake(
const QString & line )
112 uint serverStatus = statusCode( line );
114 if ( ( 200 != serverStatus ) && ( 402 != serverStatus ) )
116 qCDebug(LIBKCDDB) <<
"Handshake was too tight. Letting go.";
120 qCDebug(LIBKCDDB) <<
"Handshake was warm and firm";
127 CDDBPLookup::writeLine(
const QString & line )
129 if ( !isConnected() )
131 qCDebug(LIBKCDDB) <<
"socket status: " << socket_->state();
135 qCDebug(LIBKCDDB) <<
"WRITE: [" << line <<
"]";
139 return socket_->write( buf );
KSERVICE_EXPORT KService::List query(FilterFunc filterFunc)
KCOREADDONS_EXPORT Result match(QStringView pattern, QStringView str)
QString arg(Args &&... args) const const
QString fromLatin1(QByteArrayView str)
QByteArray toUtf8() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:56:20 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.