-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 | |||
@@ -40,53 +40,53 @@ | |||
40 | 40 | ||
41 | static int u_id = 1; | 41 | static int u_id = 1; |
42 | static int get_unique_id() | 42 | static int get_unique_id() |
43 | { | 43 | { |
44 | return u_id++; | 44 | return u_id++; |
45 | } | 45 | } |
46 | 46 | ||
47 | fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString mimeFilter ) | 47 | fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString mimeFilter ) |
48 | : QDialog( parent, name, modal, fl ) | 48 | : QDialog( parent, name, modal, fl ) |
49 | { | 49 | { |
50 | if ( !name ) | 50 | if ( !name ) |
51 | setName( "fileBrowser" ); | 51 | setName( "fileBrowser" ); |
52 | setCaption(tr( name ) ); | 52 | setCaption(tr( name ) ); |
53 | 53 | ||
54 | // getMimeTypes(); | 54 | // getMimeTypes(); |
55 | 55 | ||
56 | mimeType = mimeFilter; | 56 | // mimeType = mimeFilter; |
57 | MimeType mt( mimeType); | 57 | // MimeType mt( mimeType); |
58 | 58 | ||
59 | if( mt.extension().isEmpty()) { | 59 | // if( mt.extension().isEmpty()) { |
60 | 60 | ||
61 | QStringList filterList; | 61 | // QStringList filterList; |
62 | filterList=QStringList::split(";",mimeFilter,FALSE); | 62 | // filterList=QStringList::split(";",mimeFilter,FALSE); |
63 | 63 | ||
64 | for ( QStringList::Iterator it = filterList.begin(); it != filterList.end(); ++it ) { | 64 | // for ( QStringList::Iterator it = filterList.begin(); it != filterList.end(); ++it ) { |
65 | printf( "%s \n", (*it).latin1() ); | 65 | // printf( "%s \n", (*it).latin1() ); |
66 | } | 66 | // } |
67 | 67 | ||
68 | filterStr = mimeFilter.right(mimeFilter.length() - mimeFilter.find("/",0,TRUE) - 1);// "*"; | 68 | // filterStr = mimeFilter.right(mimeFilter.length() - mimeFilter.find("/",0,TRUE) - 1);// "*"; |
69 | 69 | ||
70 | qDebug(filterStr); | 70 | // qDebug(filterStr); |
71 | } else { | 71 | // } else { |
72 | filterStr = "*."+ mt.extension(); | 72 | filterStr = "*."+ mt.extension(); |
73 | // qDebug("description "+mt.description()); | 73 | // qDebug("description "+mt.description()); |
74 | // qDebug( "id "+mt.id()); | 74 | // qDebug( "id "+mt.id()); |
75 | // qDebug("extension "+mt.extension()); | 75 | // qDebug("extension "+mt.extension()); |
76 | } | 76 | // } |
77 | // channel = new QCopChannel( "QPE/fileDialog", this ); | 77 | // channel = new QCopChannel( "QPE/fileDialog", this ); |
78 | // connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 78 | // connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
79 | // this, SLOT(receive(const QCString&, const QByteArray&)) ); | 79 | // this, SLOT(receive(const QCString&, const QByteArray&)) ); |
80 | 80 | ||
81 | QGridLayout *layout = new QGridLayout( this ); | 81 | QGridLayout *layout = new QGridLayout( this ); |
82 | layout->setSpacing( 4 ); | 82 | layout->setSpacing( 4 ); |
83 | layout->setMargin( 4 ); | 83 | layout->setMargin( 4 ); |
84 | 84 | ||
85 | dirPathCombo = new QComboBox( FALSE, this, "dirPathCombo" ); | 85 | dirPathCombo = new QComboBox( FALSE, this, "dirPathCombo" ); |
86 | dirPathCombo->setEditable(TRUE); | 86 | dirPathCombo->setEditable(TRUE); |
87 | 87 | ||
88 | connect( dirPathCombo, SIGNAL( activated( const QString & ) ), | 88 | connect( dirPathCombo, SIGNAL( activated( const QString & ) ), |
89 | this, SLOT( dirPathComboActivated( const QString & ) ) ); | 89 | this, SLOT( dirPathComboActivated( const QString & ) ) ); |
90 | 90 | ||
91 | connect( dirPathCombo->lineEdit(), SIGNAL( returnPressed( ) ), | 91 | connect( dirPathCombo->lineEdit(), SIGNAL( returnPressed( ) ), |
92 | this, SLOT( dirPathEditPressed( ) ) ); | 92 | this, SLOT( dirPathEditPressed( ) ) ); |
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 | |||
@@ -497,38 +497,38 @@ void TextEdit::setWordWrap(bool y) | |||
497 | void TextEdit::fileNew() | 497 | void TextEdit::fileNew() |
498 | { | 498 | { |
499 | // if( !bFromDocView ) { | 499 | // if( !bFromDocView ) { |
500 | // saveAs(); | 500 | // saveAs(); |
501 | // } | 501 | // } |
502 | newFile(DocLnk()); | 502 | newFile(DocLnk()); |
503 | } | 503 | } |
504 | 504 | ||
505 | void TextEdit::fileOpen() | 505 | void TextEdit::fileOpen() |
506 | { | 506 | { |
507 | Config cfg("TextEdit"); | 507 | Config cfg("TextEdit"); |
508 | cfg.setGroup("View"); | 508 | cfg.setGroup("View"); |
509 | bool b=FALSE; | 509 | bool b=FALSE; |
510 | if(cfg.readEntry("useOldFileDialog") == "TRUE") | 510 | if(cfg.readEntry("useOldFileDialog") == "TRUE") |
511 | b=TRUE; | 511 | b=TRUE; |
512 | if(!b) { | 512 | if(!b) { |
513 | QString str = OFileDialog::getOpenFileName( 1,"/","", "text/plain", this ); | 513 | QString str = OFileDialog::getOpenFileName( 1,"/","", "*", this ); |
514 | if(!str.isEmpty() ) | 514 | if(!str.isEmpty() ) |
515 | openFile( str ); | 515 | openFile( str ); |
516 | } else { | 516 | } else { |
517 | QString str; | 517 | QString str; |
518 | browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // | 518 | browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); // |
519 | browseForFiles->setFileView( viewSelection ); | 519 | browseForFiles->setFileView( viewSelection ); |
520 | browseForFiles->showMaximized(); | 520 | browseForFiles->showMaximized(); |
521 | // if( result != -1 ) | 521 | // if( result != -1 ) |
522 | 522 | ||
523 | if( browseForFiles->exec() != -1 ) { | 523 | if( browseForFiles->exec() != -1 ) { |
524 | QString selFile = browseForFiles->selectedFileName; | 524 | QString selFile = browseForFiles->selectedFileName; |
525 | QStringList fileList = browseForFiles->fileList; | 525 | QStringList fileList = browseForFiles->fileList; |
526 | qDebug(selFile); | 526 | qDebug(selFile); |
527 | QStringList::ConstIterator f; | 527 | QStringList::ConstIterator f; |
528 | QString fileTemp; | 528 | QString fileTemp; |
529 | for ( f = fileList.begin(); f != fileList.end(); f++ ) { | 529 | for ( f = fileList.begin(); f != fileList.end(); f++ ) { |
530 | fileTemp = *f; | 530 | fileTemp = *f; |
531 | fileTemp.right( fileTemp.length()-5); | 531 | fileTemp.right( fileTemp.length()-5); |
532 | QString fileName = fileTemp; | 532 | QString fileName = fileTemp; |
533 | if( fileName != "Unnamed" || fileName != "Empty Text" ) { | 533 | if( fileName != "Unnamed" || fileName != "Empty Text" ) { |
534 | currentFileName = fileName; | 534 | currentFileName = fileName; |