summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index e41c69d..2f59ede 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -669,52 +669,55 @@ void TextEdit::openFile( const DocLnk &f )
669 qDebug("openFile doclnk "+currentFileName); 669 qDebug("openFile doclnk "+currentFileName);
670 doc->setName(currentFileName); 670 doc->setName(currentFileName);
671 updateCaption(); 671 updateCaption();
672} 672}
673 673
674void TextEdit::showEditTools() 674void TextEdit::showEditTools()
675{ 675{
676// if ( !doc ) 676// if ( !doc )
677// close(); 677// close();
678// clear(); 678// clear();
679 fileSelector->hide(); 679 fileSelector->hide();
680 menu->show(); 680 menu->show();
681 editBar->show(); 681 editBar->show();
682 if ( searchVisible ) 682 if ( searchVisible )
683 searchBar->show(); 683 searchBar->show();
684// updateCaption(); 684// updateCaption();
685 editorStack->raiseWidget( editor ); 685 editorStack->raiseWidget( editor );
686 setWState (WState_Reserved1 ); 686 setWState (WState_Reserved1 );
687} 687}
688 688
689/*! 689/*!
690 unprompted save */ 690 unprompted save */
691bool TextEdit::save() 691bool TextEdit::save()
692{ 692{
693 qDebug("saveFile "+currentFileName); 693 QString file = doc->file();
694 694 QString name= doc->name();
695 QString rt = editor->text(); 695 QString rt = editor->text();
696 doc->setName( currentFileName); 696 currentFileName= file ;
697 qDebug("saveFile "+currentFileName);
698
699 doc->setName( name);
697 FileManager fm; 700 FileManager fm;
698 if ( !fm.saveFile( *doc, rt ) ) { 701 if ( !fm.saveFile( *doc, rt ) ) {
699 return false; 702 return false;
700 } 703 }
701// if(doc) 704// if(doc)
702// delete doc; 705// delete doc;
703// doc = 0; 706// doc = 0;
704 editor->setEdited( false ); 707 editor->setEdited( false );
705 return true; 708 return true;
706} 709}
707 710
708/*! 711/*!
709 prompted save */ 712 prompted save */
710bool TextEdit::saveAs() 713bool TextEdit::saveAs()
711{ 714{
712 qDebug("saveAsFile "+currentFileName); 715 qDebug("saveAsFile "+currentFileName);
713 716
714 // case of nothing to save... /// there's always something to save 717 // case of nothing to save... /// there's always something to save
715// if ( !doc )//|| !bFromDocView) 718// if ( !doc )//|| !bFromDocView)
716// { 719// {
717// qDebug("no doc"); 720// qDebug("no doc");
718// return true; 721// return true;
719// } 722// }
720 if ( !editor->edited() ) { 723 if ( !editor->edited() ) {