author | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
commit | 876e1a4724a7bd75dc642e295de354241096e028 (patch) (unidiff) | |
tree | a37c5dcc9d78e04bb6b859ab89d8cf81e6745087 /noncore/apps/opie-reader/ZText.h | |
parent | 5fd6636ba3d94b48dd543887316c47c5388a43c2 (diff) | |
download | opie-876e1a4724a7bd75dc642e295de354241096e028.zip opie-876e1a4724a7bd75dc642e295de354241096e028.tar.gz opie-876e1a4724a7bd75dc642e295de354241096e028.tar.bz2 |
update - sorry it took so long. hope this works correctly
Diffstat (limited to 'noncore/apps/opie-reader/ZText.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ZText.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/ZText.h b/noncore/apps/opie-reader/ZText.h index debfe8c..22d3733 100644 --- a/noncore/apps/opie-reader/ZText.h +++ b/noncore/apps/opie-reader/ZText.h | |||
@@ -12,2 +12,31 @@ class Text: public CExpander { | |||
12 | public: | 12 | public: |
13 | virtual void suspend() | ||
14 | { | ||
15 | bSuspended = true; | ||
16 | suspos = gztell(file); | ||
17 | gzclose(file); | ||
18 | file = NULL; | ||
19 | sustime = time(NULL); | ||
20 | } | ||
21 | virtual void unsuspend() | ||
22 | { | ||
23 | if (bSuspended) | ||
24 | { | ||
25 | bSuspended = false; | ||
26 | int delay = time(NULL) - sustime; | ||
27 | if (delay < 10) sleep(10-delay); | ||
28 | file = gzopen(fname, "rb"); | ||
29 | for (int i = 0; file == NULL && i < 5; i++) | ||
30 | { | ||
31 | sleep(5); | ||
32 | file = gzopen(fname, "rb"); | ||
33 | } | ||
34 | if (file == NULL) | ||
35 | { | ||
36 | QMessageBox::warning(NULL, PROGNAME, "Couldn't reopen file"); | ||
37 | exit(0); | ||
38 | } | ||
39 | suspos = gzseek(file, suspos, SEEK_SET); | ||
40 | } | ||
41 | } | ||
13 | Text() : file(NULL) {}; | 42 | Text() : file(NULL) {}; |
@@ -17,3 +46,3 @@ public: | |||
17 | } | 46 | } |
18 | virtual int openfile(const char *src) | 47 | virtual int OpenFile(const char *src) |
19 | { | 48 | { |