* Returns the parent folder item for a given item or the project root item if there is no parent. */
| 42 | * Returns the parent folder item for a given item or the project root item if there is no parent. |
| 43 | */ |
| 44 | ProjectFolderItem* parentFolder(ProjectBaseItem* item) |
| 45 | { |
| 46 | if ( item->parent() ) { |
| 47 | return static_cast<ProjectFolderItem*>(item->parent()); |
| 48 | } else { |
| 49 | return item->project()->projectItem(); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | } |
| 54 |
no test coverage detected