[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/ktranslator
From:       Raul Fernandes <rgfbr () yahoo ! com ! br>
Date:       2005-08-09 23:40:40
Message-ID: 1123630840.249769.22860.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 444386 by rgfbr:

Fix a bug in loading uncompressed .dict files in Dictd plugin


 M  +3 -0      ChangeLog  
 M  +44 -44    plugins/dictd/dictzip.cpp  


--- trunk/kdenonbeta/ktranslator/ChangeLog #444385:444386
@@ -1,3 +1,6 @@
+2005-08-09
+   Fix a bug in loading uncompressed .dict files in Dictd plugin
+
 2005-08-08
    Optimizations in dictd plugin
 
--- trunk/kdenonbeta/ktranslator/plugins/dictd/dictzip.cpp #444385:444386
@@ -41,51 +41,51 @@
   {
     file = new QFile( defarq );
     isCompressed = false;
-    return;
+  }else{
+    // The definition file is compressed (.dict.dz)
+    // Read the header
+    file = new QFile( defarq + ".dz" );
+    isCompressed = true;
+    file->open( IO_ReadOnly );
+    ID1 = file->getch(); //ID1 = 31 (0x1f, \037)
+    ID2 = file->getch(); //ID2 = 139 (0x8b, \213)
+    COMPRESSION = file->getch();
+    FLAGS = file->getch();
+    FTEXT = FLAGS & 1;
+    FHCRC = FLAGS & 2;
+    m_extraField = FLAGS & 4;
+    m_hasName = FLAGS & 8;
+    FCOMMENT = FLAGS & 16;
+    m_mtime = (unsigned char)file->getch() + (unsigned char)file->getch() * 256 + \
(unsigned char)file->getch() * 256 * 256 + (unsigned char)file->getch() * 256 * 256 * \
256; +    XFL = file->getch(); // Compression type
+    OS = file->getch(); // Operating System
+    // If has extra field, read it
+    if( m_extraField )
+    {
+      XLEN = (unsigned char)file->getch() + (unsigned char)file->getch() * 256;
+      readExtraField();
+    }
+    // If has name of decompressed file, read it
+    if( m_hasName )
+    {
+      readFileName();
+    }
+    // If has a comment field, read it
+    if( FCOMMENT )
+    {
+      readFileName();
+    }
+    // If has a CRC field, read it
+    if( FHCRC )
+    {
+      *crc16[0] = file->getch();
+      *crc16[1] = file->getch();
+    }
+    // Get the current position
+    // This is start position of the chunks of compressed data
+    offset = file->at();
+    file->close();
   }
-  // The definition file is compressed (.dict.dz)
-  // Read the header
-  file = new QFile( defarq + ".dz" );
-  isCompressed = true;
-  file->open( IO_ReadOnly );
-  ID1 = file->getch(); //ID1 = 31 (0x1f, \037)
-  ID2 = file->getch(); //ID2 = 139 (0x8b, \213)
-  COMPRESSION = file->getch();
-  FLAGS = file->getch();
-  FTEXT = FLAGS & 1;
-  FHCRC = FLAGS & 2;
-  m_extraField = FLAGS & 4;
-  m_hasName = FLAGS & 8;
-  FCOMMENT = FLAGS & 16;
-  m_mtime = (unsigned char)file->getch() + (unsigned char)file->getch() * 256 + \
(unsigned char)file->getch() * 256 * 256 + (unsigned char)file->getch() * 256 * 256 * \
                256;
-  XFL = file->getch(); // Compression type
-  OS = file->getch(); // Operating System
-  // If has extra field, read it
-  if( m_extraField )
-  {
-    XLEN = (unsigned char)file->getch() + (unsigned char)file->getch() * 256;
-    readExtraField();
-  }
-  // If has name of decompressed file, read it
-  if( m_hasName )
-  {
-    readFileName();
-  }
-  // If has a comment field, read it
-  if( FCOMMENT )
-  {
-    readFileName();
-  }
-  // If has a CRC field, read it
-  if( FHCRC )
-  {
-    *crc16[0] = file->getch();
-    *crc16[1] = file->getch();
-  }
-  // Get the current position
-  // This is start position of the chunks of compressed data
-  offset = file->at();
-  file->close();
 
   QString line, headword;
   struct entry entry;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic