[GME-commit]
GMESRC/GME/Mga MgaProject.cpp,1.51,1.52 MgaProject.h,1.24,1.25
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Mon Jul 19 04:42:32 CDT 2004
- Previous message: [GME-commit]
GMESRC/GME/Parser MgaParser.cpp,1.22,1.23 MgaParser.h,1.8,1.9
- Next message: [GME-commit] GMESRC/GME/Gme ParadigmPropertiesDlg.cpp,NONE,1.1
ParadigmPropertiesDlg.h,NONE,1.1 GME.rc,1.121,1.122
GUIObject.cpp,1.45,1.46 GUIObject.h,1.22,1.23
ProjectPropertiesDlg.cpp,1.5,1.6 ProjectPropertiesDlg.h,1.2,1.3
resource.h,1.55,1.56
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/gme/GMESRC/GME/Mga
In directory braindrain:/tmp/cvs-serv2297
Modified Files:
MgaProject.cpp MgaProject.h
Log Message:
New MGA guid handling. New GUID will be assigned upon any change to the project.
CVS User: volgy
Index: MgaProject.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Mga/MgaProject.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** MgaProject.cpp 19 Jul 2004 07:01:00 -0000 1.51
--- MgaProject.cpp 19 Jul 2004 08:42:30 -0000 1.52
***************
*** 33,36 ****
--- 33,37 ----
mgaversion = 0;
aurcnt = 0;
+ guidstat = CLEAN;
}
***************
*** 157,160 ****
--- 158,162 ----
COMTHROW(dataproject->CreateProject(projectname, genericproject));
opened = UNCHANGED;
+ guidstat = DIRTY;
CComPtr<IMgaTerritory> lm;
***************
*** 189,192 ****
--- 191,195 ----
COMCATCH(
opened = CLOSED;
+ guidstat = CLEAN;
if(dataproject) dataproject->CloseProject();
if(metapr) metapr->Close();
***************
*** 217,220 ****
--- 220,224 ----
opened = UNCHANGED;
+ guidstat = CLEAN;
CComPtr<IMgaTerritory> lm;
COMTHROW(CreateTerritory(NULL, &lm));
***************
*** 274,277 ****
--- 278,282 ----
COMTHROW(CommitTransaction());
opened = CHANGED;
+ guidstat = DIRTY;
} catch(hresult_exception &e) {
lm->Flush();
***************
*** 298,301 ****
--- 303,307 ----
COMCATCH(
opened = CLOSED;
+ guidstat = CLEAN;
if(dataproject) dataproject->CloseProject();
if(metapr) metapr->Close();
***************
*** 320,323 ****
--- 326,330 ----
opened = UNCHANGED;
+ guidstat = CLEAN;
CComPtr<IMgaTerritory> lm;
COMTHROW(CreateTerritory(NULL, &lm));
***************
*** 424,427 ****
--- 431,435 ----
CoreObj self;
COMTHROW(dataproject->get_RootObject(&self.ComPtr()));
+ FixupGUID();
locking_type ppp;
COMTHROW(self->get_PeerLockValue(ATTRID_LOCK, &ppp));
***************
*** 469,472 ****
--- 477,481 ----
CoreObj self;
COMTHROW(dataproject->get_RootObject(&self.ComPtr()));
+ FixupGUID();
locking_type ppp;
COMTHROW(self->get_PeerLockValue(ATTRID_LOCK, &ppp));
***************
*** 494,497 ****
--- 503,507 ----
MARKSIG('8');
opened = CLOSED;
+ guidstat = CLEAN;
projconn.Empty();
parconn.Empty();
***************
*** 754,761 ****
--- 764,779 ----
{
CHECK_OUTPAR(pVal);
+
+ FixupGUID(false);
+
CoreObj self;
COMTHROW(dataproject->get_RootObject(&self.ComPtr()));
CComVariant p = self[ATTRID_GUID];
+
+ if (guidstat == PENDING) {
+ p = pendingguid;
+ }
+
if( p.vt != (VT_UI1 | VT_ARRAY) || GetArrayLength(p) != sizeof(GUID) )
{
***************
*** 782,785 ****
--- 800,804 ----
self[ATTRID_GUID] = newVal;
+ guidstat = MANUAL;
notifyqueueprocessed = true;
COMTHROW(GlobalNotify(GLOBALEVENT_PROJECT_PROPERTIES));
***************
*** 1181,1184 ****
--- 1200,1209 ----
transactioncount++;
opened = CHANGED;
+ if (guidstat == MANUAL) {
+ guidstat = CLEAN;
+ }
+ else {
+ guidstat = DIRTY;
+ }
}
MARKSIG('7');
***************
*** 1392,1396 ****
if(baseterr) COMTHROW(E_MGA_ALREADY_IN_TRANSACTION);
COMTHROW(dataproject->UndoTransaction());
! if(!--transactioncount) opened = UNCHANGED;
{
aurcnt++;
--- 1417,1424 ----
if(baseterr) COMTHROW(E_MGA_ALREADY_IN_TRANSACTION);
COMTHROW(dataproject->UndoTransaction());
! if(!--transactioncount) {
! opened = UNCHANGED;
! guidstat = CLEAN;
! }
{
aurcnt++;
***************
*** 1412,1415 ****
--- 1440,1444 ----
transactioncount++;
opened = CHANGED;
+ guidstat = DIRTY;
{
aurcnt++;
***************
*** 1451,1454 ****
--- 1480,1498 ----
}
+ void CMgaProject::FixupGUID(bool write) {
+ if (guidstat == DIRTY) {
+ GUID newGUID;
+ COMTHROW(CoCreateGuid(&newGUID));
+ CopyTo(newGUID, pendingguid);
+ guidstat = PENDING;
+ }
+ if ((guidstat == PENDING) && write) {
+ ASSERT(baseterr);
+ CoreObj self;
+ COMTHROW(dataproject->get_RootObject(&self.ComPtr()));
+ self[ATTRID_GUID] = pendingguid;
+ guidstat = CLEAN;
+ }
+ }
Index: MgaProject.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Mga/MgaProject.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** MgaProject.h 19 Jul 2004 07:01:00 -0000 1.24
--- MgaProject.h 19 Jul 2004 08:42:30 -0000 1.25
***************
*** 156,159 ****
--- 156,160 ----
ICoreProject* dataproject;
void ObjMark(IMgaObject *s, long mask);
+ void FixupGUID(bool write = true);
void StartAutoAddOns(); // start if enabled
***************
*** 208,211 ****
--- 209,217 ----
unsigned long opmask;
bool read_only;
+
+ int guidstat;
+ CComVariant pendingguid;
+ enum guidmodes { CLEAN, DIRTY, PENDING, MANUAL};
+
enum openmodes { CLOSED = 0, UNCHANGED = 1, CHANGED = 2, CLOSEERROR = 4};
int transactioncount;
- Previous message: [GME-commit]
GMESRC/GME/Parser MgaParser.cpp,1.22,1.23 MgaParser.h,1.8,1.9
- Next message: [GME-commit] GMESRC/GME/Gme ParadigmPropertiesDlg.cpp,NONE,1.1
ParadigmPropertiesDlg.h,NONE,1.1 GME.rc,1.121,1.122
GUIObject.cpp,1.45,1.46 GUIObject.h,1.22,1.23
ProjectPropertiesDlg.cpp,1.5,1.6 ProjectPropertiesDlg.h,1.2,1.3
resource.h,1.55,1.56
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the GME-commit
mailing list