303 QVERIFY(mTestObject->openItem(itemId) == 0); |
305 QVERIFY(mTestObject->openItem(itemId) == 0); |
304 |
306 |
305 // open category or album |
307 // open category or album |
306 itemId = TMPXItemId(1,2); |
308 itemId = TMPXItemId(1,2); |
307 QVERIFY(mTestObject->openItem(itemId) == 0); |
309 QVERIFY(mTestObject->openItem(itemId) == 0); |
308 |
|
309 } |
310 } |
310 |
311 |
311 // --------------------------------------------------------------------------- |
312 // --------------------------------------------------------------------------- |
312 // testBack |
313 // testBack |
313 // --------------------------------------------------------------------------- |
314 // --------------------------------------------------------------------------- |
314 // |
315 // |
315 void TestVideoSortFilterProxyModel::testBack() |
316 void TestVideoSortFilterProxyModel::testBack() |
316 { |
317 { |
317 |
318 QVERIFY(mTestObject->back() == -1); |
318 QVERIFY(mTestObject->initialize(mStubModel) == 0); |
319 |
|
320 QVERIFY(mTestObject->initialize(mStubModel) == 0); |
319 |
321 |
320 QVERIFY(mTestObject->back() == 0); |
322 QVERIFY(mTestObject->back() == 0); |
321 |
323 |
322 mTestObject->open(VideoCollectionCommon::ELevelAlbum); |
324 mTestObject->open(VideoCollectionCommon::ELevelAlbum); |
323 QVERIFY(mTestObject->back() == 0); |
325 QVERIFY(mTestObject->back() == 0); |
324 |
326 |
325 } |
327 // back fails |
326 |
328 VideoCollectionClient::mBackReturnValue = -1; |
327 // --------------------------------------------------------------------------- |
|
328 // testBack |
|
329 // --------------------------------------------------------------------------- |
|
330 // |
|
331 void TestVideoSortFilterProxyModel::testBackClientNull() |
|
332 { |
|
333 |
|
334 QVERIFY(mTestObject->initialize(mStubModel) == 0); |
|
335 VideoCollectionClient *tmpCollectionClient = mTestObject->getClient(); |
|
336 mTestObject->setClient(0); |
|
337 |
|
338 QVERIFY(mTestObject->back() == -1); |
329 QVERIFY(mTestObject->back() == -1); |
339 |
330 |
340 mTestObject->setClient(tmpCollectionClient); |
331 VideoCollectionClient::mBackReturnValue = 0; |
341 } |
332 } |
342 |
333 |
343 // --------------------------------------------------------------------------- |
334 // --------------------------------------------------------------------------- |
344 // testFetchItemDetails |
335 // testFetchItemDetails |
345 // --------------------------------------------------------------------------- |
336 // --------------------------------------------------------------------------- |
651 |
646 |
652 QVERIFY(!mTestObject->callLessThan(left, right)); |
647 QVERIFY(!mTestObject->callLessThan(left, right)); |
653 } |
648 } |
654 |
649 |
655 // --------------------------------------------------------------------------- |
650 // --------------------------------------------------------------------------- |
|
651 // testLessThanDefaults |
|
652 // --------------------------------------------------------------------------- |
|
653 // |
|
654 void TestVideoSortFilterProxyModel::testLessThanDefaults() |
|
655 { |
|
656 VideoCollectionClient::mFailStartOpen = false; |
|
657 QVERIFY(mTestObject->initialize(mStubModel) == 0); |
|
658 QVERIFY(mTestObject->open(VideoCollectionCommon::ELevelCategory) == 0); |
|
659 |
|
660 // Default categories (KVcxMvcMediaTypeCategory) |
|
661 // are always first in the following order: |
|
662 // Recently played (missing currently |
|
663 // Captured (KVcxMvcCategoryIdCaptured) |
|
664 // Downloaded (KVcxMvcCategoryIdDownloads) |
|
665 // Podcasts (missing currently) |
|
666 mStubModel->appendData(TMPXItemId(20, KVcxMvcMediaTypeAlbum)); // to source index 0 |
|
667 mStubModel->appendData(TMPXItemId(KVcxMvcCategoryIdDownloads, KVcxMvcMediaTypeCategory)); // to source index 1 |
|
668 mStubModel->appendData(TMPXItemId(KVcxMvcCategoryIdCaptured, KVcxMvcMediaTypeCategory)); // to source index 2 |
|
669 mStubModel->appendData(TMPXItemId(100, KVcxMvcMediaTypeCategory)); // to source index 3 |
|
670 mStubModel->appendData(TMPXItemId(101, KVcxMvcMediaTypeCategory)); // to source index 4 |
|
671 |
|
672 // left & right are KVcxMvcMediaTypeCategory |
|
673 // -> left == KVcxMvcCategoryIdCaptured |
|
674 QModelIndex left = mStubModel->index(2,0); |
|
675 QModelIndex right = mStubModel->index(1,0); |
|
676 // call doSorting to setup sorting order |
|
677 mTestObject->mWantedSortOrder = Qt::AscendingOrder; |
|
678 QVERIFY(mTestObject->callLessThan(left, right)); |
|
679 // call doSorting to setup sorting order |
|
680 mTestObject->mWantedSortOrder = Qt::DescendingOrder; |
|
681 QVERIFY(!mTestObject->callLessThan(left, right)); |
|
682 |
|
683 // -> left == KVcxMvcCategoryIdDownloads |
|
684 left = mStubModel->index(1,0); |
|
685 // -> right == KVcxMvcCategoryIdCaptured |
|
686 right = mStubModel->index(2,0); |
|
687 mTestObject->mWantedSortOrder = Qt::AscendingOrder; |
|
688 QVERIFY(!mTestObject->callLessThan(left, right)); |
|
689 mTestObject->mWantedSortOrder = Qt::DescendingOrder; |
|
690 QVERIFY(mTestObject->callLessThan(left, right)); |
|
691 |
|
692 // -> right != KVcxMvcCategoryIdCaptured |
|
693 right = mStubModel->index(3,0); |
|
694 mTestObject->mWantedSortOrder = Qt::AscendingOrder; |
|
695 QVERIFY(mTestObject->callLessThan(left, right)); |
|
696 mTestObject->mWantedSortOrder = Qt::DescendingOrder; |
|
697 QVERIFY(!mTestObject->callLessThan(left, right)); |
|
698 |
|
699 // both are KVcxMvcMediaTypeCategory but netiher KVcxMvcCategoryIdCaptured |
|
700 // nor KVcxMvcCategoryIdDownloads |
|
701 left = mStubModel->index(3,0); |
|
702 right = mStubModel->index(4,0); |
|
703 mTestObject->mWantedSortOrder = Qt::AscendingOrder; |
|
704 QVERIFY(!mTestObject->callLessThan(left, right)); |
|
705 mTestObject->mWantedSortOrder = Qt::DescendingOrder; |
|
706 QVERIFY(mTestObject->callLessThan(left, right)); |
|
707 |
|
708 // Left is KVcxMvcMediaTypeCategory and right is not |
|
709 left = mStubModel->index(1,0); |
|
710 right = mStubModel->index(0,0); |
|
711 mTestObject->mWantedSortOrder = Qt::AscendingOrder; |
|
712 QVERIFY(mTestObject->callLessThan(left, right)); |
|
713 mTestObject->mWantedSortOrder = Qt::DescendingOrder; |
|
714 QVERIFY(!mTestObject->callLessThan(left, right)); |
|
715 |
|
716 // right is KVcxMvcMediaTypeCategory and left is not |
|
717 left = mStubModel->index(0,0); |
|
718 right = mStubModel->index(1,0); |
|
719 mTestObject->mWantedSortOrder = Qt::AscendingOrder; |
|
720 QVERIFY(!mTestObject->callLessThan(left, right)); |
|
721 mTestObject->mWantedSortOrder = Qt::DescendingOrder; |
|
722 QVERIFY(mTestObject->callLessThan(left, right)); |
|
723 } |
|
724 |
|
725 // --------------------------------------------------------------------------- |
656 // testLessThanInvalid |
726 // testLessThanInvalid |
657 // --------------------------------------------------------------------------- |
727 // --------------------------------------------------------------------------- |
658 // |
728 // |
659 void TestVideoSortFilterProxyModel::testLessThanInvalid() |
729 void TestVideoSortFilterProxyModel::testLessThanInvalid() |
660 { |
730 { |
673 // invalid role but valid data. |
743 // invalid role but valid data. |
674 |
744 |
675 QString name1 = "cc"; |
745 QString name1 = "cc"; |
676 QString name2 = "bb"; |
746 QString name2 = "bb"; |
677 QString name3 = "aa"; |
747 QString name3 = "aa"; |
678 |
|
679 |
748 |
680 mStubModel->appendData(name1); // to index 0, position 4 |
749 mStubModel->appendData(name1); // to index 0, position 4 |
681 mStubModel->appendData(name2); // to index 1, position 3 |
750 mStubModel->appendData(name2); // to index 1, position 3 |
682 mStubModel->appendData(name3); // to index 2, position 2 |
751 mStubModel->appendData(name3); // to index 2, position 2 |
683 |
752 |
684 mTestObject->setSortRole(INVALID_ROLE_FOR_SORTING); |
753 mTestObject->setSortRole(INVALID_ROLE_FOR_SORTING); |
685 |
754 |
686 left = mStubModel->index(0,0); |
755 left = mStubModel->index(0,0); |
687 right = mStubModel->index(1,0); |
756 right = mStubModel->index(1,0); |
688 |
757 |
689 |
758 QVERIFY(!mTestObject->callLessThan(left, right)); |
690 QVERIFY(!mTestObject->callLessThan(left, right)); |
759 |
691 |
|
692 // reset model |
|
693 mStubModel->removeAll(); |
|
694 |
|
695 // invalid left index |
760 // invalid left index |
696 mTestObject->setSortRole(Qt::DisplayRole); |
761 mTestObject->setSortRole(VideoCollectionCommon::KeyTitle); |
697 |
762 |
698 left = QModelIndex(); |
763 left = QModelIndex(); |
699 right = mStubModel->index(0,0); |
764 right = mStubModel->index(0,0); |
700 |
765 |
701 QVERIFY(!mTestObject->callLessThan(left, right)); |
766 QVERIFY(!mTestObject->callLessThan(left, right)); |
702 |
767 |
703 // invalid right index |
768 // invalid right index |
704 mTestObject->setSortRole(Qt::DisplayRole); |
769 mTestObject->setSortRole(VideoCollectionCommon::KeyTitle); |
705 User::Heap().__DbgMarkStart(); |
770 User::Heap().__DbgMarkStart(); |
706 left = mStubModel->index(0,0); |
771 left = mStubModel->index(0,0); |
707 right = QModelIndex(); |
772 right = QModelIndex(); |
708 |
773 |
709 QVERIFY(!mTestObject->callLessThan(left, right)); |
774 QVERIFY(!mTestObject->callLessThan(left, right)); |
710 |
775 |
711 // both invalid |
776 // both invalid |
712 mTestObject->setSortRole(Qt::DisplayRole); |
777 mTestObject->setSortRole(VideoCollectionCommon::KeyTitle); |
713 User::Heap().__DbgMarkStart(); |
778 User::Heap().__DbgMarkStart(); |
714 left = QModelIndex(); |
779 left = QModelIndex(); |
715 right = QModelIndex(); |
780 right = QModelIndex(); |
716 |
781 |
717 QVERIFY(!mTestObject->callLessThan(left, right)); |
782 QVERIFY(!mTestObject->callLessThan(left, right)); |
778 mStubModel->appendData(size3); // to index 2 |
841 mStubModel->appendData(size3); // to index 2 |
779 mStubModel->appendData(size4); // to index 3 |
842 mStubModel->appendData(size4); // to index 3 |
780 mStubModel->appendData(size5); // to index 4 |
843 mStubModel->appendData(size5); // to index 4 |
781 |
844 |
782 int sortingRole; |
845 int sortingRole; |
783 Qt::SortOrder sortingOrder; |
846 Qt::SortOrder sortingOrder; |
784 |
847 |
785 // first sort call, includes timer creation and setup |
848 // first sort call, includes timer creation and setup |
786 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
849 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
787 mTestObject->doSorting(Qt::DisplayRole, Qt::AscendingOrder); |
850 mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::AscendingOrder); |
788 // need to wait for awhile to make sure zero-counter gets |
851 // need to wait for awhile to make sure zero-counter gets |
789 // processing time. |
852 // processing time. |
790 QTest::qWait(500); |
853 QTest::qWait(500); |
791 QCOMPARE(spyAboutToChange.count(), 1); |
854 QCOMPARE(spyAboutToChange.count(), 2); // 2 times because also the setSortRole causes this signal. |
792 QCOMPARE(spyChanged.count(), 1); |
855 QCOMPARE(spyChanged.count(), 2); // 2 times because also the setSortRole causes this signal. |
793 QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole); |
856 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle); |
794 QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder); |
857 QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder); |
795 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
858 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
796 mTestObject->getSorting(sortingRole, sortingOrder); |
859 mTestObject->getSorting(sortingRole, sortingOrder); |
797 QCOMPARE(sortingRole, (int)Qt::DisplayRole); |
860 QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle); |
798 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
861 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
799 |
862 |
800 // reset spys |
863 // reset spys |
801 spyAboutToChange.clear(); |
864 spyAboutToChange.clear(); |
802 spyChanged.clear(); |
865 spyChanged.clear(); |
803 |
866 |
804 // second sort call, should use same timer appropriately |
867 // second sort call, should use same timer appropriately |
805 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
868 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
806 mTestObject->doSorting(Qt::DisplayRole, Qt::DescendingOrder); |
869 mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::DescendingOrder); |
807 QTest::qWait(500); |
870 QTest::qWait(500); |
808 QCOMPARE(spyAboutToChange.count(), 1); |
871 QCOMPARE(spyAboutToChange.count(), 1); |
809 QCOMPARE(spyChanged.count(), 1); |
872 QCOMPARE(spyChanged.count(), 1); |
810 QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole); |
873 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle); |
811 QCOMPARE(mTestObject->sortOrder(), Qt::DescendingOrder); |
874 QCOMPARE(mTestObject->sortOrder(), Qt::DescendingOrder); |
812 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
875 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
813 mTestObject->getSorting(sortingRole, sortingOrder); |
876 mTestObject->getSorting(sortingRole, sortingOrder); |
814 QCOMPARE(sortingRole, (int)Qt::DisplayRole); |
877 QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle); |
815 QCOMPARE(sortingOrder, Qt::DescendingOrder); |
878 QCOMPARE(sortingOrder, Qt::DescendingOrder); |
816 |
879 |
817 // reset spys |
880 // reset spys |
818 spyAboutToChange.clear(); |
881 spyAboutToChange.clear(); |
819 spyChanged.clear(); |
882 spyChanged.clear(); |
820 |
883 |
821 // double call without first letting timer to timeout |
884 // double call without first letting timer to timeout |
822 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
885 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
823 mTestObject->doSorting(Qt::DisplayRole, Qt::DescendingOrder); |
886 mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::DescendingOrder); |
824 mTestObject->doSorting(Qt::DisplayRole, Qt::AscendingOrder); |
887 mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::AscendingOrder); |
825 QTest::qWait(500); |
888 QTest::qWait(500); |
826 QCOMPARE(spyAboutToChange.count(), 1); |
889 QCOMPARE(spyAboutToChange.count(), 1); |
827 QCOMPARE(spyChanged.count(), 1); |
890 QCOMPARE(spyChanged.count(), 1); |
828 QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole); |
891 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle); |
829 QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder); |
892 QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder); |
830 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
893 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
831 mTestObject->getSorting(sortingRole, sortingOrder); |
894 mTestObject->getSorting(sortingRole, sortingOrder); |
832 QCOMPARE(sortingRole, (int)Qt::DisplayRole); |
895 QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle); |
833 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
896 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
834 |
897 |
835 spyAboutToChange.clear(); |
898 spyAboutToChange.clear(); |
836 spyChanged.clear(); |
899 spyChanged.clear(); |
837 |
900 |
838 // syncronous call checks |
901 // syncronous call checks |
839 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
902 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
840 mTestObject->doSorting(Qt::DisplayRole, Qt::DescendingOrder, false); |
903 mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::DescendingOrder, false); |
841 QCOMPARE(spyAboutToChange.count(), 1); |
904 QCOMPARE(spyAboutToChange.count(), 1); |
842 QCOMPARE(spyChanged.count(), 1); |
905 QCOMPARE(spyChanged.count(), 1); |
843 QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole); |
906 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle); |
844 QCOMPARE(mTestObject->sortOrder(), Qt::DescendingOrder); |
907 QCOMPARE(mTestObject->sortOrder(), Qt::DescendingOrder); |
845 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
908 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
846 mTestObject->getSorting(sortingRole, sortingOrder); |
909 mTestObject->getSorting(sortingRole, sortingOrder); |
847 QCOMPARE(sortingRole, (int)Qt::DisplayRole); |
910 QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle); |
848 QCOMPARE(sortingOrder, Qt::DescendingOrder); |
911 QCOMPARE(sortingOrder, Qt::DescendingOrder); |
849 |
912 |
850 spyAboutToChange.clear(); |
913 spyAboutToChange.clear(); |
851 spyChanged.clear(); |
914 spyChanged.clear(); |
852 |
915 |
853 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
916 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
854 mTestObject->doSorting(Qt::DisplayRole, Qt::AscendingOrder, false); |
917 mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::AscendingOrder, false); |
855 QCOMPARE(spyAboutToChange.count(), 1); |
918 QCOMPARE(spyAboutToChange.count(), 1); |
856 QCOMPARE(spyChanged.count(), 1); |
919 QCOMPARE(spyChanged.count(), 1); |
857 QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole); |
920 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle); |
858 QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder); |
921 QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder); |
859 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
922 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
860 mTestObject->getSorting(sortingRole, sortingOrder); |
923 mTestObject->getSorting(sortingRole, sortingOrder); |
861 QCOMPARE(sortingRole, (int)Qt::DisplayRole); |
924 QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle); |
862 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
925 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
863 |
926 |
864 spyAboutToChange.clear(); |
927 spyAboutToChange.clear(); |
865 spyChanged.clear(); |
928 spyChanged.clear(); |
866 |
929 |
867 // check that layout signals are not send if the sorting values don't change. |
930 // check that layout signals are not send if the sorting values don't change. |
868 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
931 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
869 mTestObject->doSorting(Qt::DisplayRole, Qt::AscendingOrder); |
932 mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::AscendingOrder); |
870 QCOMPARE(spyAboutToChange.count(), 0); |
933 QCOMPARE(spyAboutToChange.count(), 0); |
871 QCOMPARE(spyChanged.count(), 0); |
934 QCOMPARE(spyChanged.count(), 0); |
872 QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole); |
935 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle); |
873 QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder); |
936 QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder); |
874 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 0); |
937 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 0); |
875 mTestObject->getSorting(sortingRole, sortingOrder); |
938 mTestObject->getSorting(sortingRole, sortingOrder); |
876 QCOMPARE(sortingRole, (int)Qt::DisplayRole); |
939 QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle); |
877 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
940 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
878 |
941 |
879 spyAboutToChange.clear(); |
942 spyAboutToChange.clear(); |
880 spyChanged.clear(); |
943 spyChanged.clear(); |
881 |
944 |
904 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeySizeValue); |
967 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeySizeValue); |
905 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
968 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
906 mTestObject->getSorting(sortingRole, sortingOrder); |
969 mTestObject->getSorting(sortingRole, sortingOrder); |
907 QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeySizeValue); |
970 QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeySizeValue); |
908 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
971 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
909 |
972 |
910 |
|
911 spyAboutToChange.clear(); |
973 spyAboutToChange.clear(); |
912 spyChanged.clear(); |
974 spyChanged.clear(); |
|
975 |
|
976 // number of items role check |
|
977 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
|
978 mTestObject->doSorting(VideoCollectionCommon::KeyNumberOfItems, Qt::AscendingOrder); |
|
979 QTest::qWait(500); |
|
980 QCOMPARE(spyAboutToChange.count(), 1); |
|
981 QCOMPARE(spyChanged.count(), 1); |
|
982 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyNumberOfItems); |
|
983 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
|
984 mTestObject->getSorting(sortingRole, sortingOrder); |
|
985 QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyNumberOfItems); |
|
986 QCOMPARE(sortingOrder, Qt::AscendingOrder); |
|
987 |
|
988 spyAboutToChange.clear(); |
|
989 spyChanged.clear(); |
913 |
990 |
914 // invalid role call, sorting should be set to date |
991 // invalid role call, sorting should be set to date |
915 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
992 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
916 mTestObject->doSorting(Qt::DisplayRole - 100, Qt::AscendingOrder); |
993 mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos; |
|
994 mTestObject->doSorting(VideoCollectionCommon::KeyTitle - 100, Qt::AscendingOrder); |
917 QTest::qWait(500); |
995 QTest::qWait(500); |
918 QCOMPARE(spyAboutToChange.count(), 1); |
996 QCOMPARE(spyAboutToChange.count(), 1); |
919 QCOMPARE(spyChanged.count(), 1); |
997 QCOMPARE(spyChanged.count(), 1); |
920 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyDateTime); |
998 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyDateTime); |
921 spyAboutToChange.clear(); |
999 spyAboutToChange.clear(); |
922 spyChanged.clear(); |
1000 spyChanged.clear(); |
923 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
1001 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
|
1002 |
|
1003 // invalid role call, model type is categories, sorting should be set to VideoCollectionCommon::KeyTitle |
|
1004 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
|
1005 mTestObject->mType = VideoCollectionCommon::EModelTypeCollections; |
|
1006 mTestObject->doSorting(VideoCollectionCommon::KeyTitle - 100, Qt::AscendingOrder); |
|
1007 QTest::qWait(500); |
|
1008 QCOMPARE(spyAboutToChange.count(), 1); |
|
1009 QCOMPARE(spyChanged.count(), 1); |
|
1010 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle); |
|
1011 spyAboutToChange.clear(); |
|
1012 spyChanged.clear(); |
|
1013 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1); |
|
1014 |
|
1015 // sync sorting call for non -changing sort order (for coverity) |
|
1016 VideoThumbnailData::mStartBackgroundFetchingCallCount = 0; |
|
1017 mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos; |
|
1018 mTestObject->mIdleSortTimer = 0; |
|
1019 mTestObject->doSorting(VideoCollectionCommon::KeyTitle - 100, Qt::AscendingOrder, false); |
|
1020 spyAboutToChange.clear(); |
|
1021 spyChanged.clear(); |
|
1022 mTestObject->doSorting(VideoCollectionCommon::KeyTitle - 100, Qt::AscendingOrder, false); |
|
1023 QCOMPARE(spyAboutToChange.count(), 0); |
|
1024 QCOMPARE(spyChanged.count(), 0); |
|
1025 QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyDateTime); |
|
1026 spyAboutToChange.clear(); |
|
1027 spyChanged.clear(); |
|
1028 QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 2); |
924 } |
1029 } |
925 |
1030 |
926 // --------------------------------------------------------------------------- |
1031 // --------------------------------------------------------------------------- |
927 // testFilterAcceptsRow |
1032 // testFilterAcceptsRow |
928 // --------------------------------------------------------------------------- |
1033 // --------------------------------------------------------------------------- |
929 // |
1034 // |
930 void TestVideoSortFilterProxyModel::testFilterAcceptsRow() |
1035 void TestVideoSortFilterProxyModel::testFilterAcceptsRowVideos() |
931 { |
1036 { |
932 QWARN("tests for different model types are still missing"); |
1037 // source_parent can be anything, test model doesn't use it. |
933 |
1038 QModelIndex source_parent = QModelIndex(); |
934 QModelIndex index = QModelIndex(); // index can be anything, test model doesn't use it. |
|
935 |
1039 |
936 // Not initialized: no rouce model |
1040 // Not initialized: no rouce model |
937 QVERIFY(mTestObject->callFilterAcceptsRow(0, index) == false); |
1041 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false); |
938 |
1042 |
939 QVERIFY(mTestObject->initialize(mStubModel) == 0); |
1043 QVERIFY(mTestObject->initialize(mStubModel) == 0); |
940 mTestObject->open(3); |
1044 mTestObject->open(VideoCollectionCommon::ELevelVideos); |
|
1045 mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos; |
941 |
1046 |
942 // Test invalid row: below 0 |
1047 // Test invalid row: below 0 |
943 QVERIFY(mTestObject->callFilterAcceptsRow(-1, index) == false); |
1048 QVERIFY(mTestObject->callFilterAcceptsRow(-1, source_parent) == false); |
944 |
1049 |
945 // invalid row: larger than count |
1050 // invalid row: larger than count |
946 mStubModel->appendData("test"); |
1051 mStubModel->appendData("test"); |
947 QVERIFY(mTestObject->callFilterAcceptsRow(2, index) == false); |
1052 QVERIFY(mTestObject->callFilterAcceptsRow(2, source_parent) == false); |
948 |
1053 |
949 // correct row |
1054 // correct row |
950 QVERIFY(mTestObject->callFilterAcceptsRow(0, index) == true); |
1055 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true); |
951 |
1056 |
|
1057 // correct row, but id not corresponds video |
|
1058 mStubModel->removeAll(); |
|
1059 mStubModel->appendData(TMPXItemId(1, KVcxMvcMediaTypeCategory)); |
|
1060 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false); |
|
1061 |
|
1062 } |
|
1063 |
|
1064 // --------------------------------------------------------------------------- |
|
1065 // testFilterAcceptsNoVideoTypes |
|
1066 // --------------------------------------------------------------------------- |
|
1067 // |
|
1068 void TestVideoSortFilterProxyModel::testFilterAcceptsNoVideoTypes() |
|
1069 { |
|
1070 // source_parent can be anything, test model doesn't use it. |
|
1071 QModelIndex source_parent = QModelIndex(); |
|
1072 QVERIFY(mTestObject->initialize(mStubModel) == 0); |
|
1073 |
|
1074 // only one item at ondex 0 |
|
1075 mStubModel->appendData(TMPXItemId(1, KVcxMvcMediaTypeVideo)); |
|
1076 |
|
1077 // model type == VideoCollectionWrapper::ECollections |
|
1078 mTestObject->mType = VideoCollectionCommon::EModelTypeCollections; |
|
1079 // mLevel == VideoCollectionCommon::ELevelCategory, id.iId1 == KVcxMvcMediaTypeVideo |
|
1080 mTestObject->mLevel = VideoCollectionCommon::ELevelCategory; |
|
1081 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false); |
|
1082 // mLevel != VideoCollectionCommon::ELevelCategory |
|
1083 mTestObject->mLevel = VideoCollectionCommon::ELevelAlbum; |
|
1084 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false); |
|
1085 |
|
1086 // model type == VideoCollectionWrapper::ECollectionContent |
|
1087 mTestObject->mType = VideoCollectionCommon::EModelTypeCollectionContent; |
|
1088 // item belongs to album |
|
1089 VideoListDataModel::mBelongsToAlbum = true; |
|
1090 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true); |
|
1091 // item does not belong to album |
|
1092 VideoListDataModel::mBelongsToAlbum = false; |
|
1093 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false); |
|
1094 |
|
1095 // model type == VideoCollectionWrapper::EGeneric |
|
1096 mTestObject->mType = VideoCollectionCommon::EModelTypeGeneric; |
|
1097 mTestObject->mGenericFilterValue = true; |
|
1098 |
|
1099 // mLevel != VideoCollectionCommon::ELevelVideos && id.iId2 == KVcxMvcMediaTypeVideo |
|
1100 mTestObject->mLevel = VideoCollectionCommon::ELevelAlbum; |
|
1101 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false); |
|
1102 |
|
1103 // mLevel == VideoCollectionCommon::ELevelVideos && id.iId2 != KVcxMvcMediaTypeVideo |
|
1104 mTestObject->mLevel = VideoCollectionCommon::ELevelVideos; |
|
1105 mStubModel->removeAll(); |
|
1106 mStubModel->appendData(TMPXItemId(1, KVcxMvcMediaTypeCategory)); |
|
1107 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false); |
|
1108 |
|
1109 // mLevel == VideoCollectionCommon::ELevelVideos && id.iId2 == KVcxMvcMediaTypeVideo |
|
1110 mStubModel->removeAll(); |
|
1111 mStubModel->appendData(TMPXItemId(1, KVcxMvcMediaTypeVideo)); |
|
1112 // generic filter id == TMPXItemId::InvalidId() |
|
1113 mTestObject->mGenericFilterId = TMPXItemId::InvalidId(); |
|
1114 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true); |
|
1115 |
|
1116 // generic filter id == (KVcxMvcCategoryIdAll, KVcxMvcMediaTypeCategory) |
|
1117 mTestObject->mGenericFilterId = TMPXItemId(KVcxMvcCategoryIdAll, KVcxMvcMediaTypeCategory); |
|
1118 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true); |
|
1119 |
|
1120 // generic filter id == (100, KVcxMvcMediaTypeCategory) |
|
1121 mTestObject->mGenericFilterId = TMPXItemId(100, KVcxMvcMediaTypeCategory); |
|
1122 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false); |
|
1123 |
|
1124 // generic filter id == (KVcxMvcCategoryIdAll, KVcxMvcMediaTypeVideo) |
|
1125 mTestObject->mGenericFilterId = TMPXItemId(KVcxMvcCategoryIdAll, KVcxMvcMediaTypeVideo); |
|
1126 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false); |
|
1127 |
|
1128 // generic filter id == (100, KVcxMvcMediaTypeCategory) |
|
1129 VideoListDataModel::mBelongsToAlbum = true; |
|
1130 mTestObject->mGenericFilterId = TMPXItemId(100, KVcxMvcMediaTypeCategory); |
|
1131 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true); |
|
1132 |
|
1133 // generic filter id == (KVcxMvcCategoryIdAll, KVcxMvcMediaTypeVideo) |
|
1134 VideoListDataModel::mBelongsToAlbum = true; |
|
1135 mTestObject->mGenericFilterId = TMPXItemId(KVcxMvcCategoryIdAll, KVcxMvcMediaTypeVideo); |
|
1136 QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true); |
952 } |
1137 } |
953 |
1138 |
954 // --------------------------------------------------------------------------- |
1139 // --------------------------------------------------------------------------- |
955 // testGetMediaFilePathForId |
1140 // testGetMediaFilePathForId |
956 // --------------------------------------------------------------------------- |
1141 // --------------------------------------------------------------------------- |
997 // testResolveAlbumName |
1182 // testResolveAlbumName |
998 // --------------------------------------------------------------------------- |
1183 // --------------------------------------------------------------------------- |
999 // |
1184 // |
1000 void TestVideoSortFilterProxyModel::testResolveAlbumName() |
1185 void TestVideoSortFilterProxyModel::testResolveAlbumName() |
1001 { |
1186 { |
|
1187 mCollectionModel->mType = VideoCollectionCommon::EModelTypeCollections; |
|
1188 |
1002 QString name("test"); |
1189 QString name("test"); |
1003 QString resolved(""); |
1190 QString resolved(""); |
1004 // no model, same name can be used |
1191 // no model, same name can be used |
1005 resolved = mTestObject->resolveAlbumName(name); |
1192 resolved = mTestObject->resolveAlbumName(name); |
1006 QVERIFY(resolved.length()); |
1193 QVERIFY(resolved.length()); |
1007 QVERIFY(resolved == name); |
1194 QVERIFY(resolved == name); |
1008 |
1195 |
1009 mTestObject->initialize(mStubModel); |
1196 mTestObject->initialize(mStubModel); |
1010 |
1197 |
1011 // no collections proxy model, same name |
1198 // no collections proxy model, same name |
1012 resolved = mTestObject->resolveAlbumName(name); |
1199 resolved = mTestObject->resolveAlbumName(name); |
1013 QVERIFY(resolved.length()); |
1200 QVERIFY(resolved.length()); |
1014 QVERIFY(resolved == name); |
1201 QVERIFY(resolved == name); |
1015 |
|
1016 |
1202 |
1017 mCollectionModel->initialize(mStubModel); |
1203 mCollectionModel->initialize(mStubModel); |
1018 mCollectionModel->open(2); |
1204 mCollectionModel->open(VideoCollectionCommon::ELevelCategory); |
1019 VideoCollectionWrapper::instance().mProxyModel = mCollectionModel; |
1205 VideoCollectionWrapper::instance().mProxyModel = mCollectionModel; |
|
1206 |
|
1207 // collections proxy model exists, no source model |
|
1208 VideoListDataModel *temp = mTestObject->mModel; |
|
1209 mTestObject->mModel = 0; |
|
1210 |
|
1211 resolved = mTestObject->resolveAlbumName(name); |
|
1212 QVERIFY(resolved.length()); |
|
1213 QVERIFY(resolved == name); |
|
1214 mTestObject->mModel = temp; |
1020 |
1215 |
1021 mStubModel->appendData(TMPXItemId(1,2)); |
1216 mStubModel->appendData(TMPXItemId(1,2)); |
1022 mStubModel->appendData(name); |
1217 mStubModel->appendData(name); |
1023 |
1218 |
1024 int count = mCollectionModel->rowCount(); |
1219 int count = mCollectionModel->rowCount(); |
1096 // testGetOpenItem |
1292 // testGetOpenItem |
1097 // --------------------------------------------------------------------------- |
1293 // --------------------------------------------------------------------------- |
1098 // |
1294 // |
1099 void TestVideoSortFilterProxyModel::testGetOpenItem() |
1295 void TestVideoSortFilterProxyModel::testGetOpenItem() |
1100 { |
1296 { |
1101 // no collection client |
1297 // no model nor collection client |
1102 QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId()); |
1298 QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId()); |
1103 |
1299 |
1104 mTestObject->initialize(mStubModel); |
1300 mTestObject->initialize(mStubModel); |
|
1301 |
|
1302 // model exist, no collection client |
|
1303 VideoCollectionClient *tmpClient = mTestObject->mCollectionClient; |
|
1304 mTestObject->mCollectionClient = 0; |
|
1305 QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId()); |
|
1306 mTestObject->mCollectionClient = tmpClient; |
|
1307 |
|
1308 // no model, collection client exists |
|
1309 VideoListDataModel *tmpModel = mTestObject->mModel; |
|
1310 mTestObject->mModel = 0; |
|
1311 QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId()); |
|
1312 mTestObject->mModel = tmpModel; |
1105 |
1313 |
1106 // type neither EAllVideos or ECollectionContent |
1314 // type neither EAllVideos or ECollectionContent |
1107 QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId()); |
1315 QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId()); |
1108 |
1316 |
1109 TMPXItemId id; |
1317 TMPXItemId id; |
1110 // type EAllVideos |
1318 // type EAllVideos |
1111 delete mTestObject; |
1319 delete mTestObject; |
1112 mTestObject = new FilterProxyTester(VideoCollectionWrapper::EAllVideos); |
1320 mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeAllVideos); |
1113 mTestObject->initialize(mStubModel); |
1321 mTestObject->initialize(mStubModel); |
1114 id = mTestObject->getOpenItem(); |
1322 id = mTestObject->getOpenItem(); |
1115 QVERIFY(id != TMPXItemId::InvalidId()); |
1323 QVERIFY(id != TMPXItemId::InvalidId()); |
1116 QVERIFY(id.iId1 == KVcxMvcCategoryIdAll); |
1324 QVERIFY(id.iId1 == KVcxMvcCategoryIdAll); |
1117 QVERIFY(id.iId2 == KVcxMvcMediaTypeCategory); |
1325 QVERIFY(id.iId2 == KVcxMvcMediaTypeCategory); |
1118 |
1326 |
1119 // type ECollectionContent |
1327 // type ECollectionContent |
1120 delete mTestObject; |
1328 delete mTestObject; |
1121 mTestObject = new FilterProxyTester(VideoCollectionWrapper::ECollectionContent); |
1329 mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeCollectionContent); |
1122 mTestObject->initialize(mStubModel); |
1330 mTestObject->initialize(mStubModel); |
1123 id.iId1 = 1; |
1331 id.iId1 = 1; |
1124 id.iId2 = KVcxMvcMediaTypeAlbum; |
1332 id.iId2 = KVcxMvcMediaTypeAlbum; |
1125 mTestObject->openItem(id); |
1333 mTestObject->openItem(id); |
1126 id = TMPXItemId::InvalidId(); |
1334 id = TMPXItemId::InvalidId(); |
1127 id = mTestObject->getOpenItem(); |
1335 id = mTestObject->getOpenItem(); |
1128 QVERIFY(id != TMPXItemId::InvalidId()); |
1336 QVERIFY(id != TMPXItemId::InvalidId()); |
1129 QVERIFY(id.iId1 == 1); |
1337 QVERIFY(id.iId1 == 1); |
1130 QVERIFY(id.iId2 == KVcxMvcMediaTypeAlbum); |
1338 QVERIFY(id.iId2 == KVcxMvcMediaTypeAlbum); |
1131 |
|
1132 } |
1339 } |
1133 |
1340 |
1134 // --------------------------------------------------------------------------- |
1341 // --------------------------------------------------------------------------- |
1135 // testRemoveAlbums |
1342 // testRemoveAlbums |
1136 // --------------------------------------------------------------------------- |
1343 // --------------------------------------------------------------------------- |
1246 QVERIFY(index.isValid()); |
1453 QVERIFY(index.isValid()); |
1247 QVERIFY(index.row() == 0); |
1454 QVERIFY(index.row() == 0); |
1248 |
1455 |
1249 // other type |
1456 // other type |
1250 delete mTestObject; |
1457 delete mTestObject; |
1251 mTestObject = new FilterProxyTester(VideoCollectionWrapper::EAllVideos); |
1458 mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeAllVideos); |
1252 mTestObject->initialize(mStubModel); |
1459 mTestObject->initialize(mStubModel); |
1253 mTestObject->open(VideoCollectionCommon::ELevelVideos); |
1460 mTestObject->open(VideoCollectionCommon::ELevelVideos); |
1254 |
1461 |
1255 mTestObject->setGenericIdFilter(TMPXItemId(1,1), true); |
1462 mTestObject->setGenericIdFilter(TMPXItemId(1,1), true); |
1256 mTestObject->invalidate(); |
1463 mTestObject->invalidate(); |
1257 index = mTestObject->indexOfId(TMPXItemId(1,0)); |
1464 index = mTestObject->indexOfId(TMPXItemId(1,0)); |
1258 QVERIFY(index.isValid()); |
1465 QVERIFY(index.isValid()); |
1259 QVERIFY(index.row() == 0); |
1466 QVERIFY(index.row() == 0); |
1260 |
1467 } |
1261 } |
1468 |
1262 |
1469 // --------------------------------------------------------------------------- |
|
1470 // testRenameAlbum |
|
1471 // --------------------------------------------------------------------------- |
|
1472 // |
|
1473 void TestVideoSortFilterProxyModel::testSetAlbumInUse() |
|
1474 { |
|
1475 mStubModel->mAlbumInUse = TMPXItemId::InvalidId(); |
|
1476 |
|
1477 // no model |
|
1478 mTestObject->setAlbumInUse(TMPXItemId(1,2)); |
|
1479 QVERIFY(mStubModel->mAlbumInUse == TMPXItemId::InvalidId()); |
|
1480 |
|
1481 // model exists |
|
1482 mTestObject->initialize(mStubModel); |
|
1483 mTestObject->setAlbumInUse(TMPXItemId(1,2)); |
|
1484 QVERIFY(mStubModel->mAlbumInUse == TMPXItemId(1,2)); |
|
1485 } |
|
1486 |
|
1487 // --------------------------------------------------------------------------- |
|
1488 // testRenameAlbum |
|
1489 // --------------------------------------------------------------------------- |
|
1490 // |
|
1491 void TestVideoSortFilterProxyModel::testRenameAlbum() |
|
1492 { |
|
1493 delete mTestObject; |
|
1494 mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeAllVideos); |
|
1495 |
|
1496 // Not initialized. |
|
1497 TMPXItemId id = TMPXItemId::InvalidId(); |
|
1498 QString name = ""; |
|
1499 QVERIFY(mTestObject->renameAlbum(id, name) == -1); |
|
1500 |
|
1501 // Initialized. |
|
1502 mTestObject->initialize(mStubModel); |
|
1503 QVERIFY(mTestObject->renameAlbum(id, name) == 0); |
|
1504 } |
|
1505 |
|
1506 // --------------------------------------------------------------------------- |
|
1507 // testItemModifiedSlot |
|
1508 // --------------------------------------------------------------------------- |
|
1509 // |
|
1510 void TestVideoSortFilterProxyModel::testItemModifiedSlot() |
|
1511 { |
|
1512 connect(this, SIGNAL(testSignalMpxId(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &))); |
|
1513 |
|
1514 TMPXItemId id = TMPXItemId::InvalidId(); |
|
1515 mTestObject->initialize(mStubModel); |
|
1516 |
|
1517 // mType wrong |
|
1518 mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos; |
|
1519 emit testSignalMpxId(id); |
|
1520 |
|
1521 // invalid id |
|
1522 mTestObject->mType = VideoCollectionCommon::EModelTypeCollections; |
|
1523 |
|
1524 emit testSignalMpxId(id); |
|
1525 |
|
1526 // item is album |
|
1527 id = TMPXItemId(0, KVcxMvcMediaTypeAlbum); |
|
1528 emit testSignalMpxId(id); |
|
1529 |
|
1530 // item is category |
|
1531 id = TMPXItemId(0, KVcxMvcMediaTypeCategory); |
|
1532 emit testSignalMpxId(id); |
|
1533 |
|
1534 disconnect(this, SIGNAL(testSignalMpxId(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &))); |
|
1535 } |
1263 |
1536 |
1264 // End of file |
1537 // End of file |