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 | |||
@@ -5,6 +5,9 @@ | |||
5 | #include <stdio.h> | 5 | #include <stdio.h> |
6 | #include <qimage.h> | 6 | #include <qimage.h> |
7 | #include <qpixmap.h> | 7 | #include <qpixmap.h> |
8 | #ifdef USEQPE | ||
9 | #include <qpe/global.h> | ||
10 | #endif | ||
8 | 11 | ||
9 | #ifndef __STATIC | 12 | #ifndef __STATIC |
10 | extern "C" | 13 | extern "C" |
@@ -66,9 +69,13 @@ void CHM::unsuspend() { | |||
66 | bSuspended = false; | 69 | bSuspended = false; |
67 | int delay = time(NULL) - sustime; | 70 | int delay = time(NULL) - sustime; |
68 | if (delay < 10) | 71 | if (delay < 10) |
72 | { | ||
73 | Global::statusMessage("Stalling"); | ||
69 | sleep(10-delay); | 74 | sleep(10-delay); |
75 | } | ||
70 | chmFile = chm_open(fname); | 76 | chmFile = chm_open(fname); |
71 | for (int i = 0; chmFile == NULL && i < 5; i++) { | 77 | for (int i = 0; chmFile == NULL && i < 5; i++) { |
78 | Global::statusMessage("Stalling"); | ||
72 | sleep(5); | 79 | sleep(5); |
73 | chmFile = chm_open(fname); | 80 | chmFile = chm_open(fname); |
74 | } | 81 | } |
@@ -86,6 +93,7 @@ void CHM::addContent(QString content) { | |||
86 | } | 93 | } |
87 | 94 | ||
88 | void CHM::FillHomeContent() { | 95 | void CHM::FillHomeContent() { |
96 | unsuspend(); | ||
89 | if (chmHHCPath != "") { | 97 | if (chmHHCPath != "") { |
90 | const char *ext; | 98 | const char *ext; |
91 | char buffer[65536]; | 99 | char buffer[65536]; |
@@ -162,6 +170,7 @@ void CHM::FillHomeContent() { | |||
162 | 170 | ||
163 | bool CHM::FillBuffer() | 171 | bool CHM::FillBuffer() |
164 | { | 172 | { |
173 | unsuspend(); | ||
165 | bool bRetVal = false; | 174 | bool bRetVal = false; |
166 | char buffer[65536]; | 175 | char buffer[65536]; |
167 | int swath, offset; | 176 | int swath, offset; |
@@ -196,6 +205,7 @@ bool CHM::FillBuffer() | |||
196 | } | 205 | } |
197 | 206 | ||
198 | bool CHM::FillContent() { | 207 | bool CHM::FillContent() { |
208 | unsuspend(); | ||
199 | bool bRetVal = false; | 209 | bool bRetVal = false; |
200 | if (chmPath != "") { | 210 | if (chmPath != "") { |
201 | /* try to find the file */ | 211 | /* try to find the file */ |
@@ -239,7 +249,8 @@ bool CHM::FillContent() { | |||
239 | return bRetVal; | 249 | return bRetVal; |
240 | } | 250 | } |
241 | 251 | ||
242 | bool CHM::getFile(const QString& href) { | 252 | bool CHM::getFile(const QString& _href, const QString& ) { |
253 | QString href = "/" + _href; | ||
243 | qDebug("Got:%s", (const char*)href); | 254 | qDebug("Got:%s", (const char*)href); |
244 | bool bRetVal = false; | 255 | bool bRetVal = false; |
245 | QString temp = chmPath; | 256 | QString temp = chmPath; |