summaryrefslogtreecommitdiff
path: root/core/apps/textedit
authorllornkcor <llornkcor>2004-09-18 09:14:31 (UTC)
committer llornkcor <llornkcor>2004-09-18 09:14:31 (UTC)
commitf0e025a8e64f96390377c0aa66e8b5602494d7d0 (patch) (unidiff)
tree3c812aec7e4bec59cea71f2e16cd1f77230a79fd /core/apps/textedit
parenteaf09b9b6e1abbe36e814a8e4da315ac8d96bd63 (diff)
downloadopie-f0e025a8e64f96390377c0aa66e8b5602494d7d0.zip
opie-f0e025a8e64f96390377c0aa66e8b5602494d7d0.tar.gz
opie-f0e025a8e64f96390377c0aa66e8b5602494d7d0.tar.bz2
fix #1399
Diffstat (limited to 'core/apps/textedit') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 086fdb6..1d0df6a 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -766,34 +766,40 @@ void TextEdit::showEditTools() {
766 menu->show(); 766 menu->show();
767 editBar->show(); 767 editBar->show();
768 if(!useSearchBar) 768 if(!useSearchBar)
769 searchBar->hide(); 769 searchBar->hide();
770 else 770 else
771 searchBar->show(); 771 searchBar->show();
772 setWState (WState_Reserved1 ); 772 setWState (WState_Reserved1 );
773} 773}
774 774
775/*! 775/*!
776 unprompted save */ 776 unprompted save */
777bool TextEdit::save() { 777bool TextEdit::save() {
778 QString name, file;
778 odebug << "saveAsFile " + currentFileName << oendl; 779 odebug << "saveAsFile " + currentFileName << oendl;
779 if(currentFileName.isEmpty()) { 780 if(currentFileName.isEmpty()) {
780 saveAs(); 781 saveAs();
781 return false; 782 return false;
782 } 783 }
783 784 name = currentFileName;
784 QString file = doc->file(); 785 if(doc) {
786 file = doc->file();
785 odebug << "saver file "+file << oendl; 787 odebug << "saver file "+file << oendl;
786 QString name= doc->name(); 788 name = doc->name();
787 odebug << "File named "+name << oendl; 789 odebug << "File named "+name << oendl;
790 } else {
791 name = file = currentFileName;
792 }
793
788 QString rt = editor->text(); 794 QString rt = editor->text();
789 if( !rt.isEmpty() ) { 795 if( !rt.isEmpty() ) {
790 if(name.isEmpty()) { 796 if(name.isEmpty()) {
791 saveAs(); 797 saveAs();
792 } else { 798 } else {
793 currentFileName= name ; 799 currentFileName= name ;
794 odebug << "saveFile "+currentFileName << oendl; 800 odebug << "saveFile "+currentFileName << oendl;
795 801
796 struct stat buf; 802 struct stat buf;
797 mode_t mode; 803 mode_t mode;
798 stat(file.latin1(), &buf); 804 stat(file.latin1(), &buf);
799 mode = buf.st_mode; 805 mode = buf.st_mode;