summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-24 15:37:21 (UTC)
committer llornkcor <llornkcor>2002-03-24 15:37:21 (UTC)
commit0df992b84871ca9786a3ce0cc40defd8b6bc0dfd (patch) (unidiff)
treeb917ee58f6ff7b6b894762cd013227382f4f08cb
parentf01751db63eac7b54c5c7a3115ca4ae3d957ac5a (diff)
downloadopie-0df992b84871ca9786a3ce0cc40defd8b6bc0dfd.zip
opie-0df992b84871ca9786a3ce0cc40defd8b6bc0dfd.tar.gz
opie-0df992b84871ca9786a3ce0cc40defd8b6bc0dfd.tar.bz2
left errent bracket
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp4
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
@@ -356,176 +356,176 @@ void fileBrowser::showListMenu(QListViewItem *item) {
356 m.insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 356 m.insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
357 m.exec( QCursor::pos() ); 357 m.exec( QCursor::pos() );
358 358
359} 359}
360 360
361void fileBrowser::doCd() { 361void fileBrowser::doCd() {
362 listClicked( ListView->currentItem()); 362 listClicked( ListView->currentItem());
363} 363}
364 364
365void fileBrowser::makDir() { 365void fileBrowser::makDir() {
366 InputDialog *fileDlg; 366 InputDialog *fileDlg;
367 fileDlg = new InputDialog(this,"Make Directory",TRUE, 0); 367 fileDlg = new InputDialog(this,"Make Directory",TRUE, 0);
368 fileDlg->exec(); 368 fileDlg->exec();
369 if( fileDlg->result() == 1 ) { 369 if( fileDlg->result() == 1 ) {
370 QString filename = fileDlg->LineEdit1->text(); 370 QString filename = fileDlg->LineEdit1->text();
371 currentDir.mkdir( currentDir.canonicalPath()+"/"+filename); 371 currentDir.mkdir( currentDir.canonicalPath()+"/"+filename);
372 } 372 }
373 populateList(); 373 populateList();
374} 374}
375 375
376void fileBrowser::localRename() { 376void fileBrowser::localRename() {
377 QString curFile = ListView->currentItem()->text(0); 377 QString curFile = ListView->currentItem()->text(0);
378 InputDialog *fileDlg; 378 InputDialog *fileDlg;
379 fileDlg = new InputDialog(this,"Rename",TRUE, 0); 379 fileDlg = new InputDialog(this,"Rename",TRUE, 0);
380 fileDlg->inputText = curFile; 380 fileDlg->inputText = curFile;
381 fileDlg->exec(); 381 fileDlg->exec();
382 if( fileDlg->result() == 1 ) { 382 if( fileDlg->result() == 1 ) {
383 QString oldname = currentDir.canonicalPath() + "/" + curFile; 383 QString oldname = currentDir.canonicalPath() + "/" + curFile;
384 QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist"; 384 QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist";
385 if( rename(oldname.latin1(), newName.latin1())== -1) 385 if( rename(oldname.latin1(), newName.latin1())== -1)
386 QMessageBox::message("Note","Could not rename"); 386 QMessageBox::message("Note","Could not rename");
387 } 387 }
388 populateList(); 388 populateList();
389} 389}
390 390
391void fileBrowser::localDelete() { 391void fileBrowser::localDelete() {
392 QString f = ListView->currentItem()->text(0); 392 QString f = ListView->currentItem()->text(0);
393 if(QDir(f).exists() ) { 393 if(QDir(f).exists() ) {
394 switch ( QMessageBox::warning(this,"Delete","Do you really want to delete\n"+f+ 394 switch ( QMessageBox::warning(this,"Delete","Do you really want to delete\n"+f+
395 " ?\nIt must be empty","Yes","No",0,0,1) ) { 395 " ?\nIt must be empty","Yes","No",0,0,1) ) {
396 case 0: { 396 case 0: {
397 f=currentDir.canonicalPath()+"/"+f; 397 f=currentDir.canonicalPath()+"/"+f;
398 QString cmd="rmdir "+f; 398 QString cmd="rmdir "+f;
399 system( cmd.latin1()); 399 system( cmd.latin1());
400 populateList(); 400 populateList();
401 } 401 }
402 break; 402 break;
403 case 1: 403 case 1:
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
425void fileBrowser::updateMimeTypeMenu() { 425void 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
445void fileBrowser::showType(const QString &t) { 445void 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
467QStringList fileBrowser::getMimeTypes() { 467QStringList 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
495void fileBrowser::receive( const QCString &msg, const QByteArray &data ) { 495void 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
506void fileBrowser::dirPathComboActivated( const QString & current) { 506void fileBrowser::dirPathComboActivated( const QString & current) {
507 chdir( current.latin1() ); 507 chdir( current.latin1() );
508 currentDir.cd( current, TRUE); 508 currentDir.cd( current, TRUE);
509 populateList(); 509 populateList();
510 update(); 510 update();
511} 511}
512 512
513void fileBrowser::dirPathEditPressed() { 513void fileBrowser::dirPathEditPressed() {
514 QString current = dirPathCombo->lineEdit()->text(); 514 QString current = dirPathCombo->lineEdit()->text();
515 chdir( current.latin1() ); 515 chdir( current.latin1() );
516 currentDir.cd( current, TRUE); 516 currentDir.cd( current, TRUE);
517 populateList(); 517 populateList();
518 update(); 518 update();
519} 519}
520 520
521void fileBrowser::fillCombo(const QString &currentPath) { 521void fileBrowser::fillCombo(const QString &currentPath) {
522 522
523 dirPathCombo->lineEdit()->setText(currentPath); 523 dirPathCombo->lineEdit()->setText(currentPath);
524 524
525 if( dirPathStringList.grep(currentPath,TRUE).isEmpty() ) { 525 if( dirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
526 dirPathCombo->clear(); 526 dirPathCombo->clear();
527 dirPathStringList.prepend(currentPath ); 527 dirPathStringList.prepend(currentPath );
528 dirPathCombo->insertStringList( dirPathStringList,-1); 528 dirPathCombo->insertStringList( dirPathStringList,-1);
529 } 529 }
530 530
531} 531}