[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/parley/src
From:       Frederik Gladhorn <frederik.gladhorn () gmx ! de>
Date:       2008-01-31 23:52:44
Message-ID: 1201823564.938006.965.nullmailer () svn ! kde ! org
[Download RAW message or body]

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<const ContainerMimeData *>(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.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic