Changeset View
Changeset View
Standalone View
Standalone View
src/sycoca/ksycocafactory.cpp
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 96 | { | |||
---|---|---|---|---|---|
107 | 107 | | |||
108 | // Write header (pass #1) | 108 | // Write header (pass #1) | ||
109 | saveHeader(str); | 109 | saveHeader(str); | ||
110 | 110 | | |||
111 | d->m_beginEntryOffset = str.device()->pos(); | 111 | d->m_beginEntryOffset = str.device()->pos(); | ||
112 | 112 | | |||
113 | // Write all entries. | 113 | // Write all entries. | ||
114 | int entryCount = 0; | 114 | int entryCount = 0; | ||
115 | Q_FOREACH(KSycocaEntry::Ptr entry, *m_entryDict) { | 115 | for(KSycocaEntry::Ptr entry : qAsConst(*m_entryDict)) { | ||
116 | entry->d_ptr->save(str); | 116 | entry->d_ptr->save(str); | ||
117 | entryCount++; | 117 | entryCount++; | ||
118 | } | 118 | } | ||
119 | 119 | | |||
120 | d->m_endEntryOffset = str.device()->pos(); | 120 | d->m_endEntryOffset = str.device()->pos(); | ||
121 | 121 | | |||
122 | // Write indices... | 122 | // Write indices... | ||
123 | // Linear index | 123 | // Linear index | ||
124 | str << qint32(entryCount); | 124 | str << qint32(entryCount); | ||
125 | Q_FOREACH(KSycocaEntry::Ptr entry, *m_entryDict) { | 125 | for(KSycocaEntry::Ptr entry : qAsConst(*m_entryDict)) { | ||
126 | str << qint32(entry.data()->offset()); | 126 | str << qint32(entry.data()->offset()); | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | // Dictionary index | 129 | // Dictionary index | ||
130 | d->m_sycocaDictOffset = str.device()->pos(); | 130 | d->m_sycocaDictOffset = str.device()->pos(); | ||
131 | d->m_sycocaDict->save(str); | 131 | d->m_sycocaDict->save(str); | ||
132 | 132 | | |||
133 | qint64 endOfFactoryData = str.device()->pos(); | 133 | qint64 endOfFactoryData = str.device()->pos(); | ||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |