Show
Ignore:
Timestamp:
03/17/08 05:18:48 (6 months ago)
Author:
cboos
Message:

Applied patch from xl948 for fixing #798 and #T5574.

Thanks!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doxygenplugin/0.10/doxygentrac/doxygentrac.py

    r2651 r3375  
    197197            # Search in documentation directories 
    198198            path = os.path.join(self.base_path, doc) 
     199            path = os.path.join(path, self.html_output) 
    199200            if os.path.isdir(path): 
    200201                index = os.path.join(path, 'search.idx') 
     
    208209 
    209210            # Search in common documentation directory 
    210             index = os.path.join(self.base_path, 'search.idx') 
     211            index = os.path.join(self.base_path, self.html_output) 
     212            index = os.path.join(index, 'search.idx') 
    211213            if os.path.exists(index): 
    212214                creation = os.path.getctime(index) 
     
    342344    def _search_in_documentation(self, doc, keywords): 
    343345        # Open index file for documentation 
    344         index = os.path.join(self.base_path, doc, 'search.idx') 
     346        index = os.path.join(self.base_path, doc, self.html_output, 'search.idx') 
    345347        if os.path.exists(index): 
    346348            fd = open(index) 
     
    388390                    for i in range(numDocs): 
    389391                        idx = self._readInt(fd) 
    390                         freq = self._readInt(fd) 
     392                        if idx == -1: 
     393                            freq = 0 
     394                        else: 
     395                            freq = self._readInt(fd) 
    391396                        results.append({'idx': idx, 'freq': freq >> 1, 
    392397                          'hi': freq & 1, 'multi': multiplier}) 
     
    398403 
    399404                    for i in range(numDocs): 
     405                        if results[count]['idx'] == -1: 
     406                            results[count]['name'] = '' 
     407                            results[count]['url'] = '' 
     408                            count += 1 
     409                            continue 
    400410                        fd.seek(results[count]['idx']) 
    401411                        name = self._readString(fd) 
    402412                        url = self._readString(fd) 
    403413                        results[count]['name'] = name 
    404                         results[count]['url'] = url 
     414                        results[count]['url'] = self.html_output + '/' + url 
    405415                        count += 1 
    406416 
     
    436446        b3 = fd.read(1) 
    437447        b4 = fd.read(1) 
     448         
     449        if not b1 or not b2 or not b3 or not b4: 
     450            return -1; 
    438451 
    439452        return (ord(b1) << 24) | (ord(b2) << 16) | (ord(b3) << 8) | ord(b4)