From: APTX Date: Thu, 12 Jan 2012 19:41:41 +0000 (+0100) Subject: Obtain lid from FILE_ALREADY_IN_MYLIST. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=362c70774f35bdac242fb26c2c5e3594293e1d0c;p=anidbudpclient.git Obtain lid from FILE_ALREADY_IN_MYLIST. --- diff --git a/mylistaddcommand.cpp b/mylistaddcommand.cpp index 34ef9bd..cd15b63 100644 --- a/mylistaddcommand.cpp +++ b/mylistaddcommand.cpp @@ -212,9 +212,16 @@ void MyListAddReply::setRawReply(ReplyCode replyCode, const QString &reply) } break; case MYLIST_ENTRY_EDITED: - case FILE_ALREADY_IN_MYLIST: signalReplyReady(true); break; + case FILE_ALREADY_IN_MYLIST: + { + // Apparently the lid is sent back with some other data, but it is not mentioned in the docs. + QStringList data = reply.mid(reply.indexOf('\n')).trimmed().split(QChar('|')); + if (data.count() > 1) + m_lid = data[0].toInt(); + signalReplyReady(true); + } case NO_SUCH_MYLIST_ENTRY: case NO_SUCH_FILE: case NO_SUCH_ANIME: