]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use a QLinkedList instead of Q3PtrList
authorHolger Freyther <holger+kde@freyther.de>
Sun, 10 Dec 2006 21:01:38 +0000 (21:01 +0000)
committerHolger Freyther <holger+kde@freyther.de>
Sun, 10 Dec 2006 21:01:38 +0000 (21:01 +0000)
svn path=/trunk/playground/utils/dolphin/; revision=612313

src/dolphincontextmenu.cpp
src/dolphinmainwindow.cpp
src/dolphinmainwindow.h

index a2403a82653715ba3c3681ba1a10963d0dc2df6e..4c04170d6223a538bf05e00ceb6af207a8a92c06 100644 (file)
@@ -91,12 +91,9 @@ void DolphinContextMenu::openViewportContextMenu()
 
     createNewMenu->insertSeparator();
 
-    QAction* action = 0;
-
-    Q3PtrListIterator<KAction> fileGrouptIt(dolphin->fileGroupActions());
-    while ((action = fileGrouptIt.current()) != 0) {
-        createNewMenu->addAction(action);
-        ++fileGrouptIt;
+    QLinkedListIterator<QAction*> fileGrouptIt(dolphin->fileGroupActions());
+    while (fileGrouptIt.hasNext()) {
+        createNewMenu->addAction(fileGrouptIt.next());
     }
 
     // TODO: not used yet. See documentation of Dolphin::linkGroupActions()
index 61b7bb2218f93252039dc0fa49719bcb33ebce15..4fa3cef31a7df1dafab91b20d163e4a28cbfcb13 100644 (file)
@@ -86,17 +86,20 @@ DolphinMainWindow::DolphinMainWindow() :
     m_view[PrimaryIdx] = 0;
     m_view[SecondaryIdx] = 0;
 
-    m_fileGroupActions.setAutoDelete(true);
-
     // TODO: the following members are not used yet. See documentation
     // of DolphinMainWindow::linkGroupActions() and DolphinMainWindow::linkToDeviceActions()
     // in the header file for details.
-    //m_linkGroupActions.setAutoDelete(true);
-    //m_linkToDeviceActions.setAutoDelete(true);
 }
 
 DolphinMainWindow::~DolphinMainWindow()
 {
+    qDeleteAll(m_fileGroupActions);
+    //qDeleteAll(m_linkToDeviceActions);
+    //qDeleteAll(m_linkGroupActions);
+    m_fileGroupActions.clear();
+    //m_linkGroupActions.clear();
+    //m_linkToDeviceActions.clear();
+
     /*
      * bye, bye managed window
      */
index 064bf18676593df9dd964ab1592eebd3e65089f7..62327b4694c7465f71c86b9121bef277b38b83d9 100644 (file)
@@ -104,9 +104,9 @@ public:
      * of the 'Create New...' sub menu. Usually the list contains actions
      * for creating folders, text files, HTML files etc.
      */
-    const Q3PtrList<KAction>& fileGroupActions() const { return m_fileGroupActions; }
-    //const QPtrList<KAction>& linkGroupActions() const { return m_linkGroupActions; }
-    //const QPtrList<KAction>& linkToDeviceActions() const { return m_linkToDeviceActions; }
+    QLinkedList<QAction*> fileGroupActions() const { return m_fileGroupActions; }
+    //QLinkedList<QAction*>& linkGroupActions() const { return m_linkGroupActions; }
+    //QLinkedList<QAction*>& linkToDeviceActions() const { return m_linkToDeviceActions; }
 
     /**
      * Refreshs the views of the main window by recreating them dependent from
@@ -440,13 +440,13 @@ private:
         QString comment;
     };
 
-    Q3PtrList<KAction> m_fileGroupActions;
+    QLinkedList<QAction*> m_fileGroupActions;
     KSortableList<CreateFileEntry,QString> m_createFileTemplates;
 
     // TODO: not used yet. See documentation of DolphinMainWindow::linkGroupActions()
     // and DolphinMainWindow::linkToDeviceActions() in for details.
-    //QPtrList<KAction> m_linkGroupActions;
-    //QPtrList<KAction> m_linkToDeviceActions;
+    //QLinkedList<QAction*> m_linkGroupActions;
+    //QLinkedList<QAction*> m_linkToDeviceActions;
 };
 
 #endif // _DOLPHIN_H_