┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests
AgeCommit message (Collapse)Author
2012-02-13Test which items are activated when pressing Enter or ReturnFrank Reininghaus
The ViewState struct gets a new bool member to indicate if the selected items should have been activated after the last event or not. One could argue that adding a bool parameter to the constructor is not optimal, but I think adding an enum is not really worth the effort because the struct is not used outside this unit test. Moreover, I could not think of a good name for the enum type and its values. (cherry picked from commit 307cca7b31b998fb7e8af0478a8e97e53bdc059c)
2012-02-13Fix regression in KItemListControllerTestFrank Reininghaus
Since commit 66ce4db4879cd80b2dcb6d65a0c74599c5e5f0ba, enabling or disabling groupling may change the number of columns in the view. Therefore, the test should first change the "grouping" setting and then change the view geometry to make sure that the column count is correct. (cherry picked from commit 61390b201acae2d8eea94fefc947977a8799af85)
2012-02-05Replace setExpanded(const QSet<KUrl>&) by expandParentItems(const KUrl&)Frank Reininghaus
The use case of this function (Folders Panel) requires the expansion of the parent items of a single URL, so it's not needed to handle a full set of URLs in this function. Moreover, the issue that not only the parents, but also the URLs themselves were expanded is fixed by this commit. (cherry picked from commit 89082ca391807abdc26d8985efe6b4c27183a9b1)
2012-02-04Simplify KItemListControllerTest::testKeyboardNavigation_data()Frank Reininghaus
Function-static variables do not help much in a function which is called exactly once. (cherry picked from commit 847c8ebfd3259a6f090db7451dd3350c6e01e0d2)
2012-02-01First version of a unit test for KItemListControllerFrank Reininghaus
At the moment, only key press events are tested, and the current item and selection after the event are verified. Moreover, this commit makes sure that KItemListController::keyPressEvent() really does not select anything if the selection mode is NoSelection. (cherry picked from commit 7457f4868cf0bc83e8a90ce5693292378f3d07c4)
2012-01-15fix build of tests on windowsPatrick Spendrin
2012-01-05Temporary skip 2 unit-tests in KFileItemModelPeter Penz
KFileItemModel::resortAllItems() always emits a itemsMoved() signal since some time. Before blindly adjusting the tests lets discuss first whether resortAllItems() should be used in this context.
2011-12-23Introduce "isExpandable" rolePeter Penz
The role is used to determine whether a directory can be expanded at all. This is e.g. not the case if a directory has 0 items or the target-URL is different from the item-URL. The expansion toggle will get hidden if a directory is not expandable. CCBUG: 288521
2011-12-14Improve private method KFileItemModel::expansionLevelsCompare()Peter Penz
Get rid of the hack to access the m_itemData member for getting the parent of an item during sorting. ItemData has been extended by a parent-member which allows a fast and save way to do this. Sadly this makes the unit-test for expansionLevelsCompare() more complex and it has been temporary deactivated. I'll take care to fix this during the next week.
2011-12-04Fix crash #1 when filtering itemsPeter Penz
When filtering items it was possible that the current index got an invalid value which resulted in accessing the URL of a null-KFileItem. There is still one (general) open issue in KFileItemModelRolesUpdater (crash #2) where a KFileItem that is already null gets read. It is not really related to filtering but can be triggered quite easy when filtering huge directories with enabled previews. CCBUG: 287642
2011-11-30Reimplement name-filteringPeter Penz
The filtering of items has not been implemented yet in the KFileItemModel of the new view-engine. The patch brings back this functionality again, but some minor issues are open: - When filtering trees expanded directories should only get hidden if no child is visible - Regular expressions are not supported yet (they have not been supported in Dolphin 1.x but it is now quite simple to implement). - When filtering previews and removing the filter it might be possible that the preview is not shown (is most probably an an already existing bug in KFileItemModelRolesUpdater). BUG: 287642 FIXED-IN: 4.8.0
2011-11-24Fix restoring expanded URLsFrank Reininghaus
When navigating back or forward in history, DolphinView tells the KFileItemModel about the expanded URLs which should be restored before the folder is entered. In this case, the algorithm in the new function KFileItemModel::setExpanded(const QSet<KUrl>&) does not work. To fix this, the old function KFileItemModel::restoreExpandedUrls(const QSet<KUrl>&) is restored. Unit test included.
2011-11-20Initial draft for bringing back the "Folders" panelPeter Penz
The folders panel has been adjusted to use the new view-engine. A lot of things don't work yet, but are mostly minor issues that should be fixable during the next 10 days.
2011-10-31Internal KFileItemModel optimizations and cleanupsPeter Penz
- Use merge-sort instead of quick-sort. This assures a sane worst-case scenario where quick-sort has a runtime complexity of O(n*n) (e.g. when changing the sort-order from ascending to descending). - lessThan()-improvements: Change internal data-structures to allow a comparison of any role, not only roles available in KFileItem - Don't synchronously move an item if the value has been changed of a role defined as sort-role: This is too expensive in case if e.g. the sorting is done by "type" and the type is determined step by step.
2011-10-30Fix sorting-issues when value of a sort-role has been changedPeter Penz
If the value of a sort-role has been changed, emitting the signal itemsChanged() is not sufficient as from the KItemModelBase point of view an item has been moved or deleted/reinserted. Corresponding to the unit-test KFileItemModel::setData() respects this case correctly now, however there are some minor visual animation issues left that (hopefully) should not be tricky to solve.
2011-10-15Interface cleanups to prepare the return of "grouped sorting"Peter Penz
- Rename setCategorizedSorting() to setGroupedSorting() - Change the model interface to allow enabling/disabling grouping without the need to declare a role (the sort role will be taken). - Add dummy group role implementation in KFileItemModel The grouping code itself requires some cleanups and might crash at the moment or lead to weird layouts.
2011-10-03Add function KItemListSelectionManager::isSelected(int index)Frank Reininghaus
This function is used in KItemListView::updateWidgetProperties() to find out if an item is selected in a more efficient way. The new function is tested in KItemListSelectionManagerTest. I've factored out some code from KItemListSelectionManagerTest::testChangeSelection() to a new member to simplify the test.
2011-09-29Keep current item and selection when resorting, part 1Frank Reininghaus
KFileItemModel now emits the itemsMoved signal when the model is resorted, and KItemListSelectionManager has a new function itemsMoved() which will be called indirectly when this signal is emitted. Unit tests for the new functionality are included. The following things are still needed to make the feature work: 1. KFileItemMdel::resortAllItems() should not emit itemsAdded/itemsRemoved any more. 2. KItemListView::itemsMoved() must update the view according to the changes in the model, and it must call KItemListSelectionManager::itemsMoved().
2011-09-18Implement 'Sort By Size'Frank Reininghaus
It only works for files so far. The sorting of folders by the number of items is more tricky to get right because this number is retrieved asynchronously by KFileItemModelRolesUpdater.
2011-09-18Implement some missing sorting optionsFrank Reininghaus
Changing the sort order and enabling/disabling the "Sort Folders First" option works now.
2011-09-17Implement restoring expanded folders in Details ViewFrank Reininghaus
2011-08-30KItemListKeyboardSearchManager improvements and unit testsFrank Reininghaus
This commit implements a 'repeated key search' feature, similar to QAbstractItemView, and adds unit tests for keyboard searching.
2011-08-27Remove unneded function KItemListSelectionManager::anchorItem()Frank Reininghaus
2011-08-26Simplify KItemListSelectionManagerFrank Reininghaus
1. The anchorChanged() signal is not needed. 2. The only place where setAnchorItem() is called is in beginAnchoredSelection() -> merge both functions.
2011-08-26Fix issue that removing an item is not recognizedPeter Penz
Thanks to Tirtha Chatterjee for the patch! REVIEW: 102435
2011-08-24Fix issues with the anchor selectionPeter Penz
Don't change the selection if the anchor is invalid. This fixes the issue that items might get selected during changing a directory.
2011-08-15Add unit test for expanding folders in KFileItemModelFrank Reininghaus
2011-08-15Fix for KFileItemModel::expansionLevelsCompareFrank Reininghaus
Before this commit, expanding and collapsing folders in the details view would lead to strange results in a folder with the items "a", "a/a/", "a/a/1", "a/a-1/", and "a/a-1/1". The problem was that the comparison between "a/a/1" and "a/a-1/1" went wrong: the first character in which the paths differ is a "/" in one of the items, such that the code that reduces this 'index' in KFileItemModel::expansionLevelsCompare in order to find the 'common path' did nothing because it checked that only *one* of the two items does not have an "/" at the position 'index'.
2011-08-14Two small selection improvements in DolphinViewFrank Reininghaus
1. Implement DolphinView::clearSelection(). 2. Simplify DolphinView::invertSelection(). I found, fixed, and unit-tested a bug in the selection manager which was uncovered by this change.
2011-08-13Implement selection of items using mouse clicks.Frank Reininghaus
2011-08-11Test signal emission on selection changesFrank Reininghaus
This commit adds a unit test that changes the selection in various ways, verifies the result and checks that the selection manager's selectionChanged signal has been emitted correctly. The test is data-driven, so I hope that most further testing needs can be fulfilled by adding new test data. Moreover, I changed selectedItems() such that the anchored selection is only taken into account if anchor and current item are different. The reason is that in some situation the anchor should not be selected initially (i.e., if an already selected item is Control-clicked). If the anchor should be selected from the beginning, it must be selected manually.
2011-08-11Emit KitemListSelectionManager's selectionChanged signal correctlyFrank Reininghaus
This commit makes sure that the signal is emitted with the correct current and previous selection after a selection change, and that the signal is emitted exactly once in KItemListSelectionManager::itemsInserted and KItemListSelectionManager::itemsRemoved.
2011-08-10Implement beginAnchoredSelection() and endAnchoredSelection().Frank Reininghaus
Unit test included.
2011-08-10Always use the 'Select' mode for anchored selectionsFrank Reininghaus
In Dolphin, we don't actually use the 'Deselect' and 'Toggle' modes for anchored selections, so we can just remove these modes and always use 'Select' to reduce code complexity.
2011-08-10Initial support for anchored selections in the selection managerFrank Reininghaus
2011-08-10Update the anchor item when items are added or removedFrank Reininghaus
If items are added or removed in the model, not only the current item, but also the anchor item, which is the starting point for any selections via Shift+Click or Shift+Key, needs to be updated. BUG: 262638 FIXED-IN: 4.8.0
2011-08-09Test setting the current item and anchor itemFrank Reininghaus
2011-08-09Improvements for selections, smooth scrolling, tooltips and info-panelPeter Penz
2011-07-30Merged very early alpha-version of Dolphin 2.0Peter Penz
Dolphin 2.0 will get a new view-engine with the following improvements: - Better performance - Animated transitions - No clipped filenames due to dynamic item-sizes - Grouping support for all view-modes - Non-rectangular selection areas - Simplified code for better maintenance More details will be provided in a blog-entry during the next days. Please note that the code is in a very early alpha-stage and although the most tricky parts have been implemented already very basic things like drag and drop or selections have not been pushed yet. Those things are rather trivial to implement but this still will take some time.
2011-06-09Wait longer for the selectionChanged signalFrank Reininghaus
The timeout for the selectionChanged signal is increased in DolphinViewTest_AllViewModes::verifySelectedItemsCount(). I hope that this will fix a part of the failures seen in http://my.cdash.org/testDetails.php?test=6350150&build=196639
2011-06-09Improve stability of DolphinView testsFrank Reininghaus
1. Fix possible test failure if hidden files are shown initially. 2. Fix possible test failure if a .directory file is created in the test directory. I think that this fixes the test failure from http://my.cdash.org/testDetails.php?test=6350151&build=196639
2011-05-26Don't try to build dolphinsearchboxtest if Nepomuk isn't found.Frank Reininghaus
2011-05-23Compile with QT_USE_FAST_OPERATOR_PLUSAlex Merry
2011-04-14SVN_SILENT Remove trailing white space.Frank Reininghaus
2011-04-14Improve stability of unit tests when running them with ValgrindFrank Reininghaus
I noticed unexpected unit test failures when running the tests with Valgrind. The reason was that test execution was slowed down a lot, such that that TestBase::waitForFinishedPathLoading() did not receive the view's signal within the default timeout of 2 seconds, and that this failure was not detected in every test -> the tests failed later on because not all expected items had been loaded yet. To fix this, I changed two things: 1. Added an assert in TestBase::waitForFinishedPathLoading() that checks if the signal has been received. Continuing does not make much sense if that is not the case. 2. Increased the default timeout to 20 seconds. The reason why there is a finite timeout at all is that I didn't want to waste too much time on machines where the file kioslave seems to have problems loading a directory (I've seen corresponding test logs at cdash.org). However, with the first change I mentioned above, the waiting time is lost only once (due to the assert) rather than every time a directory is loaded -> I think that the timeout increase does not lead to an increased waste of time on such machines.
2011-04-12Implement a cut/copy/paste unit test for DolphinView.Frank Reininghaus
2011-04-10Add unit test for bug 270437Frank Reininghaus
Verify that the current item and the scroll position of the view do not change if previews are turned off. Actually, the bug was in KFilePreviewGenerator, but it's easier to test this here.
2011-04-06Do not reload the DolphinView in the tests' initView() membersFrank Reininghaus
Rather than reloading the view after it is initilised, we just wait until the view emits its finishedPathLoading() signal. This saves some time when running the tests (at least on my system).
2011-04-05Remove a qWait(2000) which has been committed accidentally.Frank Reininghaus
This has been committed by accident in 06dd174f.
2011-04-05Add function TestBase::waitForFinishedPathLoading()Frank Reininghaus
Many tests have to wait until this signal is received from the DolphinView, so it is convenient to have a function that wraps the QTest::kWaitForSignal() call.