summaryrefslogtreecommitdiff
path: root/noncore/net/ubrowser/httpfactory.cpp
authorspiralman <spiralman>2002-08-03 03:25:31 (UTC)
committer spiralman <spiralman>2002-08-03 03:25:31 (UTC)
commit7d4b246bc728b73e9d38e110619222dd89c1fd1c (patch) (side-by-side diff)
tree7e6fbb8bbb106967993fa786a917fccde43970f3 /noncore/net/ubrowser/httpfactory.cpp
parent4005263f7c64a631f4df9aeece83321ba818160d (diff)
downloadopie-7d4b246bc728b73e9d38e110619222dd89c1fd1c.zip
opie-7d4b246bc728b73e9d38e110619222dd89c1fd1c.tar.gz
opie-7d4b246bc728b73e9d38e110619222dd89c1fd1c.tar.bz2
fixed relative links (except from forward and back buttons), added initial image code (not working), changes to chunked encoding (still not working, might be a qsocket issue)
Diffstat (limited to 'noncore/net/ubrowser/httpfactory.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/ubrowser/httpfactory.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/noncore/net/ubrowser/httpfactory.cpp b/noncore/net/ubrowser/httpfactory.cpp
index 92718fb..50a3c9a 100644
--- a/noncore/net/ubrowser/httpfactory.cpp
+++ b/noncore/net/ubrowser/httpfactory.cpp
@@ -22,6 +22,7 @@ HttpFactory::HttpFactory(QTextBrowser *newBrowser):QMimeSourceFactory()
text = new QTextDrag;
browser=newBrowser;
comm = new HttpComm(socket, browser);
+ image = new QImageDrag;
}
const QMimeSource * HttpFactory::data(const QString &abs_name) const
@@ -30,7 +31,7 @@ const QMimeSource * HttpFactory::data(const QString &abs_name) const
int port=80, addrEnd, portSep;
QString host, file, portS, name, tempString;
- bool done=false;
+ bool done=false, isImage=false;
comm->setUp((QString *)&abs_name);
@@ -46,7 +47,8 @@ const QMimeSource * HttpFactory::data(const QString &abs_name) const
}
else
{
- return 0;
+ name.prepend(browser->context());
+ name = name.remove(0, 7);
}
addrEnd = name.find('/');
@@ -77,14 +79,25 @@ const QMimeSource * HttpFactory::data(const QString &abs_name) const
{
portS="80";
}
+
+ if(file.find(".png", file.length()-4) != -1 || file.find(".gif", file.length()-4) != -1 || file.find(".jpg", file.length()-4) != -1)
+ {
+ isImage=true;
+ }
- comm->setStuff(host, portS, file, text);
+ comm->setStuff(host, portS, file, text, image, isImage);
socket->connectToHost(host, port);
- text->setText("");
-
- return text;
+ if(!image)
+ {
+ text->setText("");
+ return text;
+ }
+ else
+ {
+ return image;
+ }
}
const QMimeSource * HttpFactory::data(const QString &abs_or_rel_name, const QString & context) const