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 @@ | |||
7 | #include <qpixmap.h> | 7 | #include <qpixmap.h> |
8 | #ifdef USEQPE | ||
9 | #include <qpe/global.h> | ||
10 | #endif | ||
8 | 11 | ||
@@ -51,3 +54,3 @@ CHM::~CHM() { | |||
51 | 54 | ||
52 | void CHM::suspend() { | 55 | void CHM::suspend() { |
53 | #ifdef USEQPE | 56 | #ifdef USEQPE |
@@ -57,3 +60,3 @@ void CHM::suspend() { | |||
57 | chmFile = NULL; | 60 | chmFile = NULL; |
58 | sustime = time(NULL); | 61 | sustime = time(NULL); |
59 | #endif | 62 | #endif |
@@ -61,3 +64,3 @@ void CHM::suspend() { | |||
61 | 64 | ||
62 | void CHM::unsuspend() { | 65 | void CHM::unsuspend() { |
63 | #ifdef USEQPE | 66 | #ifdef USEQPE |
@@ -67,6 +70,10 @@ void CHM::unsuspend() { | |||
67 | int delay = time(NULL) - sustime; | 70 | int delay = time(NULL) - sustime; |
68 | if (delay < 10) | 71 | if (delay < 10) |
69 | sleep(10-delay); | 72 | { |
73 | Global::statusMessage("Stalling"); | ||
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); |
@@ -79,3 +86,3 @@ void CHM::unsuspend() { | |||
79 | //suspos = gzseek(file, suspos, SEEK_SET); | 86 | //suspos = gzseek(file, suspos, SEEK_SET); |
80 | } | 87 | } |
81 | #endif | 88 | #endif |
@@ -88,2 +95,3 @@ void CHM::addContent(QString content) { | |||
88 | void CHM::FillHomeContent() { | 95 | void CHM::FillHomeContent() { |
96 | unsuspend(); | ||
89 | if (chmHHCPath != "") { | 97 | if (chmHHCPath != "") { |
@@ -164,2 +172,3 @@ bool CHM::FillBuffer() | |||
164 | { | 172 | { |
173 | unsuspend(); | ||
165 | bool bRetVal = false; | 174 | bool bRetVal = false; |
@@ -198,2 +207,3 @@ bool CHM::FillBuffer() | |||
198 | bool CHM::FillContent() { | 207 | bool CHM::FillContent() { |
208 | unsuspend(); | ||
199 | bool bRetVal = false; | 209 | bool bRetVal = false; |
@@ -241,3 +251,4 @@ bool CHM::FillContent() { | |||
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); |
@@ -321,7 +332,7 @@ int CHM::getch() { | |||
321 | return EOF; | 332 | return EOF; |
322 | #ifdef _WINDOWS | 333 | #ifdef _WINDOWS |
323 | QChar letter = chmBuffer.at(bufpos++); | 334 | QChar letter = chmBuffer.at(bufpos++); |
324 | #else | 335 | #else |
325 | QChar letter = chmBuffer[bufpos++]; | 336 | QChar letter = chmBuffer[bufpos++]; |
326 | #endif | 337 | #endif |
327 | return (int)(char)letter; | 338 | return (int)(char)letter; |