summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp35
-rw-r--r--core/apps/textedit/fileBrowser.h3
2 files changed, 28 insertions, 10 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp
index 7a3a703..8c942a1 100644
--- a/core/apps/textedit/fileBrowser.cpp
+++ b/core/apps/textedit/fileBrowser.cpp
@@ -154,2 +154,3 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden */| QDir::All);
+ currentDir.setNameFilter(filterStr);
@@ -163,6 +164,2 @@ fileBrowser::~fileBrowser()
-void fileBrowser::setMimeType(const QString &type) {
- mimeType = type;
-}
-
void fileBrowser::setFileView( int selection )
@@ -181,3 +178,2 @@ void fileBrowser::populateList()
- currentDir.setNameFilter(filterStr);
// currentDir.setNameFilter("*.txt;*.etx");
@@ -388,3 +384,3 @@ void fileBrowser::showListMenu(QListViewItem *item) {
m.insertItem( tr( "Make Directory" ), this, SLOT( makDir() ));
- m.insertItem( tr( "Rescan" ), this, SLOT( populateList()() ));
+ m.insertItem( tr( "Rescan" ), this, SLOT( populateList() ));
m.insertItem( tr( "Rename" ), this, SLOT( localRename() ));
@@ -483,3 +479,25 @@ void fileBrowser::showType(const QString &t) {
qDebug(t);
- mimeType = t+"/*";
+ if(t.find("All",0,TRUE) != -1) {
+ filterStr = "*";
+ } else {
+ QStringList list = mimetypes.grep( t,TRUE);
+ QString ext;
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ mimeType =(*it);
+ MimeType mt( mimeType);
+ qDebug("mime "+mimeType);
+// qDebug("description "+mt.description());
+// qDebug( "id "+mt.id());
+ qDebug("extension "+mt.extension());
+ if( mt.extension().isEmpty())
+ filterStr = "*";
+ else
+ filterStr = "*."+ mt.extension()+" ";
+// printf( "%s \n", (*it).latin1() );
+ }
+ }
+ currentDir.setNameFilter(filterStr);
+
+ populateList();
+ update();
// if(fileSelector) {
@@ -493,3 +511,2 @@ void fileBrowser::showType(const QString &t) {
// fileSelector->reread();
- repaint();
// if ( t == tr("All") ) {
@@ -503,2 +520,3 @@ void fileBrowser::showType(const QString &t) {
QStringList fileBrowser::getMimeTypes() {
+
QStringList r;
@@ -514,2 +532,3 @@ QStringList fileBrowser::getMimeTypes() {
QString temp = *f;
+ mimetypes << temp;
int sl = temp.find('/');
diff --git a/core/apps/textedit/fileBrowser.h b/core/apps/textedit/fileBrowser.h
index 1138d80..339483f 100644
--- a/core/apps/textedit/fileBrowser.h
+++ b/core/apps/textedit/fileBrowser.h
@@ -60,3 +60,2 @@ public slots:
void setFileView( int );
- void setMimeType(const QString &);
@@ -69,3 +68,3 @@ private:
QDir currentDir;
- QStringList dirPathStringList;
+ QStringList dirPathStringList, mimetypes;
QListViewItem * item;