From: Holger Freyther Date: Sun, 10 Dec 2006 21:01:38 +0000 (+0000) Subject: Use a QLinkedList instead of Q3PtrList X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/6cb02408e418ca864c9e02d55f3358a1a7c64a15 Use a QLinkedList instead of Q3PtrList svn path=/trunk/playground/utils/dolphin/; revision=612313 --- diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index a2403a826..4c04170d6 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -91,12 +91,9 @@ void DolphinContextMenu::openViewportContextMenu() createNewMenu->insertSeparator(); - QAction* action = 0; - - Q3PtrListIterator fileGrouptIt(dolphin->fileGroupActions()); - while ((action = fileGrouptIt.current()) != 0) { - createNewMenu->addAction(action); - ++fileGrouptIt; + QLinkedListIterator fileGrouptIt(dolphin->fileGroupActions()); + while (fileGrouptIt.hasNext()) { + createNewMenu->addAction(fileGrouptIt.next()); } // TODO: not used yet. See documentation of Dolphin::linkGroupActions() diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 61b7bb221..4fa3cef31 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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 */ diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 064bf1867..62327b469 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -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& fileGroupActions() const { return m_fileGroupActions; } - //const QPtrList& linkGroupActions() const { return m_linkGroupActions; } - //const QPtrList& linkToDeviceActions() const { return m_linkToDeviceActions; } + QLinkedList fileGroupActions() const { return m_fileGroupActions; } + //QLinkedList& linkGroupActions() const { return m_linkGroupActions; } + //QLinkedList& 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 m_fileGroupActions; + QLinkedList m_fileGroupActions; KSortableList m_createFileTemplates; // TODO: not used yet. See documentation of DolphinMainWindow::linkGroupActions() // and DolphinMainWindow::linkToDeviceActions() in for details. - //QPtrList m_linkGroupActions; - //QPtrList m_linkToDeviceActions; + //QLinkedList m_linkGroupActions; + //QLinkedList m_linkToDeviceActions; }; #endif // _DOLPHIN_H_