X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Client%2Fhttpclient.cpp;h=e43f76179339160940c2b48c5362c2ddec7bb581;hp=d5049fd50a8adfb1445b7860b31ec861c074d58a;hb=28d7fdcbf1646f7b175907bf79718d7495ee7935;hpb=e5d88e68d49f961be9edd1ee1a390c6b0fb88094 diff --git a/Client/httpclient.cpp b/Client/httpclient.cpp index d5049fd..e43f761 100644 --- a/Client/httpclient.cpp +++ b/Client/httpclient.cpp @@ -636,12 +636,27 @@ void HttpClient::ackOfUserInfo() file.close();*/ QNetworkReply* reply = qobject_cast(sender()); - myXmlreader->xmlReadUserInfo(reply); + //myXmlreader->xmlReadUserInfo(reply); //for(int i = 0; i < myXmlreader->usersList->count(); i++) //{ // myMainw->settingsDialog->sendUsernameToUsersDialog(myXmlreader->usersList->at(i)); //} + QNetworkReply::NetworkError errorcode; + errorcode = reply->error(); + if(errorcode != 0) { + qDebug() << "errorcode:" << errorcode << reply->errorString(); + //QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories",reply->errorString()); + if(myMainw->usersDialog) + myMainw->usersDialog->setLabelInfoToUser("You're not logged! Please register or log in."); + } + else { + myXmlreader->xmlReadUserInfo(reply); + qDebug() << "errorcode:" << errorcode << reply->errorString(); + //QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories ", "OK"); + if(myMainw->usersDialog) + myMainw->usersDialog->setLabelInfoToUser(""); + } } /** @@ -668,8 +683,8 @@ void HttpClient::requestUsers() //connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError))); //Indicating user - //if(myMainw->topResultDialog) - //myMainw->topResultDialog->setLabelInfoToUser("Reguesting categories from server"); + if(myMainw->usersDialog) + myMainw->usersDialog->setLabelInfoToUser("Reguesting users from server"); //ackOfUsers(); } @@ -703,26 +718,27 @@ void HttpClient::ackOfUsers() // myMainw->topResultDialog->setLabelInfoToUser(""); QNetworkReply* reply = qobject_cast(sender()); - myXmlreader->xmlReadUsers(reply); + //myXmlreader->xmlReadUsers(reply); - for(int i = 0; i < myXmlreader->usersList->count(); i++) - { - myMainw->usersDialog->appendUserToList(myXmlreader->usersList->at(i)); - } - /* QNetworkReply::NetworkError errorcode; + QNetworkReply::NetworkError errorcode; errorcode = reply->error(); if(errorcode != 0) { qDebug() << "errorcode:" << errorcode << reply->errorString(); //QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories",reply->errorString()); - if(myMainw->topResultDialog) - myMainw->topResultDialog->setLabelInfoToUser("You're not logged! Please register or log in."); + if(myMainw->usersDialog) + myMainw->usersDialog->setLabelInfoToUser("You're not logged! Please register or log in."); } else { + myXmlreader->xmlReadUsers(reply); qDebug() << "errorcode:" << errorcode << reply->errorString(); //QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories ", "OK"); - if(myMainw->topResultDialog) - myMainw->topResultDialog->setLabelInfoToUser(""); - }*/ + if(myMainw->usersDialog) + myMainw->usersDialog->setLabelInfoToUser(""); + for(int i = 0; i < myXmlreader->usersList->count(); i++) + { + myMainw->usersDialog->appendUserToList(myXmlreader->usersList->at(i)); + } + } } /**