author | llornkcor <llornkcor> | 2003-02-18 19:29:56 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-02-18 19:29:56 (UTC) |
commit | 9f5098a6da637e81f6525482456394a68524dc61 (patch) (unidiff) | |
tree | 85bfd8e545a10d0faa321c174354d0a2302e0591 | |
parent | 4dd3080c36c96c58564a29f1b3d2cf21bfb1eae2 (diff) | |
download | opie-9f5098a6da637e81f6525482456394a68524dc61.zip opie-9f5098a6da637e81f6525482456394a68524dc61.tar.gz opie-9f5098a6da637e81f6525482456394a68524dc61.tar.bz2 |
5 minutes, not 30 seconds
-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 | |||
@@ -986,14 +986,14 @@ bool TextEdit::saveAs() { | |||
986 | if(dire==".") | 986 | if(dire==".") |
987 | dire = QPEApplication::documentDir(); | 987 | dire = QPEApplication::documentDir(); |
988 | QString str; | 988 | QString str; |
989 | if( !featureAutoSave) | 989 | if( !featureAutoSave) |
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 |
996 | str=currentFileName; | 996 | str=currentFileName; |
997 | if(!str.isEmpty()) { | 997 | if(!str.isEmpty()) { |
998 | QString fileNm=str; | 998 | QString fileNm=str; |
999 | 999 | ||
@@ -1215,51 +1215,48 @@ int TextEdit::savePrompt() | |||
1215 | 1215 | ||
1216 | return 0; | 1216 | return 0; |
1217 | } | 1217 | } |
1218 | 1218 | ||
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 | } |
1239 | 1236 | ||
1240 | void TextEdit::doTimer(bool b) | 1237 | void TextEdit::doTimer(bool b) |
1241 | { | 1238 | { |
1242 | Config cfg("TextEdit"); | 1239 | Config cfg("TextEdit"); |
1243 | cfg.setGroup ( "View" ); | 1240 | cfg.setGroup ( "View" ); |
1244 | cfg.writeEntry ( "autosave", b); | 1241 | cfg.writeEntry ( "autosave", b); |
1245 | featureAutoSave = b; | 1242 | featureAutoSave = b; |
1246 | nAutoSave->setOn(b); | 1243 | nAutoSave->setOn(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 | ||
1256 | void TextEdit::setTimer() | 1253 | void TextEdit::setTimer() |
1257 | { | 1254 | { |
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 | } |