Patch level : 10.0

Files correlati     : ba1.exe
Ricompilazione Demo : [ ]
Commento            :
Migliorata http_get per gestire meglio lista aggiornamenti via web


git-svn-id: svn://10.65.10.50/trunk@17933 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-12-17 14:22:28 +00:00
parent 167b7a9cec
commit 9aac13b466
3 changed files with 16 additions and 6 deletions

View File

@ -2282,7 +2282,7 @@ TButton_tool& TMask::add_button_tool(short id, const char* prompt, short bmpup)
{ {
if (toolbar() == NULL_WIN) // Se non c'e' ancora la toolbar, me l'invento adesso if (toolbar() == NULL_WIN) // Se non c'e' ancora la toolbar, me l'invento adesso
create_bar(1); create_bar(1);
CHECKD(bmpup > 0, "Toolbar button needs a wonderful icon ", id); CHECKD(id <= 0 || bmpup > 0, "Toolbar button needs a wonderful icon ", id);
TButton_tool* t = new TButton_tool(this); TButton_tool* t = new TButton_tool(this);
t->construct(id, prompt, 0, 0, 0, toolbar(), "", 0, bmpup, 0); t->construct(id, prompt, 0, 0, 0, toolbar(), "", 0, bmpup, 0);
add_field(t); add_field(t);

View File

@ -839,7 +839,7 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
ofstream outfile(local, ios::out | ios::binary); ofstream outfile(local, ios::out | ios::binary);
if (outfile.good()) if (outfile.good())
{ {
TString buf(8*1024); TString buf(16*1024);
TToken_string strpi(256, '\n'); TToken_string strpi(256, '\n');
strpi << remote << " - " << bytes2str(size); strpi << remote << " - " << bytes2str(size);
@ -853,6 +853,7 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
{ {
if (size <= buf.size()) // File piccolo: Niente barra di progresso if (size <= buf.size()) // File piccolo: Niente barra di progresso
{ {
TWait_cursor hourglass;
while (total < size && !cur_socket->eof()) while (total < size && !cur_socket->eof())
{ {
const int nchars = min(buf.size(), size - total); const int nchars = min(buf.size(), size - total);
@ -920,9 +921,18 @@ HIDDEN int find_href(const TString& riga, int from, TString& filename)
if (href >= 0) if (href >= 0)
{ {
href += 9; href += 9;
const int quotes = riga.find("\">", href); const int quotes = riga.find('"', href);
filename = riga.sub(href, quotes); if (quotes > 0)
from = quotes+2; {
filename = riga.sub(href, quotes);
from = quotes+1;
}
else
{
filename = riga.mid(href);
from = -1;
}
filename.trim();
if (filename.match("*.*")) if (filename.match("*.*"))
break; break;
} }

View File

@ -1072,7 +1072,7 @@ void TSheet::add_button(
short bmp_up, // @parm Bitmap normale short bmp_up, // @parm Bitmap normale
short bmp_dn) // @parm Bitmap premuta short bmp_dn) // @parm Bitmap premuta
{ {
if (bmp_up <= 0) if (id > 0 && bmp_up <= 0)
{ {
if (toolwin() == NULL_WIN) if (toolwin() == NULL_WIN)
create_bar(-2); // Forza la creazione della bottom bar create_bar(-2); // Forza la creazione della bottom bar