Diffstat (limited to 'core/apps/textedit/fileBrowser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index e103bcb..7a3a703 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp @@ -13,2 +13,3 @@ ****************************************************************************/ +#define QTOPIA_INTERNAL_MIMEEXT #include "fileBrowser.h" @@ -45,3 +46,3 @@ static int get_unique_id() -fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter ) +fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString mimeFilter ) : QDialog( parent, name, modal, fl ) @@ -51,3 +52,12 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags setCaption(tr( name ) ); - filterStr = filter; + mimeType = mimeFilter; + MimeType mt( mimeType); + if( mt.extension().isEmpty()) + filterStr = "*"; + else + filterStr = "*."+ mt.extension(); +// qDebug("description "+mt.description()); +// qDebug( "id "+mt.id()); +// qDebug("extension "+mt.extension()); + // channel = new QCopChannel( "QPE/fileDialog", this ); @@ -81,3 +91,2 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags - docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); @@ -98,3 +107,2 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags - ListView = new QListView( this, "ListView" ); @@ -120,3 +128,3 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags FileStack->addWidget( ListView, get_unique_id() ); -mimeType="text/*"; + fileSelector = new FileSelector( mimeType, FileStack, "fileselector" , FALSE, FALSE); //buggy @@ -155,2 +163,6 @@ fileBrowser::~fileBrowser() +void fileBrowser::setMimeType(const QString &type) { + mimeType = type; +} + void fileBrowser::setFileView( int selection ) |