-rw-r--r-- | core/apps/textedit/textedit.cpp | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 1e8ce7f..f571511 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -980,26 +980,26 @@ bool TextEdit::saveAs() { text << "*"; map.insert(tr("All"), text ); QFileInfo cuFi( currentFileName); QString filee = cuFi.fileName(); QString dire = cuFi.dirPath(); if(dire==".") dire = QPEApplication::documentDir(); QString str; if( !featureAutoSave) { str = OFileDialog::getSaveFileName( 2, - dire, - filee, map); + dire, + filee, map); } else str=currentFileName; if(!str.isEmpty()) { QString fileNm=str; qDebug("saving filename "+fileNm); QFileInfo fi(fileNm); currentFileName=fi.fileName(); if(doc) // QString file = doc->file(); // doc->removeFiles(); @@ -1209,57 +1209,54 @@ int TextEdit::savePrompt() case 2: { return -1; } break; }; return 0; } void TextEdit::timerCrank() { - if(featureAutoSave) + if(featureAutoSave && edited1) { - if( edited1 ) + if(currentFileName.isEmpty()) { - if(currentFileName.isEmpty()) - { - currentFileName = QDir::homeDirPath()+"/textedit.tmp"; - saveAs(); - } - else - { - qDebug("autosave"); - save(); - } - setTimer(); + currentFileName = QDir::homeDirPath()+"/textedit.tmp"; + saveAs(); } + else + { +// qDebug("autosave"); + save(); + } + setTimer(); } } void TextEdit::doTimer(bool b) { Config cfg("TextEdit"); cfg.setGroup ( "View" ); cfg.writeEntry ( "autosave", b); featureAutoSave = b; nAutoSave->setOn(b); if(b) { - qDebug("doTimer true"); +// qDebug("doTimer true"); setTimer(); } - else - qDebug("doTimer false"); +// else +// qDebug("doTimer false"); } void TextEdit::setTimer() { if(featureAutoSave) { - qDebug("setting autosave"); +// qDebug("setting autosave"); QTimer *timer = new QTimer(this ); connect( timer, SIGNAL(timeout()), this, SLOT(timerCrank()) ); - timer->start( 30000/*0*/, true); //5 minutes + timer->start( 300000, true); //5 minutes } } |