From kde-commits Thu Jan 31 23:52:44 2008 From: Frederik Gladhorn Date: Thu, 31 Jan 2008 23:52:44 +0000 To: kde-commits Subject: KDE/kdeedu/parley/src Message-Id: <1201823564.938006.965.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120182357226807 SVN commit 769273 by gladhorn: Fix: Moving lessons around by dnd would delete them - removeRows automatically being called upon drop... M +1 -1 parley.cpp M +7 -5 vocabulary/containermodel.cpp M +1 -1 vocabulary/containermodel.h --- trunk/KDE/kdeedu/parley/src/parley.cpp #769272:769273 @@ -480,7 +480,7 @@ m_lessonModel = new ContainerModel(KEduVocLesson::Lesson, this); ///@todo remove before release -// new ModelTest(m_lessonModel, this); +// new ModelTest(m_lessonModel, this); m_lessonView->setModel(m_lessonModel); m_lessonView->setToolTip(i18n("Right click to add, delete, or rename lessons. \n" --- trunk/KDE/kdeedu/parley/src/vocabulary/containermodel.cpp #769272:769273 @@ -477,12 +477,12 @@ } // if it's internal, get the pointers - const ContainerMimeData * lessonData = + const ContainerMimeData * containerData = qobject_cast(data); - if (lessonData) { - foreach (KEduVocContainer* container, lessonData->containerList()) { + if (containerData) { + foreach (KEduVocContainer* container, containerData->containerList()) { // no way to move a word type to a lesson for now if (container->containerType() != m_container->containerType()) { return false; @@ -559,9 +559,11 @@ return false; } - +/* bool ContainerModel::removeRows(int row, int count, const QModelIndex & parent) { +// BIG FAT WARNING this code works, but it gets called by the drag and drop implementation automatically, so either this gets used or the other (dropMimeData) to remove the containers. If both are active, containers get deleted without warning or visible signs. + KEduVocContainer* parentContainer; if (!parent.internalPointer()) { parentContainer = m_container; @@ -579,9 +581,9 @@ return true; } +*/ - #include "containermodel.moc" --- trunk/KDE/kdeedu/parley/src/vocabulary/containermodel.h #769272:769273 @@ -93,7 +93,7 @@ * @param parent * @return */ - bool removeRows(int row, int count, const QModelIndex &parent); +// bool removeRows(int row, int count, const QModelIndex &parent); /** * Divide a lesson into smaller ones.