void eBibleMainWindow::downloadDone(int err)
{
// set the flag that indicates that download is complete
if(!downloadDoneFlag)
{ downloadDoneFlag = 1;
// create a buffer to read the temp file with download data.
char buf[512];
// declare the variables we will use in this function
eString strview, strview1;
// open temporary file cotaining the downloaded data
if (f)
{
//Add an introduction text
strview = "Congratulation... your code is actived...\n Your Account Will be Expire in : ";
// find the line we want (The mkportal definition in the wiki page we downloaded)
while (fgets(buf, 512, f))
{
if (strstr(buf, "is a free Portal"))
break;
}
// store this line in the variable
strview1 = eString(buf);
// remove html tags
strview1 = removeTags(strview1);
// concate strings to compose our output text
strview += strview1;
// read the next lines .....
while (fgets(buf, 512, f))
{
// if we found this string the defnition is ended so we can stop to read the file
if (strstr(buf, "See also"))
break;
// else store the line in the variable
strview1 = eString(buf);
// remove html tags
strview1 = removeTags(strview1);
// concate strings to compose our output text
strview += strview1;
}
// close file
fclose(f);
}
//Delete the temporary file we used to store downloaded data
//::unlink("/var/tmp/bdemo.sh");
// Hide label to change the text
label->hide();
// Insert into the label the output we have stored in the variable strview
label->setText(strview);
// Show the label with the new text
label->show();
// hide the connection button
ok->hide();
// set the flag that indicates we are not in download state anymore
inDownloadFlag = 0;
}
}
the problem is bdemo.sh does not writen and no message or lines appear