summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 5edf102..59a605a 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -374,25 +374,24 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
374 Config cfg("TextEdit"); 374 Config cfg("TextEdit");
375 cfg. setGroup ( "Font" ); 375 cfg. setGroup ( "Font" );
376 376
377 QFont defaultFont = editor-> font ( ); 377 QFont defaultFont = editor-> font ( );
378 378
379 QString family = cfg. readEntry ( "Family", defaultFont. family ( )); 379 QString family = cfg. readEntry ( "Family", defaultFont. family ( ));
380 int size = cfg. readNumEntry ( "Size", defaultFont. pointSize ( )); 380 int size = cfg. readNumEntry ( "Size", defaultFont. pointSize ( ));
381 int weight = cfg. readNumEntry ( "Weight", defaultFont. weight ( )); 381 int weight = cfg. readNumEntry ( "Weight", defaultFont. weight ( ));
382 bool italic = cfg. readBoolEntry ( "Italic", defaultFont. italic ( )); 382 bool italic = cfg. readBoolEntry ( "Italic", defaultFont. italic ( ));
383 383
384 defaultFont = QFont ( family, size, weight, italic ); 384 defaultFont = QFont ( family, size, weight, italic );
385 editor-> setFont ( defaultFont ); 385 editor-> setFont ( defaultFont );
386
387// updateCaption(); 386// updateCaption();
388 387
389 cfg.setGroup ( "View" ); 388 cfg.setGroup ( "View" );
390 389
391 promptExit = cfg.readBoolEntry ( "PromptExit", false ); 390 promptExit = cfg.readBoolEntry ( "PromptExit", false );
392 openDesktop = cfg.readBoolEntry ( "OpenDesktop", true ); 391 openDesktop = cfg.readBoolEntry ( "OpenDesktop", true );
393 filePerms = cfg.readBoolEntry ( "FilePermissions", false ); 392 filePerms = cfg.readBoolEntry ( "FilePermissions", false );
394 useSearchBar = cfg.readBoolEntry ( "SearchBar", false ); 393 useSearchBar = cfg.readBoolEntry ( "SearchBar", false );
395 startWithNew = cfg.readBoolEntry ( "startNew", true); 394 startWithNew = cfg.readBoolEntry ( "startNew", true);
396 featureAutoSave = cfg.readBoolEntry( "autosave", false); 395 featureAutoSave = cfg.readBoolEntry( "autosave", false);
397 396
398 if(useSearchBar) searchBarAction->setOn(true); 397 if(useSearchBar) searchBarAction->setOn(true);
@@ -690,57 +689,65 @@ void TextEdit::openDotFile( const QString &f ) {
690 edited=false; 689 edited=false;
691 690
692 691
693 } 692 }
694 updateCaption( currentFileName); 693 updateCaption( currentFileName);
695} 694}
696 695
697void TextEdit::openFile( const QString &f ) { 696void TextEdit::openFile( const QString &f ) {
698 qDebug("filename is "+ f); 697 qDebug("filename is "+ f);
699 QString filer; 698 QString filer;
700 QFileInfo fi( f); 699 QFileInfo fi( f);
701// bFromDocView = true; 700// bFromDocView = true;
702 if(f.find(".desktop",0,true) != -1 && !openDesktop ) { 701 if(f.find(".desktop",0,true) != -1 && !openDesktop )
702 {
703 switch ( QMessageBox::warning(this,tr("Text Editor"), 703 switch ( QMessageBox::warning(this,tr("Text Editor"),
704 tr("Text Editor has detected<BR>you selected a <B>.desktop</B> 704 tr("Text Editor has detected<BR>you selected a <B>.desktop</B>
705file.<BR>Open <B>.desktop</B> file or <B>linked</B> file?"), 705file.<BR>Open <B>.desktop</B> file or <B>linked</B> file?"),
706 tr(".desktop File"),tr("Linked Document"),0,1,1) ) { 706 tr(".desktop File"),tr("Linked Document"),0,1,1) )
707 case 0: 707 {
708 case 0: //desktop
708 filer = f; 709 filer = f;
709 break; 710 break;
710 case 1: 711 case 1: //linked
711 DocLnk sf(f); 712 DocLnk sf(f);
712 filer = sf.file(); 713 filer = sf.file();
713 break; 714 break;
715 };
714 } 716 }
715 } else if(fi.baseName().left(1) == "") { 717 else if(fi.baseName().left(1) == "")
718 {
719 qDebug("opening dotfile");
716 currentFileName=f; 720 currentFileName=f;
717 openDotFile(currentFileName); 721 openDotFile(currentFileName);
718 } else { 722 return;
723 }
724 else
725 {
719 DocLnk sf(f); 726 DocLnk sf(f);
720 filer = sf.file(); 727 filer = sf.file();
721 if(filer.right(1) == "/") 728 if(filer.right(1) == "/")
722 filer = f; 729 filer = f;
730 }
723 731
724 DocLnk nf; 732 DocLnk nf;
725 nf.setType("text/plain"); 733 nf.setType("text/plain");
726 nf.setFile(filer); 734 nf.setFile(filer);
727 currentFileName=filer; 735 currentFileName=filer;
728 736
729 nf.setName(fi.baseName()); 737 nf.setName(fi.baseName());
730 openFile(nf); 738 openFile(nf);
731 739
732 qDebug("openFile string "+currentFileName); 740 qDebug("openFile string "+currentFileName);
733 741
734 }
735 showEditTools(); 742 showEditTools();
736 // Show filename in caption 743 // Show filename in caption
737 QString name = filer; 744 QString name = filer;
738 int sep = name.findRev( '/' ); 745 int sep = name.findRev( '/' );
739 if ( sep > 0 ) 746 if ( sep > 0 )
740 name = name.mid( sep+1 ); 747 name = name.mid( sep+1 );
741 updateCaption( name ); 748 updateCaption( name );
742} 749}
743 750
744void TextEdit::openFile( const DocLnk &f ) { 751void TextEdit::openFile( const DocLnk &f ) {
745// clear(); 752// clear();
746// bFromDocView = true; 753// bFromDocView = true;