update std funtions to qt's
This commit is contained in:
parent
d59da2ca0c
commit
1520f25b2a
2 changed files with 276 additions and 280 deletions
|
@ -116,24 +116,21 @@ int Page::stitchText(QString &from, QString &to, int index)
|
|||
QString dateline = from.mid(index,from.indexOf("</b>",index+4)-index);
|
||||
QString temp;
|
||||
QString date;
|
||||
char* tok;
|
||||
QStringList holder = dateline.split("<> :");
|
||||
QStringList::iterator iterator;
|
||||
int i = 0;
|
||||
char* textToTok = strdup(dateline.toStdString().c_str());
|
||||
tok = strtok(textToTok,"<> :");
|
||||
while (tok != NULL)
|
||||
for (iterator = holder.begin(); iterator != holder.end(); ++iterator)
|
||||
{
|
||||
if (i == 1)
|
||||
temp = (*iterator);
|
||||
if (i == 0)
|
||||
{
|
||||
temp = tok;
|
||||
date += temp + "\t";
|
||||
}
|
||||
else if (i == 3)
|
||||
{
|
||||
temp = tok;
|
||||
date += temp;
|
||||
}
|
||||
i++;
|
||||
tok = strtok(NULL, "<> :");
|
||||
}
|
||||
dateHeader = date;
|
||||
if (bTag != "<b>")
|
||||
|
|
|
@ -53,11 +53,11 @@ int jceLogin::makeConnection()
|
|||
returnMode = makeFirstVisit();
|
||||
if (returnMode == (int)true) //requst and send first validation
|
||||
{
|
||||
status = jceStatus::JCE_START_VALIDATING_PROGRESS;
|
||||
// status = jceStatus::JCE_START_VALIDATING_PROGRESS;
|
||||
returnMode = checkValidation();
|
||||
if (returnMode == (int)true) //check if username and password are matching
|
||||
{
|
||||
status = jceStatus::JCE_VALIDATION_PASSED;
|
||||
// status = jceStatus::JCE_VALIDATION_PASSED;
|
||||
returnMode = makeSecondVisit();
|
||||
if (returnMode == (int)true) //siging in the website
|
||||
{
|
||||
|
@ -251,28 +251,27 @@ bool jceLogin::checkValidation()
|
|||
QString constUserID_TAG = "value=\"-N";
|
||||
QString constHassID_TAG = "-A,-N";
|
||||
QString hasspass,hassid;
|
||||
std::size_t hasspass_position1,hasspass_position2;
|
||||
std::size_t id_position1,id_position2;
|
||||
|
||||
hasspass_position1 = this->recieverPage->toStdString().find(constHassID_TAG.toStdString()); //looking for hasspass index
|
||||
if (hasspass_position1 == std::string::npos) //didnt find the tag
|
||||
int hasspass_position1,hasspass_position2;
|
||||
int id_position1,id_position2;
|
||||
hasspass_position1 = this->recieverPage->indexOf(constHassID_TAG); //looking for hasspass index
|
||||
if (hasspass_position1 == -1) //didnt find the tag
|
||||
return false;
|
||||
else
|
||||
hasspass_position1 += constHassID_TAG.length(); //skip the index of tag
|
||||
hasspass_position2 = this->recieverPage->toStdString().find(",-A,-A", hasspass_position1);
|
||||
hasspass_position2 = this->recieverPage->indexOf(",-A,-A", hasspass_position1);
|
||||
//finds the hass pass
|
||||
if (hasspass_position2 != std::string::npos) //found the hasspass! storing it
|
||||
if (hasspass_position2 != -1) //found the hasspass! storing it
|
||||
hasspass = recieverPage->mid(hasspass_position1,hasspass_position2-hasspass_position1);
|
||||
else
|
||||
return false;
|
||||
//finds the user id
|
||||
id_position1 = this->recieverPage->toStdString().find(constUserID_TAG.toStdString(), 0); //looking for hassid index
|
||||
if (id_position1 == std::string::npos) //didnt find the tag
|
||||
id_position1 = this->recieverPage->indexOf(constUserID_TAG, 0); //looking for hassid index
|
||||
if (id_position1 == -1) //didnt find the tag
|
||||
return false;
|
||||
else
|
||||
id_position1 += constUserID_TAG.length(); //skip the index of tag
|
||||
id_position2 = this->recieverPage->toStdString().find(",-A", id_position1);
|
||||
if (id_position2 != std::string::npos) //found the hassid! storing it
|
||||
id_position2 = this->recieverPage->indexOf(",-A", id_position1);
|
||||
if (id_position2 != -1) //found the hassid! storing it
|
||||
hassid = recieverPage->mid(id_position1,id_position2-id_position1);
|
||||
else
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue