D6281: Prevent folders from drag and dropping onto themselves in dolphin main view

Henrik Fehlauer noreply at phabricator.kde.org
Fri Oct 27 18:31:39 BST 2017


rkflx added a comment.


  > adjusted tests for the pure virtual method.
  
  Compiling with GCC 5.4 (KDE Neon) and GCC 7.2 (openSUSE Tumbleweed) still does not succeed:
  
    src/tests/kstandarditemmodeltest.cpp:48:38: error: invalid new-expression of abstract class type ‘KStandardItemModel’
         m_model = new KStandardItemModel();
                                          ^
    In file included from src/tests/kstandarditemmodeltest.cpp:24:0:
    src/kitemviews/kstandarditemmodel.h:38:22: note:   because the following virtual functions are pure within ‘KStandardItemModel’:
     class DOLPHIN_EXPORT KStandardItemModel : public KItemModelBase
                          ^~~~~~~~~~~~~~~~~~
    In file included from src/kitemviews/kstandarditemmodel.h:24:0,
                     from src/tests/kstandarditemmodeltest.cpp:24:
    src/kitemviews/kitemmodelbase.h:193:18: note: 	virtual bool KItemModelBase::indexIsDir(int)
         virtual bool indexIsDir(int index) = 0;
                      ^~~~~~~~~~
  
  I'm wondering why this is working for you. Are you actually building the tests? Special compiler options, different distro? Note that in the end it also has to build on the various CI configs. Now I'm curious whether you will come up with something different than my patch :)
  
  > isn't returning const for objects that assigned by value kind of pointless since it's copied anyways?
  
  Are we talking about the same thing <https://en.wikipedia.org/wiki/Const_(computer_programming)#C++>? In general it is good practice to add `const` to a method's signature if it does not modify its object's member variables amongst other things. At the point of writing the method, it is not really relevant which assignment semantics somebody else is later going to choose.

REVISION DETAIL
  https://phabricator.kde.org/D6281

To: emateli, #dolphin, elvisangelaccio, ngraham, rkflx
Cc: rkflx, ngraham, elvisangelaccio, dfaure, anthonyfieroni, #konqueror, spoorun, navarromorales, firef, andrebarros, emmanuelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20171027/31aead11/attachment.htm>


More information about the kfm-devel mailing list