From 9aac13b466010d45741b93c30ed1d4ff3ba8779b Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 17 Dec 2008 14:22:28 +0000 Subject: [PATCH] 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 --- include/mask.cpp | 2 +- include/netsock.cpp | 18 ++++++++++++++---- include/sheet.cpp | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/mask.cpp b/include/mask.cpp index c6a68796e..36ee02237 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -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 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); t->construct(id, prompt, 0, 0, 0, toolbar(), "", 0, bmpup, 0); add_field(t); diff --git a/include/netsock.cpp b/include/netsock.cpp index fef97574f..2f7c1c445 100755 --- a/include/netsock.cpp +++ b/include/netsock.cpp @@ -839,7 +839,7 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local ofstream outfile(local, ios::out | ios::binary); if (outfile.good()) { - TString buf(8*1024); + TString buf(16*1024); TToken_string strpi(256, '\n'); 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 { + TWait_cursor hourglass; while (total < size && !cur_socket->eof()) { 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) { href += 9; - const int quotes = riga.find("\">", href); - filename = riga.sub(href, quotes); - from = quotes+2; + const int quotes = riga.find('"', href); + if (quotes > 0) + { + filename = riga.sub(href, quotes); + from = quotes+1; + } + else + { + filename = riga.mid(href); + from = -1; + } + filename.trim(); if (filename.match("*.*")) break; } diff --git a/include/sheet.cpp b/include/sheet.cpp index 406598ad6..ab38107e7 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -1072,7 +1072,7 @@ void TSheet::add_button( short bmp_up, // @parm Bitmap normale short bmp_dn) // @parm Bitmap premuta { - if (bmp_up <= 0) + if (id > 0 && bmp_up <= 0) { if (toolwin() == NULL_WIN) create_bar(-2); // Forza la creazione della bottom bar