-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 | |||
@@ -767,9 +767,9 @@ bool TextEdit::save() { | |||
767 | 767 | ||
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) |
775 | qDebug("no doc"); | 775 | qDebug("no doc"); |
@@ -783,9 +783,11 @@ bool TextEdit::saveAs() { | |||
783 | 783 | ||
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(); |
791 | int i = pt.find( ' ' ); | 793 | int i = pt.find( ' ' ); |
@@ -795,9 +797,10 @@ bool TextEdit::saveAs() { | |||
795 | // remove "." at the beginning | 797 | // remove "." at the beginning |
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() ) |
803 | docname = tr("Unnamed"); | 806 | docname = tr("Unnamed"); |
@@ -812,10 +815,12 @@ bool TextEdit::saveAs() { | |||
812 | text << "text/*"; | 815 | text << "text/*"; |
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; |
821 | 826 | ||
@@ -841,9 +846,11 @@ bool TextEdit::saveAs() { | |||
841 | } | 846 | } |
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 | ||
849 | if( filePerm) | 856 | if( filePerm) |