| 533 | } |
| 534 | |
| 535 | void TestProjectModel::testProjectFileIcon() |
| 536 | { |
| 537 | QMimeDatabase db; |
| 538 | |
| 539 | QScopedPointer<ProjectFileItem> item(new ProjectFileItem(nullptr, Path(QDir::tempPath() + "/foo.txt"))); |
| 540 | const QString txtIcon = db.mimeTypeForUrl(item->path().toUrl()).iconName(); |
| 541 | QCOMPARE(item->iconName(), txtIcon); |
| 542 | item->setPath(Path(QDir::tempPath() + "/bar.cpp")); |
| 543 | QCOMPARE(item->iconName(), db.mimeTypeForUrl(item->path().toUrl()).iconName()); |
| 544 | QVERIFY(item->iconName() != txtIcon); |
| 545 | } |
| 546 | |
| 547 | QTEST_MAIN(TestProjectModel) |
| 548 | |