-rw-r--r-- | core/apps/textedit/textedit.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index f38ea53..e3b8361 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -768,7 +768,7 @@ bool TextEdit::save() { | |||
768 | /*! | 768 | /*! |
769 | prompted save */ | 769 | prompted save */ |
770 | bool TextEdit::saveAs() { | 770 | bool TextEdit::saveAs() { |
771 | qDebug("saveAsFile "+currentFileName); | 771 | qDebug("saveAsFile " + currentFileName); |
772 | // case of nothing to save... | 772 | // case of nothing to save... |
773 | if ( !doc ) { | 773 | if ( !doc ) { |
774 | //|| !bFromDocView) | 774 | //|| !bFromDocView) |
@@ -784,7 +784,9 @@ bool TextEdit::saveAs() { | |||
784 | QString rt = editor->text(); | 784 | QString rt = editor->text(); |
785 | qDebug(currentFileName); | 785 | qDebug(currentFileName); |
786 | 786 | ||
787 | if( currentFileName.isEmpty() || currentFileName == tr("Unnamed") || currentFileName == tr("Text Editor")) { | 787 | if( currentFileName.isEmpty() |
788 | || currentFileName == tr("Unnamed") | ||
789 | || currentFileName == tr("Text Editor")) { | ||
788 | // qDebug("do silly TT filename thing"); | 790 | // qDebug("do silly TT filename thing"); |
789 | if ( doc->name().isEmpty() ) { | 791 | if ( doc->name().isEmpty() ) { |
790 | QString pt = rt.simplifyWhiteSpace(); | 792 | QString pt = rt.simplifyWhiteSpace(); |
@@ -796,7 +798,8 @@ bool TextEdit::saveAs() { | |||
796 | while( docname.startsWith( "." ) ) | 798 | while( docname.startsWith( "." ) ) |
797 | docname = docname.mid( 1 ); | 799 | docname = docname.mid( 1 ); |
798 | docname.replace( QRegExp("/"), "_" ); | 800 | docname.replace( QRegExp("/"), "_" ); |
799 | // cut the length. filenames longer than that don't make sense and something goes wrong when they get too long. | 801 | // cut the length. filenames longer than that |
802 | //don't make sense and something goes wrong when they get too long. | ||
800 | if ( docname.length() > 40 ) | 803 | if ( docname.length() > 40 ) |
801 | docname = docname.left(40); | 804 | docname = docname.left(40); |
802 | if ( docname.isEmpty() ) | 805 | if ( docname.isEmpty() ) |
@@ -813,8 +816,10 @@ bool TextEdit::saveAs() { | |||
813 | map.insert(tr("Text"), text ); | 816 | map.insert(tr("Text"), text ); |
814 | text << "*"; | 817 | text << "*"; |
815 | map.insert(tr("All"), text ); | 818 | map.insert(tr("All"), text ); |
816 | 819 | // if(currentFileName | |
817 | QString str = OFileDialog::getSaveFileName( 2,QPEApplication::documentDir(), QString::null, map); | 820 | QString str = OFileDialog::getSaveFileName( 2, |
821 | QPEApplication::documentDir(), | ||
822 | currentFileName, map); | ||
818 | 823 | ||
819 | if(!str.isEmpty() ) { | 824 | if(!str.isEmpty() ) { |
820 | QString fileNm=str; | 825 | QString fileNm=str; |
@@ -842,7 +847,9 @@ bool TextEdit::saveAs() { | |||
842 | 847 | ||
843 | if( filePerms ) { | 848 | if( filePerms ) { |
844 | filePermissions *filePerm; | 849 | filePermissions *filePerm; |
845 | filePerm = new filePermissions(this, tr("Permissions"),true,0,(const QString &)fileNm); | 850 | filePerm = new filePermissions(this, |
851 | tr("Permissions"),true, | ||
852 | 0,(const QString &)fileNm); | ||
846 | filePerm->showMaximized(); | 853 | filePerm->showMaximized(); |
847 | filePerm->exec(); | 854 | filePerm->exec(); |
848 | 855 | ||