-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 | |||
@@ -990,6 +990,6 @@ bool TextEdit::saveAs() { | |||
990 | { | 990 | { |
991 | str = OFileDialog::getSaveFileName( 2, | 991 | str = OFileDialog::getSaveFileName( 2, |
992 | dire, | 992 | dire, |
993 | filee, map); | 993 | filee, map); |
994 | } | 994 | } |
995 | else | 995 | else |
@@ -1219,20 +1219,17 @@ int TextEdit::savePrompt() | |||
1219 | void TextEdit::timerCrank() | 1219 | void TextEdit::timerCrank() |
1220 | { | 1220 | { |
1221 | if(featureAutoSave) | 1221 | if(featureAutoSave && edited1) |
1222 | { | 1222 | { |
1223 | if( edited1 ) | 1223 | if(currentFileName.isEmpty()) |
1224 | { | 1224 | { |
1225 | if(currentFileName.isEmpty()) | 1225 | currentFileName = QDir::homeDirPath()+"/textedit.tmp"; |
1226 | { | 1226 | saveAs(); |
1227 | currentFileName = QDir::homeDirPath()+"/textedit.tmp"; | ||
1228 | saveAs(); | ||
1229 | } | ||
1230 | else | ||
1231 | { | ||
1232 | qDebug("autosave"); | ||
1233 | save(); | ||
1234 | } | ||
1235 | setTimer(); | ||
1236 | } | 1227 | } |
1228 | else | ||
1229 | { | ||
1230 | // qDebug("autosave"); | ||
1231 | save(); | ||
1232 | } | ||
1233 | setTimer(); | ||
1237 | } | 1234 | } |
1238 | } | 1235 | } |
@@ -1247,9 +1244,9 @@ void TextEdit::doTimer(bool b) | |||
1247 | if(b) | 1244 | if(b) |
1248 | { | 1245 | { |
1249 | qDebug("doTimer true"); | 1246 | // qDebug("doTimer true"); |
1250 | setTimer(); | 1247 | setTimer(); |
1251 | } | 1248 | } |
1252 | else | 1249 | // else |
1253 | qDebug("doTimer false"); | 1250 | // qDebug("doTimer false"); |
1254 | } | 1251 | } |
1255 | 1252 | ||
@@ -1258,8 +1255,8 @@ void TextEdit::setTimer() | |||
1258 | if(featureAutoSave) | 1255 | if(featureAutoSave) |
1259 | { | 1256 | { |
1260 | qDebug("setting autosave"); | 1257 | // qDebug("setting autosave"); |
1261 | QTimer *timer = new QTimer(this ); | 1258 | QTimer *timer = new QTimer(this ); |
1262 | connect( timer, SIGNAL(timeout()), this, SLOT(timerCrank()) ); | 1259 | connect( timer, SIGNAL(timeout()), this, SLOT(timerCrank()) ); |
1263 | timer->start( 30000/*0*/, true); //5 minutes | 1260 | timer->start( 300000, true); //5 minutes |
1264 | } | 1261 | } |
1265 | } | 1262 | } |