Diffstat (limited to 'noncore/apps/opie-reader/Bkmks.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/Bkmks.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/Bkmks.cpp b/noncore/apps/opie-reader/Bkmks.cpp index a8bee13..889c6d8 100644 --- a/noncore/apps/opie-reader/Bkmks.cpp +++ b/noncore/apps/opie-reader/Bkmks.cpp @@ -1,33 +1,33 @@ -#include "name.h" #include <qmessagebox.h> #include "Bkmks.h" #include "StyleConsts.h" #include "Markups.h" #include "my_list.h" #include "version.h" +#include "names.h" const unsigned long BkmkFile::magic = ((unsigned long)'q' << 24) | ((unsigned long)'t' << 16) | ((unsigned long)'r' << 8) | ((unsigned long)BKMKTYPE); Bkmk::Bkmk(const unsigned char* _nm, unsigned short _nmlen, const unsigned char* _anno, unsigned short _annolen, unsigned int _p) : m_position(_p) { init(_nm, _nmlen, _anno, _annolen, _p); } Bkmk::Bkmk(const tchar* _nm, const unsigned char* _anno, unsigned short annolen, unsigned int _p) : m_position(_p) { init(_nm, sizeof(tchar)*(ustrlen(_nm)+1), _anno, annolen, _p); } Bkmk::Bkmk(const tchar* _nm, const tchar* _anno, unsigned int _p) : m_position(_p) { if (_anno == NULL) { tchar t = 0; init(_nm, sizeof(tchar)*(ustrlen(_nm)+1), &t, sizeof(t), _p); } else { init(_nm, sizeof(tchar)*(ustrlen(_nm)+1), _anno, sizeof(tchar)*(ustrlen(_anno)+1), _p); @@ -198,57 +198,57 @@ CList<Bkmk>* BkmkFile::readall() { unsigned long newmagic; fread(&newmagic, sizeof(newmagic), 1, f); if ((newmagic & 0xffffff00) != (magic & 0xffffff00)) { if (QMessageBox::warning(NULL, "Old bookmark file!", "Which version of " PROGNAME "\ndid you upgrade from?", "0_4*", "Any other version") == 0) { fseek(f,0,SEEK_SET); bl = readall00(&read05); } else { fseek(f,0,SEEK_SET); bl = readall00(&read03); } isUpgraded = true; } else { switch(newmagic & 0xff) { case 6: isUpgraded = false; bl = readall00(read06); - qDebug("Correct version!"); +// qDebug("Correct version!"); break; case 5: isUpgraded = true; bl = readall00(read05); - qDebug("Known version!"); +// qDebug("Known version!"); break; default: - qDebug("Unknown version!"); +// qDebug("Unknown version!"); isUpgraded = true; bl = readall00(read05); } } } return bl; } CList<Bkmk>* BkmkFile::readall00(Bkmk* (*readfn)(FILE*)) { CList<Bkmk>* bl = new CList<Bkmk>; while (1) { Bkmk* b = (*readfn)(f); if (b == NULL) break; bl->push_back(*b); delete b; } return bl; } Bkmk* BkmkFile::read03(FILE* f) { Bkmk* b = NULL; |