Diffstat (limited to 'libopie/ofileselector/ofileselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/ofileselector/ofileselector.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp index 458d432..91a510f 100644 --- a/libopie/ofileselector/ofileselector.cpp +++ b/libopie/ofileselector/ofileselector.cpp @@ -35,4 +35,5 @@ #include "olocallister.h" #include "olister.h" +#include "odefaultfactories.h" QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0; @@ -298,7 +299,5 @@ QString OFileSelector::selectedPath()const if( m_selector == Normal ){ path = QPEApplication::documentDir(); - } /*else if( m_selector == Extended || m_selector == ExtendedAll ){ - ; - }*/ + } /* normal case to do */ return path; } @@ -373,13 +372,6 @@ void OFileSelector::slotViewCheck(const QString &sel) m_selector = Normal; - }else if( sel == tr("Files") ){ - m_selector = Extended; - - // FIXME call the factory - //reparse(); - }else if( sel == tr("All Files") ){ - m_selector = ExtendedAll; -/* see above - reparse(); */ + }else { +; } } @@ -475,4 +467,5 @@ void OFileSelector::locationComboChanged() void OFileSelector::init() { + initFactory(); m_lay = new QVBoxLayout( this ); m_lay->setSpacing(0 ); @@ -654,8 +647,4 @@ void OFileSelector::initializeChooser() m_lay->addWidget(m_boxView, 0 ); - m_viewCheck->insertItem( tr("Documents") ); - m_viewCheck->insertItem( tr("Files") ); - m_viewCheck->insertItem( tr("All Files") ); - /* update to custom views */ updateMimeCheck(); @@ -952,4 +941,15 @@ void OFileSelector::reparse() } +/* + * the factory + */ +void OFileSelector::initFactory() { + m_fileFactory = new OFileFactory(); + m_fileFactory->addLister(tr("Files"), newLocalLister ); + m_fileFactory->addView(tr("List View"), newFileListView ); + /* the factory is just a dummy */ + m_fileFactory->addView(tr("Documents"), newFileListView ); +} + OFileView* OFileSelector::currentView() { @@ -1014,5 +1014,5 @@ void OFileSelector::initializeOldSelector() { FALSE, FALSE); m_select->setCategorySelectVisible( FALSE ); - m_select->setTypeComboVisible( FALSE ); + m_select->setTypeComboVisible( FALSE ); connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ), |