]> Some of my projects - anidbudpclient.git/commitdiff
Obtain lid from FILE_ALREADY_IN_MYLIST.
authorAPTX <marek321@gmail.com>
Thu, 12 Jan 2012 19:41:41 +0000 (20:41 +0100)
committerAPTX <marek321@gmail.com>
Thu, 12 Jan 2012 19:41:41 +0000 (20:41 +0100)
mylistaddcommand.cpp

index 34ef9bd6b86967b2f27af89266a7aa4bc912a510..cd15b6367fd3bc7879871e83bb6a181ee61a7035 100644 (file)
@@ -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: