Bug 72552

Summary: Unsaved changes icon disappears even if save could not be performed.
Product: [Applications] kdevelop Reporter: Robin Stevens <robin>
Component: generalAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.0.0b2   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: patch

Description Robin Stevens 2004-01-13 15:22:57 UTC
Version:           3.0.0b2 (using KDE KDE 3.1.4)
Installed from:    Debian testing/unstable Packages
OS:          Linux

In the case of a "file could not be saved" dialog (due to lack of write permissions), the unsaved changes icon disappears upon dismissal of the dialog.

The save has not been performed.

Reference to Bug 72548 - which may cover this too.
Comment 1 Jens Dagerbo 2004-01-13 15:37:40 UTC
Created attachment 4144 [details]
patch

Right, we noticed yesterday. This patch should solve that, but CVS is in deep
freeze.. :/
Comment 2 Jens Dagerbo 2004-01-21 09:11:21 UTC
Subject: kdevelop/src

CVS commit by dagerbo: 

Fixes bug 72552.

CCMAIL: 72552-done@bugs.kde.org


  M +10 -6     partcontroller.cpp   1.112


--- kdevelop/src/partcontroller.cpp  #1.111:1.112
@@ -1127,14 +1127,18 @@ void PartController::slotFileDirty( cons
         kdDebug(9000) << k_funcinfo << endl;
         
-        KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart*>( partForURL( url ) );
-        if ( !ro_part || !ro_part->widget() ) return;
+        KParts::ReadWritePart * rw_part = dynamic_cast<KParts::ReadWritePart*>( partForURL( url ) );
+        if ( !rw_part || !rw_part->widget() ) return;
         
-        if ( isDirty( ro_part ) ) 
+        if ( isDirty( rw_part ) ) 
         {
-                ro_part->widget()->setIcon( SmallIcon("revert") );
+                rw_part->widget()->setIcon( SmallIcon("revert") );
+        } 
+        else if ( !rw_part->isModified() )
+        {
+                rw_part->widget()->setIcon( SmallIcon("kdevelop") );
         } 
         else 
         {
-                ro_part->widget()->setIcon( SmallIcon("kdevelop") );
+                rw_part->widget()->setIcon( SmallIcon("filesave") );
         }
 }