summaryrefslogtreecommitdiff
path: root/libopie
Side-by-side diff
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/ofilefactory.cpp44
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 {
for ( it = m_lister.begin(); it != m_lister.end(); ++it ) {
- list << (*it);
+ list << it.key();
}
@@ -16,3 +16,6 @@ QStringList OFileFactory::views()const {
QStringList list;
-
+ QMap<QString, viewFact>::ConstIterator it;
+ for (it = m_view.begin(); it != m_view.end(); ++it ) {
+ list << it.key();
+ }
@@ -21,20 +24,35 @@ QStringList OFileFactory::views()const {
OFileView* OFileFactory::view( const QString& name,
- OFileSelector*, QWidget* ) {
-
-}
-OLister* OFileFactory::lister(const QString&, OFileSelector*) {
+ OFileSelector* sel, QWidget* par) {
+ OFileView* vie= 0l;
-}
-void OFileFactory::addLister( const QString&, listerFact fact ) {
+ QMap<QString, viewFact>::Iterator it;
+ it = m_view.find( name );
+ if ( it != m_view.end() ) {
+ vie = (*(it.data() ) )(sel, par);
+ }
+ return vie;
}
-void OFileFactory::addView( const QString&, viewFact fact ) {
+OLister* OFileFactory::lister(const QString& name, OFileSelector* sel) {
+ OLister* lis = 0l;
+ QMap<QString, listerFact>::Iterator it;
+ it = m_lister.find( name );
+ if ( it != m_lister.end() ) {
+ lis = (*(it.data() ) )(sel);
+ }
+ return lis;
}
-void OFileFactory::removeLister( const QString& ) {
-
+void OFileFactory::addLister( const QString& name, listerFact fact ) {
+ m_lister.insert( name, fact );
}
-void OFileFactory::removeView( const QString& ) {
-
+void OFileFactory::addView( const QString& name, viewFact fact ) {
+ m_view.insert( name, fact );
+}
+void OFileFactory::removeLister( const QString& name) {
+ m_lister.remove( name );
+}
+void OFileFactory::removeView( const QString& name) {
+ m_view.remove( name );
}