Changeset View
Changeset View
Standalone View
Standalone View
src/bugzillaintegration/productmapping.cpp
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Line(s) | 109 | if (bzGroups.hasKey(group)) { | |||
---|---|---|---|---|---|
116 | } else { | 116 | } else { | ||
117 | qCWarning(DRKONQI_LOG) << "Error while reading mapping entry. Entry exists but it is empty " | 117 | qCWarning(DRKONQI_LOG) << "Error while reading mapping entry. Entry exists but it is empty " | ||
118 | "(or there was an error when reading)"; | 118 | "(or there was an error when reading)"; | ||
119 | } | 119 | } | ||
120 | } | 120 | } | ||
121 | } | 121 | } | ||
122 | } | 122 | } | ||
123 | 123 | | |||
124 | void ProductMapping::checkProductInfo(const Product & product) | 124 | void ProductMapping::checkProductInfo(const Bugzilla::Product::Ptr product) | ||
125 | { | 125 | { | ||
126 | // check whether the product itself is disabled for new reports, | 126 | // check whether the product itself is disabled for new reports, | ||
127 | // which usually means that product/application is unmaintained. | 127 | // which usually means that product/application is unmaintained. | ||
128 | m_bugzillaProductDisabled = !product.isActive(); | 128 | m_bugzillaProductDisabled = !product->isActive(); | ||
129 | 129 | | |||
130 | // check whether the product on bugzilla contains the expected component | 130 | // check whether the product on bugzilla contains the expected component | ||
131 | if (! product.components().contains(m_bugzillaComponent)) { | 131 | if (! product->components().contains(m_bugzillaComponent)) { | ||
132 | m_bugzillaComponent = QLatin1String("general"); | 132 | m_bugzillaComponent = QLatin1String("general"); | ||
133 | } | 133 | } | ||
134 | qDebug() << "components: " << product->components(); | ||||
135 | qDebug() << "versions: " << product->allVersions(); | ||||
134 | 136 | | |||
135 | // find the appropriate version to use on bugzilla | 137 | // find the appropriate version to use on bugzilla | ||
136 | const QString version = m_crashedAppPtr->version(); | 138 | const QString version = m_crashedAppPtr->version(); | ||
137 | const QStringList& allVersions = product.allVersions(); | 139 | const QStringList &allVersions = product->allVersions(); | ||
138 | 140 | | |||
139 | if (allVersions.contains(version)) { | 141 | if (allVersions.contains(version)) { | ||
140 | //The version the crash application provided is a valid bugzilla version: use it ! | 142 | //The version the crash application provided is a valid bugzilla version: use it ! | ||
141 | m_bugzillaVersionString = version; | 143 | m_bugzillaVersionString = version; | ||
142 | } else if (version.endsWith(QLatin1String(".00"))) { | 144 | } else if (version.endsWith(QLatin1String(".00"))) { | ||
143 | //check if there is a version on bugzilla with just ".0" | 145 | //check if there is a version on bugzilla with just ".0" | ||
144 | const QString shorterVersion = version.left(version.size() - 1); | 146 | const QString shorterVersion = version.left(version.size() - 1); | ||
145 | if (allVersions.contains(shorterVersion)) { | 147 | if (allVersions.contains(shorterVersion)) { | ||
146 | m_bugzillaVersionString = shorterVersion; | 148 | m_bugzillaVersionString = shorterVersion; | ||
147 | } | 149 | } | ||
148 | } | 150 | } | ||
149 | 151 | | |||
150 | // check whether that verions is disabled for new reports, which | 152 | // check whether that verions is disabled for new reports, which | ||
151 | // usually means that version is outdated and not supported anymore. | 153 | // usually means that version is outdated and not supported anymore. | ||
152 | const QStringList& inactiveVersions = product.inactiveVersions(); | 154 | const QStringList& inactiveVersions = product->inactiveVersions(); | ||
153 | m_bugzillaVersionDisabled = inactiveVersions.contains(m_bugzillaVersionString); | 155 | m_bugzillaVersionDisabled = inactiveVersions.contains(m_bugzillaVersionString); | ||
154 | 156 | | |||
155 | } | 157 | } | ||
156 | 158 | | |||
157 | QStringList ProductMapping::relatedBugzillaProducts() const | 159 | QStringList ProductMapping::relatedBugzillaProducts() const | ||
158 | { | 160 | { | ||
159 | return m_relatedBugzillaProducts; | 161 | return m_relatedBugzillaProducts; | ||
160 | } | 162 | } | ||
Show All 25 Lines |