summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-13 01:05:41 (UTC)
committer llornkcor <llornkcor>2002-03-13 01:05:41 (UTC)
commitfc49c34cfd2ce2adad2920daa368b25f42b8bad7 (patch) (unidiff)
tree8e5b7397427dcc0ab53d4090d72af2a38066f040
parent8e9330a8626076a3dd289a1abbe218eccd3a1784 (diff)
downloadopie-fc49c34cfd2ce2adad2920daa368b25f42b8bad7.zip
opie-fc49c34cfd2ce2adad2920daa368b25f42b8bad7.tar.gz
opie-fc49c34cfd2ce2adad2920daa368b25f42b8bad7.tar.bz2
fixed err when openinging a file from Docs tab, the edited asterik wasn't being set
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index dafe1dc..f031a0f 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -848,64 +848,67 @@ void TextEdit::clear()
848 delete doc; 848 delete doc;
849 doc = 0; 849 doc = 0;
850 editor->clear(); 850 editor->clear();
851} 851}
852 852
853void TextEdit::updateCaption( const QString &name ) 853void TextEdit::updateCaption( const QString &name )
854{ 854{
855 if ( !doc ) 855 if ( !doc )
856 setCaption( tr("Text Editor") ); 856 setCaption( tr("Text Editor") );
857 else { 857 else {
858 QString s = name; 858 QString s = name;
859 if ( s.isNull() ) 859 if ( s.isNull() )
860 s = doc->name(); 860 s = doc->name();
861 if ( s.isEmpty() ) { 861 if ( s.isEmpty() ) {
862 s = tr( "Unnamed" ); 862 s = tr( "Unnamed" );
863 currentFileName=s; 863 currentFileName=s;
864 } 864 }
865 865
866 setCaption( s + " - " + tr("Text Editor") ); 866 setCaption( s + " - " + tr("Text Editor") );
867 } 867 }
868} 868}
869 869
870void TextEdit::setDocument(const QString& fileref) 870void TextEdit::setDocument(const QString& fileref)
871{ 871{
872 bFromDocView = TRUE; 872 bFromDocView = TRUE;
873 qDebug("setDocument "+fileref); 873 qDebug("setDocument "+fileref);
874 bFromDocView = TRUE; 874 bFromDocView = TRUE;
875 if(fileref.find(".desktop",0,TRUE) == -1) { 875 if(fileref.find(".desktop",0,TRUE) == -1) {
876 openFile(fileref); 876 openFile(fileref);
877 } else { 877 } else {
878 openFile(DocLnk(fileref)); 878 openFile(DocLnk(fileref));
879 } 879 }
880 editor->setEdited(TRUE);
881 edited1=FALSE;
882 edited=TRUE;
880} 883}
881 884
882void TextEdit::closeEvent( QCloseEvent *e ) 885void TextEdit::closeEvent( QCloseEvent *e )
883{ 886{
884 if ( editorStack->visibleWidget() == fileSelector && !bFromDocView ) { 887 if ( editorStack->visibleWidget() == fileSelector && !bFromDocView ) {
885 e->ignore(); 888 e->ignore();
886 repaint(); 889 repaint();
887// fileRevert(); 890// fileRevert();
888 891
889 } else { 892 } else {
890 bFromDocView = FALSE; 893 bFromDocView = FALSE;
891 e->accept(); 894 e->accept();
892 } 895 }
893} 896}
894 897
895void TextEdit::accept() 898void TextEdit::accept()
896 { 899 {
897 QString file = doc->file(); 900 QString file = doc->file();
898 if (file.find("_.txt",0,TRUE) ==-1) 901 if (file.find("_.txt",0,TRUE) ==-1)
899 save(); 902 save();
900 else { 903 else {
901 QFile(file).remove(); 904 QFile(file).remove();
902 } 905 }
903 exit(0); 906 exit(0);
904 907
905} 908}
906 909
907void TextEdit::changeFont() { 910void TextEdit::changeFont() {
908 FontDatabase fdb; 911 FontDatabase fdb;
909 QFont defaultFont=editor->font(); 912 QFont defaultFont=editor->font();
910 QFontInfo fontInfo(defaultFont); 913 QFontInfo fontInfo(defaultFont);
911 Config cfg("TextEdit"); 914 Config cfg("TextEdit");