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

List:       kde-commits
Subject:    kdebase/kmenuedit
From:       Waldo Bastian <bastian () kde ! org>
Date:       2005-03-17 16:44:05
Message-ID: 20050317164405.7E1861853F () office ! kde ! org
[Download RAW message or body]

CVS commit by waba: 

Fix the following move sequence:
/A -> /B/A
/B -> /C/B
/C/B/A -> /A


  M +12 -0     menuinfo.cpp   1.14
  M +3 -0      menuinfo.h   1.6
  M +1 -1      treeview.cpp   1.96


--- kdebase/kmenuedit/treeview.cpp  #1.95:1.96
@@ -787,5 +787,5 @@ void TreeView::slotDropped (QDropEvent *
 
          // update fileInfo data
-         folderInfo->fullId = parentFolderInfo->fullId + folderInfo->id;
+         folderInfo->updateFullId(parentFolderInfo->fullId);
          folderInfo->setInUse(true);
          parentFolderInfo->add(folderInfo);

--- kdebase/kmenuedit/menuinfo.cpp  #1.13:1.14
@@ -76,4 +76,16 @@ bool MenuFolderInfo::takeRecursive(MenuF
 }
 
+// Recursively update all fullIds
+void MenuFolderInfo::updateFullId(const QString &parentId)
+{
+   fullId = parentId + id;
+
+   for(MenuFolderInfo *subFolderInfo = subFolders.first();
+       subFolderInfo; subFolderInfo = subFolders.next())
+   {
+      subFolderInfo->updateFullId(fullId);
+   }
+}
+
 // Add entry
 void MenuFolderInfo::add(MenuEntryInfo *entry, bool initial)

--- kdebase/kmenuedit/menuinfo.h  #1.5:1.6
@@ -73,4 +73,7 @@ public:
     QString uniqueItemCaption(const QString &caption, const QString &exclude = QString::null);
 
+    // Update full id's for this item and all submenus
+    void updateFullId(const QString &parentId);
+
     // Return a list of existing submenu ids
     QStringList existingMenuIds();


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

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