Diffstat (limited to 'libopie/ofileselector/ofilefactory.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/ofileselector/ofilefactory.cpp | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/libopie/ofileselector/ofilefactory.cpp b/libopie/ofileselector/ofilefactory.cpp index f752149..aa143b4 100644 --- a/libopie/ofileselector/ofilefactory.cpp +++ b/libopie/ofileselector/ofilefactory.cpp | |||
@@ -10,3 +10,3 @@ QStringList OFileFactory::lister()const { | |||
10 | for ( it = m_lister.begin(); it != m_lister.end(); ++it ) { | 10 | for ( it = m_lister.begin(); it != m_lister.end(); ++it ) { |
11 | list << (*it); | 11 | list << it.key(); |
12 | } | 12 | } |
@@ -16,3 +16,6 @@ QStringList OFileFactory::views()const { | |||
16 | QStringList list; | 16 | QStringList list; |
17 | 17 | QMap<QString, viewFact>::ConstIterator it; | |
18 | for (it = m_view.begin(); it != m_view.end(); ++it ) { | ||
19 | list << it.key(); | ||
20 | } | ||
18 | 21 | ||
@@ -21,20 +24,35 @@ QStringList OFileFactory::views()const { | |||
21 | OFileView* OFileFactory::view( const QString& name, | 24 | OFileView* OFileFactory::view( const QString& name, |
22 | OFileSelector*, QWidget* ) { | 25 | OFileSelector* sel, QWidget* par) { |
23 | 26 | OFileView* vie= 0l; | |
24 | } | ||
25 | OLister* OFileFactory::lister(const QString&, OFileSelector*) { | ||
26 | 27 | ||
27 | } | 28 | QMap<QString, viewFact>::Iterator it; |
28 | void OFileFactory::addLister( const QString&, listerFact fact ) { | 29 | it = m_view.find( name ); |
29 | 30 | ||
31 | if ( it != m_view.end() ) { | ||
32 | vie = (*(it.data() ) )(sel, par); | ||
33 | } | ||
34 | return vie; | ||
30 | } | 35 | } |
31 | void OFileFactory::addView( const QString&, viewFact fact ) { | 36 | OLister* OFileFactory::lister(const QString& name, OFileSelector* sel) { |
37 | OLister* lis = 0l; | ||
32 | 38 | ||
39 | QMap<QString, listerFact>::Iterator it; | ||
40 | it = m_lister.find( name ); | ||
41 | if ( it != m_lister.end() ) { | ||
42 | lis = (*(it.data() ) )(sel); | ||
43 | } | ||
33 | 44 | ||
45 | return lis; | ||
34 | } | 46 | } |
35 | void OFileFactory::removeLister( const QString& ) { | 47 | void OFileFactory::addLister( const QString& name, listerFact fact ) { |
36 | 48 | m_lister.insert( name, fact ); | |
37 | } | 49 | } |
38 | void OFileFactory::removeView( const QString& ) { | 50 | void OFileFactory::addView( const QString& name, viewFact fact ) { |
39 | 51 | m_view.insert( name, fact ); | |
52 | } | ||
53 | void OFileFactory::removeLister( const QString& name) { | ||
54 | m_lister.remove( name ); | ||
55 | } | ||
56 | void OFileFactory::removeView( const QString& name) { | ||
57 | m_view.remove( name ); | ||
40 | } | 58 | } |