-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 43 | ||||
-rw-r--r-- | core/apps/textedit/fileBrowser.h | 2 |
2 files changed, 28 insertions, 17 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index 8ea8067..652f830 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp @@ -12,5 +12,5 @@ ** ****************************************************************************/ -#define QTOPIA_INTERNAL_MIMEEXT +//#define QTOPIA_INTERNAL_MIMEEXT #include "fileBrowser.h" //#include "inputDialog.h" @@ -51,10 +51,17 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags setName( "fileBrowser" ); setCaption(tr( name ) ); - mimeType = mimeFilter; - MimeType mt( mimeType); - if( mt.extension().isEmpty()) - filterStr = "*"; - else - filterStr = "*."+ mt.extension(); +// mimeType = mimeFilter; +// MimeType mt( mimeType); +// if( mt.extension().isEmpty()) + QStringList filterList; + filterList=QStringList::split(";",mimeFilter,FALSE); + for ( QStringList::Iterator it = filterList.begin(); it != filterList.end(); ++it ) { + printf( "%s \n", (*it).latin1() ); + } + + filterStr = mimeFilter.right(mimeFilter.length()- mimeFilter.find("/",0,TRUE) - 1);// "*"; + qDebug(filterStr); +// else +// filterStr = "*."+ mt.extension(); // qDebug("description "+mt.description()); // qDebug( "id "+mt.id()); @@ -69,5 +76,5 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags layout->setMargin( 4 ); - dirPathCombo = new QComboBox( FALSE, this, "dorPathCombo" ); + dirPathCombo = new QComboBox( FALSE, this, "dirPathCombo" ); dirPathCombo->setEditable(TRUE); @@ -131,5 +138,6 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags // connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( showEditTools() ) ); // connect( fileSelector, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) ); - connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( docOpen( const DocLnk & ) ) ); + connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), + this, SLOT( docOpen( const DocLnk & ) ) ); layout->addMultiCellWidget( FileStack, 1, 1, 0, 7 ); @@ -217,5 +225,5 @@ void fileBrowser::populateList() else { MimeType mt(fi->filePath()); - pm=mt.pixmap(); + pm=mt.pixmap();// sets the pixmap for the mimetype if(pm.isNull()) pm = Resource::loadPixmap( "UnknownDocument-14" ); @@ -418,5 +426,5 @@ void fileBrowser::localRename() { InputDialog *fileDlg; fileDlg = new InputDialog(this,"Rename",TRUE, 0); - fileDlg->inputText = curFile; + fileDlg->setTextEdit((const QString &) curFile); fileDlg->exec(); if( fileDlg->result() == 1 ) { @@ -493,12 +501,12 @@ void fileBrowser::showType(const QString &t) { mimeType =(*it); MimeType mt( mimeType); - qDebug("mime "+mimeType); +// qDebug("mime "+mimeType); // qDebug("description "+mt.description()); // qDebug( "id "+mt.id()); - qDebug("extension "+mt.extension()); - if( mt.extension().isEmpty()) +// qDebug("extension "+mt.extension()); +// if( mt.extension().isEmpty()) filterStr = "*"; - else - filterStr = "*."+ mt.extension()+" "; +// else +// filterStr = "*."+ mt.extension()+" "; // printf( "%s \n", (*it).latin1() ); } @@ -612,2 +620,5 @@ InputDialog::~InputDialog() } +void InputDialog::setTextEdit(const QString &string) { + LineEdit1->setText(string); +} diff --git a/core/apps/textedit/fileBrowser.h b/core/apps/textedit/fileBrowser.h index e76c7df..3db6a27 100644 --- a/core/apps/textedit/fileBrowser.h +++ b/core/apps/textedit/fileBrowser.h @@ -114,5 +114,5 @@ public: QString inputText; QLineEdit* LineEdit1; - + void setTextEdit(const QString &); }; |