-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index c9366e7..7eac5d2 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp | |||
@@ -404,102 +404,102 @@ void fileBrowser::localDelete() { | |||
404 | // exit | 404 | // exit |
405 | break; | 405 | break; |
406 | }; | 406 | }; |
407 | 407 | ||
408 | } else { | 408 | } else { |
409 | switch ( QMessageBox::warning(this,"Delete","Do you really want to delete\n"+f | 409 | switch ( QMessageBox::warning(this,"Delete","Do you really want to delete\n"+f |
410 | +" ?","Yes","No",0,0,1) ) { | 410 | +" ?","Yes","No",0,0,1) ) { |
411 | case 0: { | 411 | case 0: { |
412 | f=currentDir.canonicalPath()+"/"+f; | 412 | f=currentDir.canonicalPath()+"/"+f; |
413 | QString cmd="rm "+f; | 413 | QString cmd="rm "+f; |
414 | system( cmd.latin1()); | 414 | system( cmd.latin1()); |
415 | populateList(); | 415 | populateList(); |
416 | } | 416 | } |
417 | break; | 417 | break; |
418 | case 1: | 418 | case 1: |
419 | // exit | 419 | // exit |
420 | break; | 420 | break; |
421 | }; | 421 | }; |
422 | } | 422 | } |
423 | } | 423 | } |
424 | 424 | ||
425 | void fileBrowser::updateMimeTypeMenu() { | 425 | void fileBrowser::updateMimeTypeMenu() { |
426 | 426 | ||
427 | disconnect( typemb, SIGNAL(selected(const QString&)), | 427 | disconnect( typemb, SIGNAL(selected(const QString&)), |
428 | this, SLOT(showType(const QString&)) ); | 428 | this, SLOT(showType(const QString&)) ); |
429 | 429 | ||
430 | QString prev; | 430 | QString prev; |
431 | 431 | ||
432 | // Type filter | 432 | // Type filter |
433 | QStringList types; | 433 | QStringList types; |
434 | types << tr("All"); | 434 | types << tr("All"); |
435 | types << "--"; | 435 | types << "--"; |
436 | types += getMimeTypes(); | 436 | types += getMimeTypes(); |
437 | prev = typemb->currentText(); | 437 | prev = typemb->currentText(); |
438 | typemb->clear(); | 438 | typemb->clear(); |
439 | typemb->insertItems(types); | 439 | typemb->insertItems(types); |
440 | // typemb->select(prev); | 440 | // typemb->select(prev); |
441 | 441 | ||
442 | connect(typemb, SIGNAL(selected(const QString&)), this, SLOT(showType(const QString&))); | 442 | connect(typemb, SIGNAL(selected(const QString&)), this, SLOT(showType(const QString&))); |
443 | } | 443 | } |
444 | 444 | ||
445 | void fileBrowser::showType(const QString &t) { | 445 | void fileBrowser::showType(const QString &t) { |
446 | 446 | ||
447 | qDebug(t); | 447 | qDebug(t); |
448 | mimeType = t+"/*"; | 448 | mimeType = t+"/*"; |
449 | // if(fileSelector) { | 449 | // if(fileSelector) { |
450 | // disconnect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( docOpen( const DocLnk & ) ) ); | 450 | // disconnect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( docOpen( const DocLnk & ) ) ); |
451 | // delete fileSelector; | 451 | // delete fileSelector; |
452 | } | 452 | // } |
453 | // fileSelector = new FileSelector( mimeType, FileStack, "fileselector" , FALSE, FALSE); //buggy | 453 | // fileSelector = new FileSelector( mimeType, FileStack, "fileselector" , FALSE, FALSE); //buggy |
454 | // connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( showEditTools() ) ); | 454 | // connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( showEditTools() ) ); |
455 | // connect( fileSelector, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) ); | 455 | // connect( fileSelector, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) ); |
456 | // connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( docOpen( const DocLnk & ) ) ); | 456 | // connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( docOpen( const DocLnk & ) ) ); |
457 | fileSelector->reread(); | 457 | // fileSelector->reread(); |
458 | repaint(); | 458 | repaint(); |
459 | // if ( t == tr("All") ) { | 459 | // if ( t == tr("All") ) { |
460 | // icons->setTypeFilter("",TRUE); | 460 | // icons->setTypeFilter("",TRUE); |
461 | // } else { | 461 | // } else { |
462 | // icons->setTypeFilter(t+"/*",TRUE); | 462 | // icons->setTypeFilter(t+"/*",TRUE); |
463 | // } | 463 | // } |
464 | 464 | ||
465 | } | 465 | } |
466 | 466 | ||
467 | QStringList fileBrowser::getMimeTypes() { | 467 | QStringList fileBrowser::getMimeTypes() { |
468 | QStringList r; | 468 | QStringList r; |
469 | AppLnkSet apps( QPEApplication::qpeDir() + "apps" ); | 469 | AppLnkSet apps( QPEApplication::qpeDir() + "apps" ); |
470 | QFile file( QPEApplication::qpeDir()+"etc/available.mime"); | 470 | QFile file( QPEApplication::qpeDir()+"etc/available.mime"); |
471 | file.open( IO_WriteOnly|IO_Truncate);//) | 471 | file.open( IO_WriteOnly|IO_Truncate);//) |
472 | for ( QListIterator<AppLnk> it( apps.children() ); it.current(); ++it ) { | 472 | for ( QListIterator<AppLnk> it( apps.children() ); it.current(); ++it ) { |
473 | AppLnk* l; | 473 | AppLnk* l; |
474 | l = it.current(); | 474 | l = it.current(); |
475 | QStringList maj = l->mimeTypes(); | 475 | QStringList maj = l->mimeTypes(); |
476 | QStringList::ConstIterator f; | 476 | QStringList::ConstIterator f; |
477 | for ( f = maj.begin(); f != maj.end(); f++ ) { | 477 | for ( f = maj.begin(); f != maj.end(); f++ ) { |
478 | QString temp = *f; | 478 | QString temp = *f; |
479 | int sl = temp.find('/'); | 479 | int sl = temp.find('/'); |
480 | if (sl >= 0) { | 480 | if (sl >= 0) { |
481 | QString k = temp.left(sl); | 481 | QString k = temp.left(sl); |
482 | if( r.grep(k,TRUE).isEmpty() ) { | 482 | if( r.grep(k,TRUE).isEmpty() ) { |
483 | r << k; | 483 | r << k; |
484 | k+="\n"; | 484 | k+="\n"; |
485 | file.writeBlock( k.latin1(), k.length()); | 485 | file.writeBlock( k.latin1(), k.length()); |
486 | } | 486 | } |
487 | } | 487 | } |
488 | } | 488 | } |
489 | } | 489 | } |
490 | r.sort(); | 490 | r.sort(); |
491 | file.close(); | 491 | file.close(); |
492 | return r; | 492 | return r; |
493 | } | 493 | } |
494 | 494 | ||
495 | void fileBrowser::receive( const QCString &msg, const QByteArray &data ) { | 495 | void fileBrowser::receive( const QCString &msg, const QByteArray &data ) { |
496 | // QDataStream stream( data, IO_ReadOnly ); | 496 | // QDataStream stream( data, IO_ReadOnly ); |
497 | // if (msg == "keyRegister(int key, QString channel, QString message)") | 497 | // if (msg == "keyRegister(int key, QString channel, QString message)") |
498 | // { | 498 | // { |
499 | // int k; | 499 | // int k; |
500 | // QString c, m; | 500 | // QString c, m; |
501 | // stream >> k; | 501 | // stream >> k; |
502 | // stream >> c; | 502 | // stream >> c; |
503 | // stream >> m; | 503 | // stream >> m; |
504 | } | 504 | } |
505 | 505 | ||