author | llornkcor <llornkcor> | 2002-05-21 15:03:56 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-21 15:03:56 (UTC) |
commit | 0ba2d95e89f55b13f2247819b6672362a8b5a484 (patch) (side-by-side diff) | |
tree | 3ee26bbcef62cca6192bd932658ed93708c23678 | |
parent | d65dc25caec62d4c554c99fbc151bf4d07c63b72 (diff) | |
download | opie-0ba2d95e89f55b13f2247819b6672362a8b5a484.zip opie-0ba2d95e89f55b13f2247819b6672362a8b5a484.tar.gz opie-0ba2d95e89f55b13f2247819b6672362a8b5a484.tar.bz2 |
maybe fixed bug
-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 24 | ||||
-rw-r--r-- | core/apps/textedit/textedit.cpp | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index fced326..9ad0d69 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp @@ -32,69 +32,69 @@ #include <qlayout.h> #include <unistd.h> #include <qpopupmenu.h> #include <qlineedit.h> #include <qstringlist.h> #include <unistd.h> #include <stdlib.h> static int u_id = 1; static int get_unique_id() { return u_id++; } fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString mimeFilter ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "fileBrowser" ); setCaption(tr( name ) ); // getMimeTypes(); - mimeType = mimeFilter; - MimeType mt( mimeType); +// mimeType = mimeFilter; +// MimeType mt( mimeType); - if( mt.extension().isEmpty()) { +// if( mt.extension().isEmpty()) { - QStringList filterList; - filterList=QStringList::split(";",mimeFilter,FALSE); +// QStringList filterList; +// filterList=QStringList::split(";",mimeFilter,FALSE); - for ( QStringList::Iterator it = filterList.begin(); it != filterList.end(); ++it ) { - printf( "%s \n", (*it).latin1() ); - } +// 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);// "*"; +// filterStr = mimeFilter.right(mimeFilter.length() - mimeFilter.find("/",0,TRUE) - 1);// "*"; - qDebug(filterStr); - } else { +// qDebug(filterStr); +// } else { filterStr = "*."+ mt.extension(); // qDebug("description "+mt.description()); // qDebug( "id "+mt.id()); // qDebug("extension "+mt.extension()); - } +// } // channel = new QCopChannel( "QPE/fileDialog", this ); // connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), // this, SLOT(receive(const QCString&, const QByteArray&)) ); QGridLayout *layout = new QGridLayout( this ); layout->setSpacing( 4 ); layout->setMargin( 4 ); dirPathCombo = new QComboBox( FALSE, this, "dirPathCombo" ); dirPathCombo->setEditable(TRUE); connect( dirPathCombo, SIGNAL( activated( const QString & ) ), this, SLOT( dirPathComboActivated( const QString & ) ) ); connect( dirPathCombo->lineEdit(), SIGNAL( returnPressed( ) ), this, SLOT( dirPathEditPressed( ) ) ); dirPathStringList << "/"; // we can get the storage here layout->addMultiCellWidget( dirPathCombo, 0, 0, 0, 4 ); cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton"); cdUpButton ->setMinimumSize( QSize( 20, 20 ) ); diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 19449cb..b8d62db 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -489,54 +489,54 @@ void TextEdit::setItalic(bool y) void TextEdit::setWordWrap(bool y) { bool state = editor->edited(); editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); editor->setEdited( state ); } void TextEdit::fileNew() { // if( !bFromDocView ) { // saveAs(); // } newFile(DocLnk()); } void TextEdit::fileOpen() { Config cfg("TextEdit"); cfg.setGroup("View"); bool b=FALSE; if(cfg.readEntry("useOldFileDialog") == "TRUE") b=TRUE; if(!b) { - QString str = OFileDialog::getOpenFileName( 1,"/","", "text/plain", this ); + QString str = OFileDialog::getOpenFileName( 1,"/","", "*", this ); if(!str.isEmpty() ) openFile( str ); } else { QString str; - browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // + browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); // browseForFiles->setFileView( viewSelection ); browseForFiles->showMaximized(); // if( result != -1 ) if( browseForFiles->exec() != -1 ) { QString selFile = browseForFiles->selectedFileName; QStringList fileList = browseForFiles->fileList; qDebug(selFile); QStringList::ConstIterator f; QString fileTemp; for ( f = fileList.begin(); f != fileList.end(); f++ ) { fileTemp = *f; fileTemp.right( fileTemp.length()-5); QString fileName = fileTemp; if( fileName != "Unnamed" || fileName != "Empty Text" ) { currentFileName = fileName; qDebug("please open "+currentFileName); openFile(currentFileName ); } } viewSelection = browseForFiles->SelectionCombo->currentItem(); } delete browseForFiles; editor->setEdited( FALSE); |