]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'Applications/17.04'
authorLuca Beltrame <lbeltrame@kde.org>
Mon, 22 May 2017 21:32:36 +0000 (23:32 +0200)
committerLuca Beltrame <lbeltrame@kde.org>
Mon, 22 May 2017 21:32:36 +0000 (23:32 +0200)
CMakeLists.txt
src/dolphintabpage.h
src/kitemviews/kitemlistview.h
src/tests/CMakeLists.txt
src/tests/kfileitemmodeltest.cpp
src/tests/kitemlistselectionmanagertest.cpp

index 717f3d6ae75d6c6066d89f08f413e07f4a02031d..080fc5fea060d148dcc5af7c918868e0c14d850f 100644 (file)
@@ -4,8 +4,8 @@ project(Dolphin)
 
 # KDE Application Version, managed by release script
 set (KDE_APPLICATIONS_VERSION_MAJOR "17")
-set (KDE_APPLICATIONS_VERSION_MINOR "04")
-set (KDE_APPLICATIONS_VERSION_MICRO "1")
+set (KDE_APPLICATIONS_VERSION_MINOR "07")
+set (KDE_APPLICATIONS_VERSION_MICRO "70")
 set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
 
 set(QT_MIN_VERSION "5.5.0")
index 45c540775fe127c73dc3d2c61b90862367d9901f..b8772602d15cf50b110494c23c0b2b585c698f34 100644 (file)
@@ -127,7 +127,7 @@ public:
      * @deprecated The first tab state version has no version number, we keep
      *             this method to restore old states (<= Dolphin 4.14.x).
      */
-    void restoreStateV1(const QByteArray& state);
+    Q_DECL_DEPRECATED void restoreStateV1(const QByteArray& state);
 
     /**
      * Set whether the tab page is active
index c93297c476da661d194f98820d50eeb0bd6d2c72..ed1199877f7ad9f4f5d17ccd7cab1e259b5738b9 100644 (file)
@@ -197,12 +197,13 @@ public:
     int lastVisibleIndex() const;
 
     /**
-     * @return Calculates the required size for all items in the model.
-     *         It might be larger than KItemListView::itemSize().
-     *         In this case the layout grid will be stretched to assure an
-     *         unclipped item.
-     *         NOTE: the logical height (width) is actually the
-     *         width (height) if the scroll orientation is Qt::Vertical!
+     * Calculates the required size for all items in the model.
+     * It might be larger than KItemListView::itemSize().
+     * In this case the layout grid will be stretched to assure an
+     * unclipped item.
+     *
+     * @note the logical height (width) is actually the
+     * width (height) if the scroll orientation is Qt::Vertical!
      */
     void calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint) const;
 
@@ -824,13 +825,13 @@ public:
     KItemListWidgetCreator();
     virtual ~KItemListWidgetCreator();
 
-    virtual KItemListWidget* create(KItemListView* view);
+    virtual KItemListWidget* create(KItemListView* view) Q_DECL_OVERRIDE;
 
-    virtual void calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const;
+    virtual void calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const Q_DECL_OVERRIDE;
 
     virtual qreal preferredRoleColumnWidth(const QByteArray& role,
                                            int index,
-                                           const KItemListView* view) const;
+                                           const KItemListView* view) const Q_DECL_OVERRIDE;
 private:
     KItemListWidgetInformant* m_informant;
 };
@@ -893,7 +894,7 @@ class KItemListGroupHeaderCreator : public KItemListGroupHeaderCreatorBase
 {
 public:
     virtual ~KItemListGroupHeaderCreator();
-    virtual KItemListGroupHeader* create(KItemListView* view);
+    virtual KItemListGroupHeader* create(KItemListView* view) Q_DECL_OVERRIDE;
 };
 
 template <class T>
index c7159bf1bcf11f830fd2de599aba6796e4b05617..f29ae53d42de215c8678cc0cf8e5470c2671752c 100644 (file)
 set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
 
 find_package(Qt5Test CONFIG REQUIRED)
-include(ECMMarkAsTest)
-
-# needed on windows to correctly use the files from dolphinprivate
-add_definitions(-DDOLPHIN_EXPORT=)
+include(ECMAddTests)
 
 # KItemSetTest
-set(kitemsettest_SRCS
-    kitemsettest.cpp
-)
-
-add_executable(kitemsettest ${kitemsettest_SRCS})
-add_test(kitemsettest kitemsettest)
-ecm_mark_as_test(kitemsettest)
-target_link_libraries(kitemsettest dolphinprivate Qt5::Test)
+ecm_add_test(kitemsettest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # KItemRangeTest
-set(kitemrangetest_SRCS
-    kitemrangetest.cpp
-)
-
-add_executable(kitemrangetest ${kitemrangetest_SRCS})
-add_test(kitemrangetest kitemrangetest)
-ecm_mark_as_test(kitemrangetest)
-target_link_libraries(kitemrangetest dolphinprivate Qt5::Test)
+ecm_add_test(kitemrangetest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 
 # KItemListSelectionManagerTest
-set(kitemlistselectionmanagertest_SRCS
-    kitemlistselectionmanagertest.cpp
-)
-
-add_executable(kitemlistselectionmanagertest ${kitemlistselectionmanagertest_SRCS})
-add_test(kitemlistselectionmanagertest kitemlistselectionmanagertest)
-ecm_mark_as_test(kitemlistselectionmanagertest)
-target_link_libraries(kitemlistselectionmanagertest dolphinprivate Qt5::Test)
+ecm_add_test(kitemlistselectionmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # KItemListControllerTest
-set(kitemlistcontrollertest_SRCS
-    kitemlistcontrollertest.cpp
-    testdir.cpp
-    ../dolphindebug.cpp
-)
 
 kconfig_add_kcfg_files(kitemlistcontrollertest_SRCS GENERATE_MOC
     ../settings/dolphin_generalsettings.kcfgc
 )
-
-add_executable(kitemlistcontrollertest ${kitemlistcontrollertest_SRCS})
-add_test(kitemlistcontrollertest kitemlistcontrollertest)
-ecm_mark_as_test(kitemlistcontrollertest)
-target_link_libraries(kitemlistcontrollertest dolphinprivate Qt5::Test)
+ecm_add_test(kitemlistcontrollertest.cpp testdir.cpp ../dolphindebug.cpp ${kitemlistcontrollertest_SRCS}
+TEST_NAME kitemlistcontrollertest
+LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # KFileItemListViewTest
-set(kfileitemlistviewtest_SRCS
-    kfileitemlistviewtest.cpp
-    testdir.cpp
-    ../dolphindebug.cpp
-)
-
 kconfig_add_kcfg_files(kfileitemlistviewtest_SRCS GENERATE_MOC
     ../settings/dolphin_generalsettings.kcfgc
 )
-
-add_executable(kfileitemlistviewtest ${kfileitemlistviewtest_SRCS})
-add_test(kfileitemlistviewtest kfileitemlistviewtest)
-ecm_mark_as_test(kfileitemlistviewtest)
-target_link_libraries(kfileitemlistviewtest dolphinprivate Qt5::Test)
+ecm_add_test(kfileitemlistviewtest.cpp testdir.cpp ../dolphindebug.cpp ${kfileitemlistviewtest_SRCS}
+TEST_NAME kfileitemlistviewtest
+LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # KFileItemModelTest
-set(kfileitemmodeltest_SRCS
-    kfileitemmodeltest.cpp
-    testdir.cpp
-    ../dolphindebug.cpp
-)
-
 kconfig_add_kcfg_files(kfileitemmodeltest_SRCS GENERATE_MOC
     ../settings/dolphin_generalsettings.kcfgc
 )
-
-add_executable(kfileitemmodeltest ${kfileitemmodeltest_SRCS})
-add_test(kfileitemmodeltest kfileitemmodeltest)
-ecm_mark_as_test(kfileitemmodeltest)
-target_link_libraries(kfileitemmodeltest dolphinprivate Qt5::Test)
+ecm_add_test(kfileitemmodeltest.cpp testdir.cpp ../dolphindebug.cpp ${kfileitemmodeltest_SRCS}
+TEST_NAME kfileitemmodeltest
+LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # KFileItemModelBenchmark
-set(kfileitemmodelbenchmark_SRCS
-    kfileitemmodelbenchmark.cpp
-    testdir.cpp
-    ../dolphindebug.cpp
-)
-
 kconfig_add_kcfg_files(kfileitemmodelbenchmark_SRCS GENERATE_MOC
     ../settings/dolphin_generalsettings.kcfgc
 )
-
-add_executable(kfileitemmodelbenchmark ${kfileitemmodelbenchmark_SRCS})
-ecm_mark_as_test(kfileitemmodelbenchmark)
-target_link_libraries(kfileitemmodelbenchmark dolphinprivate Qt5::Test)
+ecm_add_test(kfileitemmodelbenchmark.cpp testdir.cpp ../dolphindebug.cpp ${kfileitemmodelbenchmark_SRCS}
+TEST_NAME kfileitemmodelbenchmark
+LINK_LIBRARIES  dolphinprivate Qt5::Test)
 
 # KItemListKeyboardSearchManagerTest
-set(kitemlistkeyboardsearchmanagertest_SRCS
-    kitemlistkeyboardsearchmanagertest.cpp
-)
-
-add_executable(kitemlistkeyboardsearchmanagertest ${kitemlistkeyboardsearchmanagertest_SRCS})
-add_test(kitemlistkeyboardsearchmanagertest kitemlistkeyboardsearchmanagertest)
-ecm_mark_as_test(kitemlistkeyboardsearchmanagertest)
-target_link_libraries(kitemlistkeyboardsearchmanagertest dolphinprivate Qt5::Test)
+ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # DolphinSearchBox
 if (KF5Baloo_FOUND)
-  set(dolphinsearchboxtest_SRCS
-      dolphinsearchboxtest.cpp
-      ../search/dolphinfacetswidget.cpp
-      ../search/dolphinsearchbox.cpp
-  )
   kconfig_add_kcfg_files(dolphinsearchboxtest_SRCS
       ../search/dolphin_searchsettings.kcfgc
   )
-
-  add_executable(dolphinsearchboxtest ${dolphinsearchboxtest_SRCS})
-  add_test(dolphinsearchboxtest dolphinsearchboxtest)
-  ecm_mark_as_test(dolphinsearchboxtest)
-  target_link_libraries(dolphinsearchboxtest dolphinprivate Qt5::Test)
+  ecm_add_test(dolphinsearchboxtest.cpp ../search/dolphinfacetswidget.cpp ../search/dolphinsearchbox.cpp ${dolphinsearchboxtest_SRCS}
+  TEST_NAME dolphinsearchboxtest
+  LINK_LIBRARIES dolphinprivate Qt5::Test)
 endif()
 
 # KStandardItemModelTest
-set(kstandarditemmodeltest_SRCS
-    kstandarditemmodeltest.cpp
-    ../dolphindebug.cpp
-)
-
-add_executable(kstandarditemmodeltest ${kstandarditemmodeltest_SRCS})
-add_test(kstandarditemmodeltest kstandarditemmodeltest)
-ecm_mark_as_test(kstandarditemmodeltest)
-target_link_libraries(kstandarditemmodeltest dolphinprivate Qt5::Test)
+ecm_add_test(kstandarditemmodeltest.cpp ../dolphindebug.cpp
+TEST_NAME kstandarditemmodeltest
+LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # ViewPropertiesTest
-set(viewpropertiestest_SRCS
-    viewpropertiestest.cpp
-    testdir.cpp
-    ../dolphindebug.cpp
-)
 kconfig_add_kcfg_files(viewpropertiestest_SRCS GENERATE_MOC
   ../settings/dolphin_generalsettings.kcfgc
   ../settings/dolphin_directoryviewpropertysettings.kcfgc
 )
-
-add_executable(viewpropertiestest ${viewpropertiestest_SRCS})
-add_test(viewpropertiestest viewpropertiestest)
-ecm_mark_as_test(viewpropertiestest)
-target_link_libraries(viewpropertiestest dolphinprivate Qt5::Test)
+ecm_add_test(viewpropertiestest.cpp testdir.cpp ../dolphindebug.cpp ${viewpropertiestest_SRCS}
+TEST_NAME viewpropertiestest
+LINK_LIBRARIES dolphinprivate Qt5::Test)
index 59ff63069b47eed1869b9ffbb77458e6ab4cd401..b8e089530db9380d03457c567cf9298b11f5ba9a 100644 (file)
@@ -135,10 +135,11 @@ void KFileItemModelTest::cleanup()
 void KFileItemModelTest::testDefaultRoles()
 {
     const QSet<QByteArray> roles = m_model->roles();
-    QCOMPARE(roles.count(), 3);
+    QCOMPARE(roles.count(), 4);
     QVERIFY(roles.contains("text"));
     QVERIFY(roles.contains("isDir"));
     QVERIFY(roles.contains("isLink"));
+    QVERIFY(roles.contains("isHidden"));
 }
 
 void KFileItemModelTest::testDefaultSortRole()
index 18a79bd3f3c1c01bf3eb373d061351d641e4c5aa..48e8dce04d6f6bb0c3efd4f54fed83f60c8580f8 100644 (file)
@@ -335,27 +335,26 @@ Q_DECLARE_METATYPE(QList<int>)
  *
  * The test is data-driven and takes the following arguments:
  *
- * \param initialSelection  The selection at the beginning.
- * \param anchor            This item will be the anchor item.
- * \param current           This item will be the current item.
- * \param expectedSelection Expected selection after anchor and current are set.
- * \param changeType        Type of the change that is done then:
- *                          - NoChange
- *                          - InsertItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsInserted()
- *                          - RemoveItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsRemoved()
- *                          - MoveItems   -> data.at(0) provides the KItemRange containing the original indices,
- *                                           data.at(1) provides the list containing the new indices
- *                                          \sa KItemListSelectionManager::itemsMoved(), KItemModelBase::itemsMoved()
- *                          - EndAnchoredSelection
- *                          - SetSelected -> data.at(0) provides the index where the selection process starts,
- *                                           data.at(1) provides the number of indices to be selected,
- *                                           data.at(2) provides the selection mode.
- *                                          \sa KItemListSelectionManager::setSelected()
- * \param data              A list of QVariants which will be cast to the arguments needed for the chosen ChangeType (see above).
- * \param finalSelection    The expected final selection.
+ * param initialSelection  The selection at the beginning.
+ * param anchor            This item will be the anchor item.
+ * param current           This item will be the current item.
+ * param expectedSelection Expected selection after anchor and current are set.
+ * param changeType        Type of the change that is done then:
+ *                        - NoChange
+ *                        - InsertItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsInserted()
+ *                        - RemoveItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsRemoved()
+ *                        - MoveItems   -> data.at(0) provides the KItemRange containing the original indices,
+ *                                         data.at(1) provides the list containing the new indices
+ *                                        \sa KItemListSelectionManager::itemsMoved(), KItemModelBase::itemsMoved()
+ *                        - EndAnchoredSelection
+ *                        - SetSelected -> data.at(0) provides the index where the selection process starts,
+ *                                         data.at(1) provides the number of indices to be selected,
+ *                                         data.at(2) provides the selection mode.
+ *                                        \sa KItemListSelectionManager::setSelected()
+ * param data              A list of QVariants which will be cast to the arguments needed for the chosen ChangeType (see above).
+ * param finalSelection    The expected final selection.
  *
  */
-
 void KItemListSelectionManagerTest::testChangeSelection_data()
 {
     QTest::addColumn<KItemSet>("initialSelection");