~adamreichold/qpdfview/trunk

« back to all changes in this revision

Viewing changes to sources/searchmodel.h

  • Committer: Adam Reichold
  • Date: 2015-01-24 16:32:08 UTC
  • Revision ID: adam.reichold@t-online.de-20150124163208-1zzjw9tun3e4igiy
Try to decouple highlighted matched text from the matching itself done by the backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        TextRole,
59
59
        MatchCaseRole,
60
60
        WholeWordsRole,
 
61
        MatchedTextRole,
61
62
        SurroundingTextRole
62
63
    };
63
64
 
107
108
 
108
109
 
109
110
    typedef QPair< DocumentView*, QByteArray > TextCacheKey;
110
 
    typedef QString TextCacheObject;
 
111
    typedef QPair< QString, QString > TextCacheObject;
111
112
 
112
113
    struct TextJob
113
114
    {
124
125
    mutable QCache< TextCacheKey, TextCacheObject > m_textCache;
125
126
    mutable QHash< TextCacheKey, TextWatcher* > m_textWatchers;
126
127
 
 
128
    QString fetchMatchedText(DocumentView* view, const Result& result) const;
127
129
    QString fetchSurroundingText(DocumentView* view, const Result& result) const;
128
130
 
 
131
    const TextCacheObject* fetchText(DocumentView* view, const Result& result) const;
 
132
 
129
133
    static TextCacheKey textCacheKey(DocumentView* view, const Result& result);
130
134
    static TextJob textJob(const TextCacheKey& key, const Result& result);
131
135