Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
If StartupMode is true, ignore doing any MemoryFS clean ups.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 6 Mar 2016 17:25:46 +0000 (17:25 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 6 Mar 2016 17:25:46 +0000 (17:25 +0000)
source/frmContact.cpp

index ed8f2fb..a94c876 100644 (file)
@@ -50,47 +50,49 @@ void frmContact::CloseWindow( wxCloseEvent& event ){
 
        wxFileSystem::AddHandler(new wxMemoryFSHandler);
 
-       if (MemoryFSListPtr->find(SessionID) == MemoryFSListPtr->end()){
+       if (StartupMode == false){
+       
+               if (MemoryFSListPtr->find(SessionID) == MemoryFSListPtr->end()){
 
-       } else {
+               } else {
 
-               std::map<wxString, wxString>::iterator striter;
+                       std::map<wxString, wxString>::iterator striter;
 
-               for (striter = MemoryFSListPtr->begin(); striter != MemoryFSListPtr->end(); striter++){
+                       for (striter = MemoryFSListPtr->begin(); striter != MemoryFSListPtr->end(); striter++){
 
-                       if (SessionID == striter->second){
+                               if (SessionID == striter->second){
 
-                               // Delete the references from the wxMemoryFSHandler
-                               // and the entry from the map.
+                                       // Delete the references from the wxMemoryFSHandler
+                                       // and the entry from the map.
 
-                               wxMemoryFSHandler::RemoveFile(striter->first);
+                                       wxMemoryFSHandler::RemoveFile(striter->first);
 
-                               break;
+                                       break;
 
-                       }
+                               }
 
-               }
+                       }
 
-               MemoryFSListPtr->erase(striter);
+                       MemoryFSListPtr->erase(striter);
 
-       }
+               }
        
-       WindowData *WData = new WindowData;
+               WindowData *WData = new WindowData;
 
-       WData->DataType = 0;
-       WData->WindowPointer = this;
-       WData->WindowID = ContactUID;
+               WData->DataType = 0;
+               WData->WindowPointer = this;
+               WData->WindowID = ContactUID;
 
-       wxCommandEvent delevent(WINDOW_CLOSE);
-       delevent.SetClientData(WData);
-       wxPostEvent(GetParent(), delevent);
+               wxCommandEvent delevent(WINDOW_CLOSE);
+               delevent.SetClientData(WData);
+               wxPostEvent(GetParent(), delevent);
        
+       }
+               
        Destroy();
 
 }
 
-
-
 bool frmContact::SetupContactData(vCard *vCardObj){
 
        wxFileSystem::AddHandler(new wxMemoryFSHandler);
@@ -113,7 +115,6 @@ bool frmContact::SetupContactData(vCard *vCardObj){
        OldSessionID = SessionID;
        SessionID = wxString::Format(wxT("%i"), rand() % 32768);
        LoadContactData(vCardObj, htmContactData, SessionID, OldSessionID, MemoryFSListPtr);
-       SetTitle(vCardObj->Get(wxT("FN")));
        ArrayvCardOutData FNList;
        FNList = vCardObj->GetByPartial(wxT("FN"));
        
@@ -121,18 +122,22 @@ bool frmContact::SetupContactData(vCard *vCardObj){
                FNList.PropValues[0].Trim();
                SetTitle(FNList.PropValues[0]);
        }
+       
+       if (StartupMode == false){
+       
+               WindowData *WData = new WindowData;
 
-       WindowData *WData = new WindowData;
-
-       vCardFilename = vCardObj->GetFilename();
-
-       WData->DataType = 0;
-       WData->WindowPointer = this;
-       WData->WindowID = ContactUID;
+               vCardFilename = vCardObj->GetFilename();
 
-       wxCommandEvent editevent(WINDOW_EDIT);
-       editevent.SetClientData(WData);
-       wxPostEvent(GetParent(), editevent);
+               WData->DataType = 0;
+               WData->WindowPointer = this;
+               WData->WindowID = ContactUID;
+       
+               wxCommandEvent editevent(WINDOW_EDIT);
+               editevent.SetClientData(WData);
+               wxPostEvent(GetParent(), editevent);
+               
+       }
 
        return TRUE;
 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy