Diffstat (limited to 'noncore/apps/opie-reader/CHM.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CHM.cpp | 35 |
1 files changed, 23 insertions, 12 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 @@ -7,2 +7,5 @@ #include <qpixmap.h> +#ifdef USEQPE +#include <qpe/global.h> +#endif @@ -51,3 +54,3 @@ CHM::~CHM() { -void CHM::suspend() {
+void CHM::suspend() { #ifdef USEQPE @@ -57,3 +60,3 @@ void CHM::suspend() { chmFile = NULL; - sustime = time(NULL);
+ sustime = time(NULL); #endif @@ -61,3 +64,3 @@ void CHM::suspend() { -void CHM::unsuspend() {
+void CHM::unsuspend() { #ifdef USEQPE @@ -67,6 +70,10 @@ void CHM::unsuspend() { int delay = time(NULL) - sustime; - if (delay < 10)
- sleep(10-delay);
+ 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); @@ -79,3 +86,3 @@ void CHM::unsuspend() { //suspos = gzseek(file, suspos, SEEK_SET); - }
+ } #endif @@ -88,2 +95,3 @@ void CHM::addContent(QString content) { void CHM::FillHomeContent() { +unsuspend(); if (chmHHCPath != "") { @@ -164,2 +172,3 @@ bool CHM::FillBuffer() { +unsuspend(); bool bRetVal = false; @@ -198,2 +207,3 @@ bool CHM::FillBuffer() bool CHM::FillContent() { +unsuspend(); bool bRetVal = false; @@ -241,3 +251,4 @@ bool CHM::FillContent() { -bool CHM::getFile(const QString& href) { +bool CHM::getFile(const QString& _href, const QString& ) { + QString href = "/" + _href; qDebug("Got:%s", (const char*)href); @@ -321,7 +332,7 @@ int CHM::getch() { return EOF; -#ifdef _WINDOWS
- QChar letter = chmBuffer.at(bufpos++);
-#else
- QChar letter = chmBuffer[bufpos++];
-#endif
+#ifdef _WINDOWS + QChar letter = chmBuffer.at(bufpos++); +#else + QChar letter = chmBuffer[bufpos++]; +#endif return (int)(char)letter; |