Diffstat (limited to 'noncore/apps/opie-reader/CExpander.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CExpander.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/CExpander.cpp b/noncore/apps/opie-reader/CExpander.cpp index e398d86..1158a7a 100644 --- a/noncore/apps/opie-reader/CExpander.cpp +++ b/noncore/apps/opie-reader/CExpander.cpp @@ -1,17 +1,20 @@ #include "CExpander.h" +#ifdef USEQPE +#include <qpe/global.h> +#endif size_t CExpander::getHome() { return m_homepos; } CExpander::CExpander() : m_homepos(0), fname(NULL), m_scrWidth(240), m_currentstart(1), m_currentend(0) {}; CExpander::~CExpander() { if (fname != NULL) delete [] fname; }; int CExpander::openfile(const char *src) { bSuspended = false; fname = strdup(src); return OpenFile(src); } void CExpander::getch(tchar& ch, CStyle& sty, unsigned long& pos) { @@ -57,36 +60,41 @@ void CExpander::start2endSection() #ifdef USEQPE void CExpander::suspend(FILE*& fin) { bSuspended = true; suspos = ftell(fin); fclose(fin); fin = NULL; sustime = time(NULL); } void CExpander::unsuspend(FILE*& fin) { if (bSuspended) { bSuspended = false; int delay = time(NULL) - sustime; - if (delay < 10) sleep(10-delay); + if (delay < 10) + { + Global::statusMessage("Stalling"); + sleep(10-delay); + } fin = fopen(fname, "rb"); for (int i = 0; fin == NULL && i < 5; i++) { + Global::statusMessage("Stalling"); sleep(5); fin = fopen(fname, "rb"); } if (fin == NULL) { QMessageBox::warning(NULL, PROGNAME, "Couldn't reopen file"); exit(0); } suspos = fseek(fin, suspos, SEEK_SET); } } #endif void CExpander::setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen) { len = srclen; |