summaryrefslogtreecommitdiff
path: root/libopie
authorzecke <zecke>2002-04-27 22:09:26 (UTC)
committer zecke <zecke>2002-04-27 22:09:26 (UTC)
commit7d741c93b423a3ab721071971b2c345d2d8548e2 (patch) (unidiff)
treec6ae4fc904ccd5f3ab08fb2876f9666358544f4f /libopie
parent69e271e44d23befc74a96a98708ddb6ec754a4b6 (diff)
downloadopie-7d741c93b423a3ab721071971b2c345d2d8548e2.zip
opie-7d741c93b423a3ab721071971b2c345d2d8548e2.tar.gz
opie-7d741c93b423a3ab721071971b2c345d2d8548e2.tar.bz2
Fix automime and mime tested with textedit
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.cc89
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 {
68 for(int i= 0; i < box->count(); i++ ){ 68 for(int i= 0; i < box->count(); i++ ){
69 qWarning("str T%sT boxT%sT", str.latin1(), box->text(i).latin1() );
70 if( str == box->text(i ) ){ 69 if( str == box->text(i ) ){
@@ -88,7 +87,8 @@ OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString
88 m_name = fileName; 87 m_name = fileName;
89 requestedMimeTypesList = m_mimetypes = mimetypes; 88 m_mimetypes = mimetypes;
90 89
91// if( mimetypes.isEmpty() ) 90 if( mimetypes.isEmpty() )
92// m_autoMime = true; 91 m_autoMime = true;
93 92
93 qWarning("OFileSelector mimetypes %s", mimetypes.join(" ").latin1() );
94 m_mode = mode; 94 m_mode = mode;
@@ -99,2 +99,3 @@ OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString
99 m_shYesNo = true; 99 m_shYesNo = true;
100
100 // for FILESELECTOR only view is interesting 101 // for FILESELECTOR only view is interesting
@@ -191,2 +192,3 @@ void OFileSelector::init()
191 m_stack = new QWidgetStack(this, "wstack" ); 192 m_stack = new QWidgetStack(this, "wstack" );
193 if( m_selector == NORMAL ){
192 QString currMime; 194 QString currMime;
@@ -195,3 +197,4 @@ void OFileSelector::init()
195 updateMimes(); 197 updateMimes();
196 m_select = new FileSelector( currMime == "All" ? QString::null : currMime , m_stack, "fileselector", FALSE, FALSE ); 198 m_select = new FileSelector( currMime == "All" ? QString::null : currMime ,
199 m_stack, "fileselector", FALSE, FALSE );
197 m_stack->addWidget(m_select, NORMAL ); 200 m_stack->addWidget(m_select, NORMAL );
@@ -199,5 +202,7 @@ void OFileSelector::init()
199 m_stack->raiseWidget(NORMAL ); 202 m_stack->raiseWidget(NORMAL );
200 connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), this, SLOT(slotFileBridgeSelected(const DocLnk &) ) ); 203 connect(m_select, SIGNAL(fileSelected( const DocLnk &) ),
204 this, SLOT(slotFileBridgeSelected(const DocLnk &) ) );
201 m_pseudoLayout = 0l; 205 m_pseudoLayout = 0l;
202 if( m_selector != NORMAL ) { 206
207 } else {
203 initializeListView(); 208 initializeListView();
@@ -217,4 +222,4 @@ void OFileSelector::init()
217 222
218 m_mimeCheck->setCurrentItem(indexByString( m_mimeCheck, requestedMimeTypesList.first()) ); 223 // m_mimeCheck->setCurrentItem(indexByString( m_mimeCheck, requestedMimeTypesList.first()) );
219 reparse(); 224 // reparse();
220 225
@@ -445,3 +450,6 @@ void OFileSelector::reparse()
445 m_mimeCheck->setCurrentItem( indexByString( m_mimeCheck, currMime ) ); 450 m_mimeCheck->setCurrentItem( indexByString( m_mimeCheck, currMime ) );
446 }; 451 }else{
452 m_mimeCheck->clear();
453 m_mimeCheck->insertItem( m_mimetypes.join(";") );
454 }
447 455
@@ -580,8 +588,8 @@ void OFileSelector::initializeChooser()
580 588
581// if(!m_autoMime ) 589 if(!m_autoMime )
582// m_mimeCheck->insertItem(m_mimetypes.join("," ) ); 590 m_mimeCheck->insertItem(m_mimetypes.join("," ) );
583// else{ // check 591 else{ // check
584 updateMimes(); 592 updateMimes();
585 m_mimeCheck->insertStringList( m_mimetypes ); 593 m_mimeCheck->insertStringList( m_mimetypes );
586// } 594 }
587 595
@@ -671,16 +679,18 @@ void OFileSelector::updateMimes() // lets check which mode is active
671{ 679{
672 m_mimetypes.clear(); 680 if( m_autoMime ){
673 m_mimetypes.append("All" ); 681 m_mimetypes.clear();
674// if( m_selector == NORMAL ){ 682 m_mimetypes.append("All" );
675 DocLnkSet set; 683 if( m_selector == NORMAL ){
676 Global::findDocuments(&set, QString::null ); 684 DocLnkSet set;
677 QListIterator<DocLnk> dit( set.children() ); 685 Global::findDocuments(&set, QString::null );
678 for ( ; dit.current(); ++dit ) { 686 QListIterator<DocLnk> dit( set.children() );
679 if( !m_mimetypes.contains((*dit)->type() ) ) 687 for ( ; dit.current(); ++dit ) {
680 m_mimetypes.append( (*dit)->type() ); 688 if( !m_mimetypes.contains((*dit)->type() ) )
681 } 689 m_mimetypes.append( (*dit)->type() );
682// }else{ 690 }
683 // should be allreday updatet 691 }else{
684 // ; 692 // should be allreday updatet
685 // } 693 ;
694 }
695 }
686} 696}
@@ -694,12 +704,11 @@ void OFileSelector::initializeListView()
694 // just to make sure but clean it up better FIXME 704 // just to make sure but clean it up better FIXME
695 // if( m_View) delete m_View; 705 delete m_View;
696// m_View = 0; 706 m_View = 0;
697// if(m_boxToolbar) delete m_boxToolbar; 707 delete m_boxToolbar;
698// if(m_homeButton) delete m_homeButton; 708 delete m_homeButton;
699// if(m_docButton) delete m_docButton; 709 delete m_docButton;
700// if( m_location) delete m_location; 710 delete m_location;
701// if(m_up) delete m_up; 711 delete m_up;
702 //delete m_pseudo; 712 delete m_pseudo;
703 //if(m_pseudoLayout!=0 ) // why did you overload malloc 713
704 //delete m_pseudoLayout;
705 m_boxToolbar = 0; 714 m_boxToolbar = 0;