Diffstat (limited to 'noncore/apps/opie-reader/pdb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/pdb.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/apps/opie-reader/pdb.cpp b/noncore/apps/opie-reader/pdb.cpp index 6719af4..a13b33d 100644 --- a/noncore/apps/opie-reader/pdb.cpp +++ b/noncore/apps/opie-reader/pdb.cpp | |||
@@ -2,9 +2,8 @@ | |||
2 | #ifdef _WINDOWS | 2 | #ifdef _WINDOWS |
3 | #include <winsock2.h> | 3 | #include <winsock2.h> |
4 | #endif | 4 | #endif |
5 | 5 | ||
6 | |||
7 | #ifdef USEQPE | 6 | #ifdef USEQPE |
8 | void Cpdb::suspend() | 7 | void Cpdb::suspend() |
9 | { | 8 | { |
10 | CExpander::suspend(fin); | 9 | CExpander::suspend(fin); |
@@ -36,8 +35,9 @@ size_t Cpdb::recordpos(int n) | |||
36 | else | 35 | else |
37 | { | 36 | { |
38 | size_t dataoffset = sizeof(DatabaseHdrType) - sizeof(UInt16); | 37 | size_t dataoffset = sizeof(DatabaseHdrType) - sizeof(UInt16); |
39 | dataoffset += /*dataoffset%4 + */ sizeof(RecordListType) * n; | 38 | dataoffset += /*dataoffset%4 + */ sizeof(RecordListType) * n; |
39 | unsuspend(); | ||
40 | fseek(fin, dataoffset, SEEK_SET); | 40 | fseek(fin, dataoffset, SEEK_SET); |
41 | RecordListType hdr; | 41 | RecordListType hdr; |
42 | fread(&hdr, 1, sizeof(hdr), fin); | 42 | fread(&hdr, 1, sizeof(hdr), fin); |
43 | return ntohl(hdr.nextRecordListID); | 43 | return ntohl(hdr.nextRecordListID); |
@@ -51,8 +51,9 @@ size_t Cpdb::recordlength(int n) | |||
51 | } | 51 | } |
52 | 52 | ||
53 | void Cpdb::gotorecordnumber(int n) | 53 | void Cpdb::gotorecordnumber(int n) |
54 | { | 54 | { |
55 | unsuspend(); | ||
55 | fseek(fin, recordpos(n), SEEK_SET); | 56 | fseek(fin, recordpos(n), SEEK_SET); |
56 | } | 57 | } |
57 | 58 | ||
58 | bool Cpdb::openpdbfile(const char *src) | 59 | bool Cpdb::openpdbfile(const char *src) |
@@ -81,9 +82,9 @@ bool Cpdb::openpdbfile(const char *src) | |||
81 | fseek(fin,0,SEEK_SET); | 82 | fseek(fin,0,SEEK_SET); |
82 | 83 | ||
83 | fread(&head, 1, sizeof(head), fin); | 84 | fread(&head, 1, sizeof(head), fin); |
84 | 85 | ||
85 | qDebug("Database name:%s", head.name); | 86 | //qDebug("Database name:%s", head.name); |
86 | qDebug("Total number of records:%u", ntohs(head.recordList.numRecords)); | 87 | //qDebug("Total number of records:%u", ntohs(head.recordList.numRecords)); |
87 | 88 | ||
88 | return true; | 89 | return true; |
89 | } | 90 | } |