author | zecke <zecke> | 2002-04-27 22:09:26 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-04-27 22:09:26 (UTC) |
commit | 7d741c93b423a3ab721071971b2c345d2d8548e2 (patch) (side-by-side diff) | |
tree | c6ae4fc904ccd5f3ab08fb2876f9666358544f4f | |
parent | 69e271e44d23befc74a96a98708ddb6ec754a4b6 (diff) | |
download | opie-7d741c93b423a3ab721071971b2c345d2d8548e2.zip opie-7d741c93b423a3ab721071971b2c345d2d8548e2.tar.gz opie-7d741c93b423a3ab721071971b2c345d2d8548e2.tar.bz2 |
Fix automime and mime tested with textedit
-rw-r--r-- | libopie/ofileselector.cc | 89 |
1 files changed, 49 insertions, 40 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index ce66f51..3a11032 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc @@ -68,3 +68,2 @@ namespace { for(int i= 0; i < box->count(); i++ ){ - qWarning("str T%sT boxT%sT", str.latin1(), box->text(i).latin1() ); if( str == box->text(i ) ){ @@ -88,7 +87,8 @@ OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString m_name = fileName; - requestedMimeTypesList = m_mimetypes = mimetypes; + m_mimetypes = mimetypes; -// if( mimetypes.isEmpty() ) -// m_autoMime = true; + if( mimetypes.isEmpty() ) + m_autoMime = true; + qWarning("OFileSelector mimetypes %s", mimetypes.join(" ").latin1() ); m_mode = mode; @@ -99,2 +99,3 @@ OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString m_shYesNo = true; + // for FILESELECTOR only view is interesting @@ -191,2 +192,3 @@ void OFileSelector::init() m_stack = new QWidgetStack(this, "wstack" ); + if( m_selector == NORMAL ){ QString currMime; @@ -195,3 +197,4 @@ void OFileSelector::init() updateMimes(); - m_select = new FileSelector( currMime == "All" ? QString::null : currMime , m_stack, "fileselector", FALSE, FALSE ); + m_select = new FileSelector( currMime == "All" ? QString::null : currMime , + m_stack, "fileselector", FALSE, FALSE ); m_stack->addWidget(m_select, NORMAL ); @@ -199,5 +202,7 @@ void OFileSelector::init() m_stack->raiseWidget(NORMAL ); - connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), this, SLOT(slotFileBridgeSelected(const DocLnk &) ) ); + connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), + this, SLOT(slotFileBridgeSelected(const DocLnk &) ) ); m_pseudoLayout = 0l; - if( m_selector != NORMAL ) { + + } else { initializeListView(); @@ -217,4 +222,4 @@ void OFileSelector::init() - m_mimeCheck->setCurrentItem(indexByString( m_mimeCheck, requestedMimeTypesList.first()) ); - reparse(); + // m_mimeCheck->setCurrentItem(indexByString( m_mimeCheck, requestedMimeTypesList.first()) ); + // reparse(); @@ -445,3 +450,6 @@ void OFileSelector::reparse() m_mimeCheck->setCurrentItem( indexByString( m_mimeCheck, currMime ) ); - }; + }else{ + m_mimeCheck->clear(); + m_mimeCheck->insertItem( m_mimetypes.join(";") ); + } @@ -580,8 +588,8 @@ void OFileSelector::initializeChooser() -// if(!m_autoMime ) -// m_mimeCheck->insertItem(m_mimetypes.join("," ) ); -// else{ // check - updateMimes(); - m_mimeCheck->insertStringList( m_mimetypes ); -// } + if(!m_autoMime ) + m_mimeCheck->insertItem(m_mimetypes.join("," ) ); + else{ // check + updateMimes(); + m_mimeCheck->insertStringList( m_mimetypes ); + } @@ -671,16 +679,18 @@ void OFileSelector::updateMimes() // lets check which mode is active { - m_mimetypes.clear(); - m_mimetypes.append("All" ); -// if( m_selector == NORMAL ){ - DocLnkSet set; - Global::findDocuments(&set, QString::null ); - QListIterator<DocLnk> dit( set.children() ); - for ( ; dit.current(); ++dit ) { - if( !m_mimetypes.contains((*dit)->type() ) ) - m_mimetypes.append( (*dit)->type() ); - } -// }else{ - // should be allreday updatet - // ; - // } + if( m_autoMime ){ + m_mimetypes.clear(); + m_mimetypes.append("All" ); + if( m_selector == NORMAL ){ + DocLnkSet set; + Global::findDocuments(&set, QString::null ); + QListIterator<DocLnk> dit( set.children() ); + for ( ; dit.current(); ++dit ) { + if( !m_mimetypes.contains((*dit)->type() ) ) + m_mimetypes.append( (*dit)->type() ); + } + }else{ + // should be allreday updatet + ; + } + } } @@ -694,12 +704,11 @@ void OFileSelector::initializeListView() // just to make sure but clean it up better FIXME - // if( m_View) delete m_View; -// m_View = 0; -// if(m_boxToolbar) delete m_boxToolbar; -// if(m_homeButton) delete m_homeButton; -// if(m_docButton) delete m_docButton; -// if( m_location) delete m_location; -// if(m_up) delete m_up; - //delete m_pseudo; - //if(m_pseudoLayout!=0 ) // why did you overload malloc - //delete m_pseudoLayout; + delete m_View; + m_View = 0; + delete m_boxToolbar; + delete m_homeButton; + delete m_docButton; + delete m_location; + delete m_up; + delete m_pseudo; + m_boxToolbar = 0; |