Diffstat (limited to 'noncore/apps/opie-reader/CHM.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CHM.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/CHM.cpp b/noncore/apps/opie-reader/CHM.cpp index 88d53bf..ace5abc 100644 --- a/noncore/apps/opie-reader/CHM.cpp +++ b/noncore/apps/opie-reader/CHM.cpp @@ -4,8 +4,11 @@ #include <qstringlist.h> #include <stdio.h> #include <qimage.h> #include <qpixmap.h> +#ifdef USEQPE +#include <qpe/global.h> +#endif #ifndef __STATIC extern "C" { @@ -65,11 +68,15 @@ void CHM::unsuspend() { { bSuspended = false; int delay = time(NULL) - sustime; if (delay < 10)
+ { + Global::statusMessage("Stalling"); sleep(10-delay);
+ } chmFile = chm_open(fname); for (int i = 0; chmFile == NULL && i < 5; i++) { + Global::statusMessage("Stalling"); sleep(5); chmFile = chm_open(fname); } if (chmFile == NULL) { @@ -85,8 +92,9 @@ void CHM::addContent(QString content) { chmBuffer += content; } void CHM::FillHomeContent() { +unsuspend(); if (chmHHCPath != "") { const char *ext; char buffer[65536]; unsigned int swath, offset; @@ -161,8 +169,9 @@ void CHM::FillHomeContent() { } bool CHM::FillBuffer() { +unsuspend(); bool bRetVal = false; char buffer[65536]; int swath, offset; chmBuffer = ""; @@ -195,8 +204,9 @@ bool CHM::FillBuffer() return bRetVal; } bool CHM::FillContent() { +unsuspend(); bool bRetVal = false; if (chmPath != "") { /* try to find the file */ const char *filename = (const char *)chmPath; @@ -238,9 +248,10 @@ bool CHM::FillContent() { } return bRetVal; } -bool CHM::getFile(const QString& href) { +bool CHM::getFile(const QString& _href, const QString& ) { + QString href = "/" + _href; qDebug("Got:%s", (const char*)href); bool bRetVal = false; QString temp = chmPath; chmPath = href; |