[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdevelop/src
From:       Jens Dagerbo <jens.dagerbo () swipnet ! se>
Date:       2005-01-23 19:08:10
Message-ID: 20050123190810.A66671CF8F () office ! kde ! org
[Download RAW message or body]

CVS commit by dagerbo: 

Never automatically reload deleted files. Alert the user.


  M +11 -2     partcontroller.cpp   1.155
  M +1 -1      partcontroller.h   1.64


--- kdevelop/src/partcontroller.cpp  #1.154:1.155
@@ -1207,5 +1207,5 @@ void PartController::slotDocumentDirty( 
                 }
                 
-                if ( reactToDirty( url ) )
+                if ( reactToDirty( url, reason ) )
                 {
                         // file has been reloaded
@@ -1234,5 +1234,5 @@ bool PartController::isDirty( KURL const
 }
 
-bool PartController::reactToDirty( KURL const & url )
+bool PartController::reactToDirty( KURL const & url, unsigned char reason )
 {       
     KConfig *config = kapp->config();
@@ -1262,4 +1262,13 @@ bool PartController::reactToDirty( KURL 
         }
         
+        if ( reason == 3 ) // means the file was deleted
+        {
+                KMessageBox::sorry( TopLevel::getInstance()->main(), 
+                        i18n("Warning: The file \"%1\" has been deleted on disc.\n\n"
+                                        "If this was not your intention, make sure to save this file \
now.").arg( url.path() ), +                        i18n("File Deleted") );
+                return false;
+        }
+        
         if ( dirtyAction == "alert" )
         {

--- kdevelop/src/partcontroller.h  #1.63:1.64
@@ -153,5 +153,5 @@ private:
   
   bool isDirty( KURL const & url );
-  bool reactToDirty( KURL const & url );
+  bool reactToDirty( KURL const & url, unsigned char reason );
     
   KURL storedURLForPart( KParts::ReadOnlyPart * );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic