author | zecke <zecke> | 2004-07-24 13:16:26 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-07-24 13:16:26 (UTC) |
commit | 144d91fee9e0ec0cb672508637c639cfbbf4e750 (patch) (unidiff) | |
tree | 802d12ac283361e3d5d710a6b8387dc22b88c462 /libopie2 | |
parent | 1efb57a4cffc8a19a0dadbd008ff205d3d61d216 (diff) | |
download | opie-144d91fee9e0ec0cb672508637c639cfbbf4e750.zip opie-144d91fee9e0ec0cb672508637c639cfbbf4e750.tar.gz opie-144d91fee9e0ec0cb672508637c639cfbbf4e750.tar.bz2 |
Delete the Views which are created in the OFileSelector
Add a new member and one method to register the view.
The views themselves (baseclass) call this function.
Simply going over the viewMap wouldn't work as we can
have the same instance contained twice under a different name
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 19 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.h | 10 |
2 files changed, 24 insertions, 5 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 5528aed..b06defd 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp | |||
@@ -64,5 +64,7 @@ namespace Ui { | |||
64 | namespace Internal { | 64 | namespace Internal { |
65 | OFileViewInterface::OFileViewInterface( OFileSelector* selector ) | 65 | OFileViewInterface::OFileViewInterface( OFileSelector* _selector ) |
66 | : m_selector( selector ) | 66 | : m_selector( _selector ) |
67 | {} | 67 | { |
68 | selector()->registerView( this ); | ||
69 | } | ||
68 | 70 | ||
@@ -513,3 +515,3 @@ OFileSelector* OFileViewFileListView::selector() | |||
513 | 515 | ||
514 | bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) | 516 | bool OFileViewFileListView::eventFilter (QObject *, QEvent *e) |
515 | { | 517 | { |
@@ -949,3 +951,3 @@ void OFileSelector::initUI() | |||
949 | 951 | ||
950 | bool OFileSelector::eventFilter (QObject *o, QEvent *e) | 952 | bool OFileSelector::eventFilter (QObject *, QEvent *e) |
951 | { | 953 | { |
@@ -1000,2 +1002,7 @@ void OFileSelector::initViews() | |||
1000 | 1002 | ||
1003 | void OFileSelector::registerView( const Internal::OFileViewInterface* iface ) { | ||
1004 | m_viewsPtr.append( iface ); | ||
1005 | } | ||
1006 | |||
1007 | |||
1001 | /** | 1008 | /** |
@@ -1005,2 +1012,4 @@ OFileSelector::~OFileSelector() | |||
1005 | { | 1012 | { |
1013 | m_viewsPtr.setAutoDelete( true ); | ||
1014 | m_viewsPtr.clear(); | ||
1006 | } | 1015 | } |
diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h index 8bcd9ee..de2b98a 100644 --- a/libopie2/opieui/fileselector/ofileselector.h +++ b/libopie2/opieui/fileselector/ofileselector.h | |||
@@ -46,2 +46,3 @@ | |||
46 | #include <qstringlist.h> | 46 | #include <qstringlist.h> |
47 | #include <qlist.h> | ||
47 | 48 | ||
@@ -185,2 +186,9 @@ private: | |||
185 | 186 | ||
187 | |||
188 | /* | ||
189 | * register a view for deletion. | ||
190 | * This happens on creation of a OFileViewInterface | ||
191 | */ | ||
192 | void registerView( const Internal::OFileViewInterface* ); | ||
193 | |||
186 | private: | 194 | private: |
@@ -196,2 +204,4 @@ private: | |||
196 | QMap<QString, Internal::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr | 204 | QMap<QString, Internal::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr |
205 | /* views register themselves automatically */ | ||
206 | QList<Internal::OFileViewInterface> m_viewsPtr; | ||
197 | QHBox* m_nameBox; // the LineEdit + Label is hold here | 207 | QHBox* m_nameBox; // the LineEdit + Label is hold here |