Changeset View
Changeset View
Standalone View
Standalone View
plugins/testview/testview.cpp
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Line(s) | 233 | { | |||
---|---|---|---|---|---|
234 | return item; | 234 | return item; | ||
235 | } | 235 | } | ||
236 | } | 236 | } | ||
237 | return nullptr; | 237 | return nullptr; | ||
238 | } | 238 | } | ||
239 | 239 | | |||
240 | QStandardItem* TestView::itemForProject(IProject* project) | 240 | QStandardItem* TestView::itemForProject(IProject* project) | ||
241 | { | 241 | { | ||
242 | foreach (QStandardItem* item, m_model->findItems(project->name())) | 242 | QList<QStandardItem*> itemsForProject = m_model->findItems(project->name()); | ||
243 | { | 243 | if (!itemsForProject.isEmpty()) { | ||
ematirov: Let's use just !stditemlist.IsEmpty() and stditemlist.first().
And probably "itemsForProject"… | |||||
It should be !itemsForProject.isEmpty(), not just itemsForProject.isEmpty(). Now it works like: ematirov: It should be !itemsForProject.isEmpty(), not just itemsForProject.isEmpty(). Now it works like… | |||||
244 | return item; | 244 | return itemsForProject.first(); | ||
245 | } | 245 | } | ||
246 | | ||||
247 | return addProject(project); | 246 | return addProject(project); | ||
248 | } | 247 | } | ||
249 | 248 | | |||
250 | 249 | | |||
251 | void TestView::runSelectedTests() | 250 | void TestView::runSelectedTests() | ||
252 | { | 251 | { | ||
253 | QModelIndexList indexes = m_tree->selectionModel()->selectedIndexes(); | 252 | QModelIndexList indexes = m_tree->selectionModel()->selectedIndexes(); | ||
254 | if (indexes.isEmpty()) | 253 | if (indexes.isEmpty()) | ||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |
Let's use just !stditemlist.IsEmpty() and stditemlist.first().
And probably "itemsForProject" or something like so will be more meaningful name for that. ;)