[GME-commit] GMESRC/GME/Mga MgaProject.cpp,1.47,1.48

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu Apr 22 08:25:54 CDT 2004


Update of /var/lib/gme/GMESRC/GME/Mga
In directory braindrain:/tmp/cvs-serv12824/GME/Mga

Modified Files:
	MgaProject.cpp 
Log Message:
Introduced GLOBALEVENT_OPEN_PROJECT in the Mga layer
Modified IMgaProject::Close to send GLOBALEVENT_CLOSE_PROJECT notifications to autoaddons also.
Hope, these modifications are compatible with all existing clients of the Mga layer.

CVS User: volgy

Index: MgaProject.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Mga/MgaProject.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** MgaProject.cpp	5 Apr 2004 11:21:17 -0000	1.47
--- MgaProject.cpp	22 Apr 2004 12:25:52 -0000	1.48
***************
*** 284,287 ****
--- 284,297 ----
  		COMTHROW(RegisterActiveObject((IMgaProject *)this,CLSID_MgaProject,ACTIVEOBJECT_STRONG,&rot));
  		StartAutoAddOns();
+ 		try {
+ 			COMTHROW(BeginTransaction(lm, TRANSACTION_READ_ONLY));
+ 			GlobalNotify(GLOBALEVENT_OPEN_PROJECT);
+ 			COMTHROW(lm->Flush());
+ 			COMTHROW(CommitTransaction());
+ 		} catch(hresult_exception &e) {
+ 			lm->Flush();
+ 			AbortTransaction();
+ 			throw e;
+ 		}
  		MARKSIG('2');
  	} 
***************
*** 336,339 ****
--- 346,360 ----
  		COMTHROW(RegisterActiveObject((IMgaProject *)this,CLSID_MgaProject,ACTIVEOBJECT_STRONG,&rot));
  		StartAutoAddOns();
+ 	
+ 		try {
+ 			COMTHROW(BeginTransaction(lm, TRANSACTION_READ_ONLY));
+ 			GlobalNotify(GLOBALEVENT_OPEN_PROJECT);
+ 			COMTHROW(CommitTransaction());
+ 		} catch(hresult_exception &e) {
+ 			lm->Flush();
+ 			AbortTransaction();
+ 			throw e;
+ 		}
+ 
  		MARKSIG('2');
  	} 
***************
*** 437,442 ****
  	}
  	if(baseterr) COMTHROW(AbortTransaction());
! 	StopAutoAddOns();
! 	RemoveClients();
  	COMTRY {
  		{
--- 458,462 ----
  	}
  	if(baseterr) COMTHROW(AbortTransaction());
! 	
  	COMTRY {
  		{
***************
*** 460,463 ****
--- 480,486 ----
  			}
  		}
+ 		
+ 		StopAutoAddOns();  // PETER: Moved these two lines here, otherwise addons won't receive notifications
+ 		RemoveClients();   //
  
  	 	if(rot) COMTHROW(RevokeActiveObject(rot,NULL));



More information about the GME-commit mailing list