equal
deleted
inserted
replaced
23 ** |
23 ** |
24 ****************************************************************************/ |
24 ****************************************************************************/ |
25 |
25 |
26 #include "hboffsetmapbuilder_p.h" |
26 #include "hboffsetmapbuilder_p.h" |
27 #include "hblayoutparameters_p.h" |
27 #include "hblayoutparameters_p.h" |
|
28 #include "hbhash_p.h" |
28 |
29 |
29 #include <QFileInfo> |
30 #include <QFileInfo> |
30 |
31 |
31 extern QTextStream err; |
32 extern QTextStream err; |
32 |
33 |
40 { |
41 { |
41 if (!fileInfo) { |
42 if (!fileInfo) { |
42 return true; |
43 return true; |
43 } |
44 } |
44 bool retValue = true; |
45 bool retValue = true; |
45 quint32 nameHash = HbSharedCache::hash(QStringRef(&className)); |
46 quint32 nameHash = hbHash(QStringRef(&className)); |
46 HbBinMakerOffsetItem mapItem = mMapItems.value(nameHash, HbBinMakerOffsetItem()); |
47 HbBinMakerOffsetItem mapItem = mMapItems.value(nameHash, HbBinMakerOffsetItem()); |
47 if (mapItem.isNull()) { |
48 if (mapItem.isNull()) { |
48 if (fileInfo) { |
49 if (fileInfo) { |
49 mapItem.name = fileInfo->absoluteFilePath(); |
50 mapItem.name = fileInfo->absoluteFilePath(); |
50 } |
51 } |
75 if (offsetItem != mMapItems.end()) { |
76 if (offsetItem != mMapItems.end()) { |
76 QSet<quint64> hashCheck; |
77 QSet<quint64> hashCheck; |
77 QList<HbLayoutIndexItem> &layoutIndexTable = offsetItem.value().layoutIndexItemList; |
78 QList<HbLayoutIndexItem> &layoutIndexTable = offsetItem.value().layoutIndexItemList; |
78 Q_FOREACH(const LayoutItem &layoutInfo, layoutInfoList) { |
79 Q_FOREACH(const LayoutItem &layoutInfo, layoutInfoList) { |
79 HbLayoutIndexItem item; |
80 HbLayoutIndexItem item; |
80 item.layoutNameHash = HbSharedCache::hash(QStringRef(&layoutInfo.layout->layoutname)); |
81 item.layoutNameHash = hbHash(QStringRef(&layoutInfo.layout->layoutname)); |
81 item.sectionNameHash = HbSharedCache::hash(QStringRef(&layoutInfo.layout->section)); |
82 item.sectionNameHash = hbHash(QStringRef(&layoutInfo.layout->section)); |
82 quint64 hash = (quint64(item.layoutNameHash) << 32) | item.sectionNameHash; |
83 quint64 hash = (quint64(item.layoutNameHash) << 32) | item.sectionNameHash; |
83 if (!hashCheck.contains(hash)) { |
84 if (!hashCheck.contains(hash)) { |
84 hashCheck.insert(hash); |
85 hashCheck.insert(hash); |
85 } else { |
86 } else { |
86 err << "duplicate layout name hash found for: " << filePath << endl; |
87 err << "duplicate layout name hash found for: " << filePath << endl; |
101 mParameters.clear(); |
102 mParameters.clear(); |
102 bool status = true; |
103 bool status = true; |
103 |
104 |
104 QHash<QString, HbParameterValueItem>::const_iterator end = parameters.end(); |
105 QHash<QString, HbParameterValueItem>::const_iterator end = parameters.end(); |
105 for (QHash<QString, HbParameterValueItem>::const_iterator i = parameters.begin(); i != end; ++i) { |
106 for (QHash<QString, HbParameterValueItem>::const_iterator i = parameters.begin(); i != end; ++i) { |
106 quint32 hash = HbSharedCache::hash(QStringRef(&i.key())); |
107 quint32 hash = hbHash(QStringRef(&i.key())); |
107 if (mParameters.contains(hash)) { |
108 if (mParameters.contains(hash)) { |
108 err << "duplicate parameter hash found for: " << i.key(); |
109 err << "duplicate parameter hash found for: " << i.key(); |
109 status = false; |
110 status = false; |
110 break; |
111 break; |
111 } |
112 } |