author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (side-by-side diff) | |
tree | 1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/ZText.h | |
parent | e90847c784c48bd21bf8768cb38edb853b832697 (diff) | |
download | opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2 |
updated source to opie-reader 0.7g
Diffstat (limited to 'noncore/apps/opie-reader/ZText.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ZText.h | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/ZText.h b/noncore/apps/opie-reader/ZText.h index ab81a5e..06e3bf8 100644 --- a/noncore/apps/opie-reader/ZText.h +++ b/noncore/apps/opie-reader/ZText.h @@ -15,2 +15,4 @@ public: #ifdef USEQPE + if (!bSuspended) + { bSuspended = true; @@ -20,2 +22,3 @@ public: sustime = time(NULL);
+ } #endif @@ -28,4 +31,7 @@ public: bSuspended = false; + if (sustime != ((time_t)-1)) + { int delay = time(NULL) - sustime; if (delay < 10) sleep(10-delay); + } file = gzopen(fname, "rb"); @@ -48,3 +54,9 @@ public: { - if (file != NULL) gzclose(file); + if (file != NULL) + { +#ifdef USEQPE + unsuspend(); +#endif + gzclose(file); + } } @@ -58,5 +70,23 @@ public: } - int getch() { return gzgetc(file); } - unsigned int locate() { return gztell(file); } - void locate(unsigned int n) { gzseek(file,n,SEEK_SET); } + int getch() + { +#ifdef USEQPE + unsuspend(); +#endif + return gzgetc(file); + } + unsigned int locate() + { +#ifdef USEQPE + unsuspend(); +#endif + return gztell(file); + } + void locate(unsigned int n) + { +#ifdef USEQPE + unsuspend(); +#endif + gzseek(file,n,SEEK_SET); + } bool hasrandomaccess() { return true; } @@ -83,2 +113,3 @@ public: } + QString about() { return QString("Text/gzipped text codec (c) Tim Wentford"); } }; |