summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp22
-rw-r--r--core/apps/textedit/fileBrowser.h5
-rw-r--r--core/apps/textedit/textedit.cpp2
-rw-r--r--core/apps/textedit/textedit.h3
4 files changed, 23 insertions, 9 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 @@
13****************************************************************************/ 13****************************************************************************/
14#define QTOPIA_INTERNAL_MIMEEXT
14#include "fileBrowser.h" 15#include "fileBrowser.h"
@@ -45,3 +46,3 @@ static int get_unique_id()
45 46
46fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter ) 47fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString mimeFilter )
47 : QDialog( parent, name, modal, fl ) 48 : QDialog( parent, name, modal, fl )
@@ -51,3 +52,12 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
51 setCaption(tr( name ) ); 52 setCaption(tr( name ) );
52 filterStr = filter; 53 mimeType = mimeFilter;
54 MimeType mt( mimeType);
55 if( mt.extension().isEmpty())
56 filterStr = "*";
57 else
58 filterStr = "*."+ mt.extension();
59// qDebug("description "+mt.description());
60// qDebug( "id "+mt.id());
61// qDebug("extension "+mt.extension());
62
53// channel = new QCopChannel( "QPE/fileDialog", this ); 63// channel = new QCopChannel( "QPE/fileDialog", this );
@@ -81,3 +91,2 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
81 91
82
83 docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); 92 docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton");
@@ -98,3 +107,2 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
98 107
99
100 ListView = new QListView( this, "ListView" ); 108 ListView = new QListView( this, "ListView" );
@@ -120,3 +128,3 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
120 FileStack->addWidget( ListView, get_unique_id() ); 128 FileStack->addWidget( ListView, get_unique_id() );
121mimeType="text/*"; 129
122 fileSelector = new FileSelector( mimeType, FileStack, "fileselector" , FALSE, FALSE); //buggy 130 fileSelector = new FileSelector( mimeType, FileStack, "fileselector" , FALSE, FALSE); //buggy
@@ -155,2 +163,6 @@ fileBrowser::~fileBrowser()
155 163
164void fileBrowser::setMimeType(const QString &type) {
165 mimeType = type;
166}
167
156void fileBrowser::setFileView( int selection ) 168void fileBrowser::setFileView( int selection )
diff --git a/core/apps/textedit/fileBrowser.h b/core/apps/textedit/fileBrowser.h
index 77ac166..1138d80 100644
--- a/core/apps/textedit/fileBrowser.h
+++ b/core/apps/textedit/fileBrowser.h
@@ -54,3 +54,3 @@ public:
54 54
55 QString selectedFileName, mimeType; 55 QString selectedFileName;
56 QFile file; 56 QFile file;
@@ -60,2 +60,3 @@ public slots:
60 void setFileView( int ); 60 void setFileView( int );
61 void setMimeType(const QString &);
61 62
@@ -66,3 +67,3 @@ private:
66 QLabel *dirLabel; 67 QLabel *dirLabel;
67 QString filterStr; 68 QString filterStr, mimeType;
68 QDir currentDir; 69 QDir currentDir;
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index ecebe12..d28ece8 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -495,3 +495,3 @@ void TextEdit::fileOpen()
495{ 495{
496 browseForFiles=new fileBrowser(this,"Open File",TRUE,0, "*"); 496 browseForFiles=new fileBrowser(this,"Open File",TRUE,0, "text/*"); //
497 browseForFiles->setFileView( viewSelection ); 497 browseForFiles->setFileView( viewSelection );
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h
index 70cf068..af69518 100644
--- a/core/apps/textedit/textedit.h
+++ b/core/apps/textedit/textedit.h
@@ -54,3 +54,4 @@ public:
54 ~TextEdit(); 54 ~TextEdit();
55 QPopupMenu *font; 55
56 QPopupMenu *font;
56 QAction *nStart; 57 QAction *nStart;