]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'Applications/17.04'
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 11 Jun 2017 17:33:36 +0000 (19:33 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 11 Jun 2017 17:33:36 +0000 (19:33 +0200)
* Applications/17.04:
  Change in "Open in new tab" feature in Dolphin
  Ignore drops-onto-items from invalid places items
  Revert "Increase smooth scrolling animation duration from 100 to 300 ms and set easing curve to InOutQuart"

17 files changed:
CMakeLists.txt
src/CMakeLists.txt
src/dolphincontextmenu.cpp
src/dolphincontextmenu.h
src/dolphinmainwindow.cpp
src/dolphinpart.desktop
src/dolphintabpage.h
src/kitemviews/kitemlistview.h
src/org.kde.dolphin.desktop
src/settings/kcm/kcmdolphingeneral.desktop
src/settings/kcm/kcmdolphinnavigation.desktop
src/settings/kcm/kcmdolphinservices.desktop
src/settings/kcm/kcmdolphinviewmodes.desktop
src/tests/CMakeLists.txt
src/tests/dolphinmainwindowtest.cpp [new file with mode: 0644]
src/tests/kfileitemmodeltest.cpp
src/tests/kitemlistselectionmanagertest.cpp

index 76a16607faf60d4494403a625f2509f61af9068e..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 "2")
+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 ce4cec80c5417af3084c9611e0638083325250ee..bc6f75d6280e02ab6f135b7a5963da85456e70f4 100644 (file)
@@ -193,7 +193,7 @@ install(FILES dolphinpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
 
 ##########################################
 
-set(dolphin_SRCS
+set(dolphinstatic_SRCS
     dolphindockwidget.cpp
     dolphinmainwindow.cpp
     dolphinviewcontainer.cpp
@@ -248,11 +248,10 @@ set(dolphin_SRCS
     statusbar/statusbarspaceinfo.cpp
     views/zoomlevelinfo.cpp
     dolphindebug.cpp
-    dbusinterface.cpp
     global.cpp
 )
 
-kconfig_add_kcfg_files(dolphin_SRCS GENERATE_MOC
+kconfig_add_kcfg_files(dolphinstatic_SRCS GENERATE_MOC
     panels/folders/dolphin_folderspanelsettings.kcfgc
     panels/information/dolphin_informationpanelsettings.kcfgc
     panels/places/dolphin_placespanelsettings.kcfgc
@@ -265,36 +264,44 @@ kconfig_add_kcfg_files(dolphin_SRCS GENERATE_MOC
 )
 
 if(NOT WIN32)
-   set(dolphin_SRCS ${dolphin_SRCS} panels/terminal/terminalpanel.cpp)
+   set(dolphinstatic_SRCS ${dolphinstatic_SRCS} panels/terminal/terminalpanel.cpp)
 endif()
 
-# Sets the icon on Windows and OSX
-file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
-ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS})
-
-kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
+add_library(dolphinstatic STATIC ${dolphinstatic_SRCS})
 
-target_include_directories(kdeinit_dolphin PRIVATE ${PHONON_INCLUDES})
-
-target_link_libraries(kdeinit_dolphin
+target_include_directories(dolphinstatic PRIVATE ${PHONON_INCLUDES})
+target_link_libraries(dolphinstatic
     dolphinprivate
-    KF5::Parts
     KF5::KCMUtils
-    KF5::Solid
-    KF5::CoreAddons
     KF5::DBusAddons
-    KF5::Bookmarks
     KF5::Notifications
     Phonon::phonon4qt5
 )
 
 if (KF5Activities_FOUND)
     target_link_libraries(
-        kdeinit_dolphin
+        dolphinstatic
         KF5::Activities
     )
 endif()
 
+set(dolphin_SRCS
+    dbusinterface.cpp
+    main.cpp
+)
+
+# Sets the icon on Windows and OSX
+file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
+ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS})
+
+kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
+
+
+target_link_libraries(kdeinit_dolphin
+    dolphinstatic
+    dolphinprivate
+)
+
 include(DbusInterfaceMacros)
 
 generate_and_install_dbus_interface(
index 890494ff8ac7ac37ea13b9d9c566a569cfdc32b1..05082df86207a1d9b313ba1f0084071275d88656 100644 (file)
@@ -283,7 +283,7 @@ void DolphinContextMenu::openItemContextMenu()
     fileItemActions.setItemListProperties(selectedItemsProps);
     addServiceActions(fileItemActions);
 
-    addFileItemPluginActions(fileItemActions);
+    fileItemActions.addPluginActionsTo(this);
 
     addVersionControlPluginActions();
 
@@ -355,7 +355,7 @@ void DolphinContextMenu::openViewportContextMenu()
     fileItemActions.setItemListProperties(baseUrlProperties);
     addServiceActions(fileItemActions);
 
-    addFileItemPluginActions(fileItemActions);
+    fileItemActions.addPluginActionsTo(this);
 
     addVersionControlPluginActions();
 
@@ -484,11 +484,6 @@ void DolphinContextMenu::addServiceActions(KFileItemActions& fileItemActions)
     fileItemActions.addServiceActionsTo(this);
 }
 
-void DolphinContextMenu::addFileItemPluginActions(KFileItemActions& fileItemActions)
-{
-    fileItemActions.addPluginActionsTo(this);
-}
-
 void DolphinContextMenu::addVersionControlPluginActions()
 {
     const DolphinView* view = m_mainWindow->activeViewContainer()->view();
index f67300dc1a820a729ab0eb8bb69dc47ccbb71717..ea68244e1a7e978dca9edbaa569a33238d1ae685 100644 (file)
@@ -123,11 +123,6 @@ private:
      */
     void addServiceActions(KFileItemActions& fileItemActions);
 
-    /**
-     * Adds actions that are provided by a KFileItemActionPlugin.
-     */
-    void addFileItemPluginActions(KFileItemActions& fileItemActions);
-
     /**
      * Adds actions that are provided by a KVersionControlPlugin.
      */
index 4b01272b7e2a372b7735b48f5afb3508a2a21d04..3d6f8489defecc2976509393a54e85c51b23f29d 100644 (file)
@@ -124,6 +124,7 @@ DolphinMainWindow::DolphinMainWindow() :
     setAcceptDrops(true);
 
     m_tabWidget = new DolphinTabWidget(this);
+    m_tabWidget->setObjectName("tabWidget");
     connect(m_tabWidget, &DolphinTabWidget::activeViewChanged,
             this, &DolphinMainWindow::activeViewChanged);
     connect(m_tabWidget, &DolphinTabWidget::tabCountChanged,
index da0a659d3d27ca9a9cce0d1802f8331e6edf1892..a0d7a96b245ea722912542678efc9bbceba01728 100644 (file)
@@ -71,6 +71,7 @@ Name[et]=Ikoonid
 Name[fi]=Kuvakkeet
 Name[fr]=Icônes
 Name[gl]=Iconas
+Name[he]=סמלים
 Name[hu]=Ikonok
 Name[ia]=Icones
 Name[id]=Ikon
@@ -118,6 +119,7 @@ Name[et]=Kompaktne
 Name[fi]=Tiivis
 Name[fr]=Concis
 Name[gl]=Compacta
+Name[he]=קומפקטי
 Name[hu]=Kompakt
 Name[ia]=Compacte
 Name[id]=Sederhana
@@ -165,6 +167,7 @@ Name[et]=Üksikasjad
 Name[fi]=Yksityiskohdat
 Name[fr]=Détails
 Name[gl]=Detalles
+Name[he]=פרטים
 Name[hu]=Részletek
 Name[ia]=Detalios
 Name[id]=Detail
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 63b72d966e9a4f6b7c9871415d5605ee7d442972..f187cef5867b8c50f5abade5bfd68e30491ace8d 100755 (executable)
@@ -62,6 +62,7 @@ GenericName[et]=Failihaldur
 GenericName[fi]=Tiedostonhallinta
 GenericName[fr]=Gestionnaire de fichiers
 GenericName[gl]=Xestor de ficheiros
+GenericName[he]=מנהל קבצים
 GenericName[hu]=Fájlkezelő
 GenericName[ia]=Gerente de file
 GenericName[id]=Manajer Berkas
index 556231e4433965f6fcd13f3adf28d29f10eaeda7..eb9809bb82bfe4faa51ded46bfa4a01255218555 100644 (file)
@@ -108,6 +108,7 @@ Name[et]=Üldine
 Name[fi]=Yleiset
 Name[fr]=Général
 Name[gl]=Xerais
+Name[he]=כללי
 Name[hu]=Általános
 Name[ia]=General
 Name[id]=Umum
@@ -191,6 +192,7 @@ X-KDE-Keywords[et]=failihaldur
 X-KDE-Keywords[fi]=tiedostonhallinta
 X-KDE-Keywords[fr]=gestionnaire de fichiers
 X-KDE-Keywords[gl]=xestor de ficheiros
+X-KDE-Keywords[he]=מנהל קבצים
 X-KDE-Keywords[hu]=fájlkezelő
 X-KDE-Keywords[ia]=gerente de file
 X-KDE-Keywords[id]=manajer berkas
index 9280624d61ed146c880c46fb10a43d84db78e61e..238f5d2669bb2fe1ca07d0e9c4933c7cb9945ca9 100644 (file)
@@ -107,6 +107,7 @@ Name[et]=Liikumine
 Name[fi]=Selaus
 Name[fr]=Navigation
 Name[gl]=Navegación
+Name[he]=ניווט
 Name[hu]=Navigálás
 Name[ia]=Navigation
 Name[id]=Navigasi
@@ -192,6 +193,7 @@ X-KDE-Keywords[et]=failihaldur
 X-KDE-Keywords[fi]=tiedostonhallinta
 X-KDE-Keywords[fr]=gestionnaire de fichiers
 X-KDE-Keywords[gl]=xestor de ficheiros
+X-KDE-Keywords[he]=מנהל קבצים
 X-KDE-Keywords[hu]=fájlkezelő
 X-KDE-Keywords[ia]=gerente de file
 X-KDE-Keywords[id]=manajer berkas
index 42e0538fa956f80459049ae6975ee65ecd71f6e7..0b41019a8293031491ea173459090a2c7ce5344f 100644 (file)
@@ -66,6 +66,7 @@ Name[et]=Teenused
 Name[fi]=Palvelut
 Name[fr]=Services
 Name[gl]=Servizos
+Name[he]=שירותים
 Name[hu]=Szolgáltatások
 Name[ia]=Servicios
 Name[id]=Layanan
@@ -149,6 +150,7 @@ X-KDE-Keywords[et]=failihaldur
 X-KDE-Keywords[fi]=tiedostonhallinta
 X-KDE-Keywords[fr]=gestionnaire de fichiers
 X-KDE-Keywords[gl]=xestor de ficheiros
+X-KDE-Keywords[he]=מנהל קבצים
 X-KDE-Keywords[hu]=fájlkezelő
 X-KDE-Keywords[ia]=gerente de file
 X-KDE-Keywords[id]=manajer berkas
index 0be2656a010c586063195f9e08f754592a7e70ba..41062deff1b934a0f75e6a028fbb66ec7f1d6d72 100644 (file)
@@ -191,6 +191,7 @@ X-KDE-Keywords[et]=failihaldur
 X-KDE-Keywords[fi]=tiedostonhallinta
 X-KDE-Keywords[fr]=gestionnaire de fichiers
 X-KDE-Keywords[gl]=xestor de ficheiros
+X-KDE-Keywords[he]=מנהל קבצים
 X-KDE-Keywords[hu]=fájlkezelő
 X-KDE-Keywords[ia]=gerente de file
 X-KDE-Keywords[id]=manajer berkas
index c7159bf1bcf11f830fd2de599aba6796e4b05617..1c2335cbfde2dc59a9785ab40a133351c098bb02 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
+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
+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
+TEST_NAME kfileitemmodeltest
+LINK_LIBRARIES dolphinprivate dolphinstatic 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
+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
+  TEST_NAME dolphinsearchboxtest
+  LINK_LIBRARIES dolphinprivate dolphinstatic 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
+TEST_NAME kstandarditemmodeltest
+LINK_LIBRARIES dolphinprivate dolphinstatic 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
+TEST_NAME viewpropertiestest
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
+
+# DolphinMainWindowTest
+ecm_add_test(dolphinmainwindowtest.cpp
+TEST_NAME dolphinmainwindowtest
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
diff --git a/src/tests/dolphinmainwindowtest.cpp b/src/tests/dolphinmainwindowtest.cpp
new file mode 100644 (file)
index 0000000..be86c50
--- /dev/null
@@ -0,0 +1,69 @@
+/***************************************************************************
+ *   Copyright (C) 2017 by Elvis Angelaccio <elvis.angelaccio@kde.org>     *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
+ ***************************************************************************/
+
+#include "dolphinmainwindow.h"
+#include "dolphintabpage.h"
+#include "dolphintabwidget.h"
+#include "dolphinviewcontainer.h"
+
+#include <QTest>
+
+class DolphinMainWindowTest : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void init();
+    void testClosingTabsWithSearchBoxVisible();
+
+private:
+    QScopedPointer<DolphinMainWindow> m_mainWindow;
+};
+
+void DolphinMainWindowTest::init()
+{
+    m_mainWindow.reset(new DolphinMainWindow());
+}
+
+// See https://bugs.kde.org/show_bug.cgi?id=379135
+void DolphinMainWindowTest::testClosingTabsWithSearchBoxVisible()
+{
+    m_mainWindow->openDirectories({ QUrl::fromLocalFile(QDir::homePath()) }, false);
+    m_mainWindow->show();
+    // Without this call the searchbox doesn't get FocusIn events.
+    QTest::qWaitForWindowExposed(m_mainWindow.data());
+    QVERIFY(m_mainWindow->isVisible());
+
+    auto tabWidget = m_mainWindow->findChild<DolphinTabWidget*>("tabWidget");
+    QVERIFY(tabWidget);
+
+    // Show search box on first tab.
+    tabWidget->currentTabPage()->activeViewContainer()->setSearchModeEnabled(true);
+
+    tabWidget->openNewActivatedTab(QUrl::fromLocalFile(QDir::homePath()));
+    QCOMPARE(tabWidget->count(), 2);
+
+    // Triggers the crash in bug #379135.
+    tabWidget->closeTab();
+    QCOMPARE(tabWidget->count(), 1);
+}
+
+QTEST_MAIN(DolphinMainWindowTest)
+
+#include "dolphinmainwindowtest.moc"
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");