[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: [Bug 61204] autosave after specified time since last edit
From: David Faure <faure () kde ! org>
Date: 2004-04-26 22:57:11
Message-ID: 20040426225711.11568.qmail () ktown ! kde ! org
[Download RAW message or body]
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=61204
faure kde org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From faure kde org 2004-04-27 00:57 -------
CVS commit by faure:
Stop the autosave timer after autosaving, and restart it when making the
first change since the last autosave (which we catch in setModified).
CCMAIL: 61204-done bugs kde org
M +13 -6 koDocument.cc 1.305
--- koffice/lib/kofficecore/koDocument.cc #1.304:1.305
@ -522,5 +522,4 @ bool KoDocument::isAutoErrorHandlingEnab
void KoDocument::slotAutoSave()
{
- //kdDebug(30003)<<"Autosave : modifiedAfterAutosave \
"<<d->modifiedAfterAutosave<<endl; if ( isModified() && d->modifiedAfterAutosave )
{
@ -530,6 +529,8 @ void KoDocument::slotAutoSave()
bool ret = saveNativeFormat( autoSaveFile( m_file ) );
setModified( true );
- if ( ret )
- d->modifiedAfterAutosave=false;
+ if ( ret ) {
+ d->modifiedAfterAutosave = false;
+ d->m_autoSaveTimer.stop(); // until the next change
+ }
d->m_autosaving = false;
emit sigClearStatusBarMessage();
@ -1762,10 +1763,16 @ bool KoDocument::isStoredExtern()
void KoDocument::setModified( bool mod )
{
+ if ( isAutosaving() ) // ignore setModified calls due to autosaving
+ return;
+
//kdDebug(30003)<<k_funcinfo<<" url:" << m_url.path() << endl;
//kdDebug(30003)<<k_funcinfo<<" mod="<<mod<<" MParts \
mod="<<KParts::ReadWritePart::isModified()<<" isModified="<<isModified()<<endl;
- d->modifiedAfterAutosave=mod;
- if ( isAutosaving() ) // ignore setModified calls due to autosaving
- return;
+ if ( mod && !d->modifiedAfterAutosave ) {
+ // First change since last autosave -> start the autosave timer
+ setAutoSave( d->m_autoSaveDelay );
+ }
+ d->modifiedAfterAutosave = mod;
+
if ( mod == KParts::ReadWritePart::isModified() )
return;
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic