Changeset 23675 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 10, 2009 9:59:29 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Global.cpp
r23648 r23675 210 210 } 211 211 212 /*static*/ const char * 213 Global::stringifySessionState(SessionState_T aState) 214 { 215 switch (aState) 216 { 217 case SessionState_Null: return "Null"; 218 case SessionState_Closed: return "Closed"; 219 case SessionState_Open: return "Open"; 220 case SessionState_Spawning: return "Spawning"; 221 case SessionState_Closing: return "Closing"; 222 default: 223 { 224 AssertMsgFailed(("%d (%#x)\n", aState, aState)); 225 static char s_szMsg[48]; 226 RTStrPrintf(s_szMsg, sizeof(s_szMsg), "InvalidState-0x%08x\n", aState); 227 return s_szMsg; 228 } 229 230 } 231 } 232 212 233 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/MachineImpl.cpp
r23674 r23675 3034 3034 if (mData->mSession.mState != SessionState_Open) 3035 3035 return setError(VBOX_E_INVALID_VM_STATE, 3036 tr("Machine session is not open (session state: % d)"),3037 mData->mSession.mState);3036 tr("Machine session is not open (session state: %s)"), 3037 Global::stringifySessionState(mData->mSession.mState)); 3038 3038 3039 3039 directControl = mData->mSession.mDirectControl; … … 3061 3061 if (mData->mSession.mState != SessionState_Open) 3062 3062 return setError(E_FAIL, 3063 tr("Machine session is not open (session state: % d)"),3064 mData->mSession.mState);3063 tr("Machine session is not open (session state: %s)"), 3064 Global::stringifySessionState(mData->mSession.mState)); 3065 3065 3066 3066 directControl = mData->mSession.mDirectControl; … … 3672 3672 mUserData->mName.raw()); 3673 3673 3674 LogFlowThisFunc(("mSession.mState=% d\n", mData->mSession.mState));3674 LogFlowThisFunc(("mSession.mState=%s\n", Global::stringifySessionState(mData->mSession.mState))); 3675 3675 3676 3676 if (mData->mSession.mState == SessionState_Open || … … 3889 3889 mUserData->mName.raw()); 3890 3890 3891 LogFlowThisFunc(("mSession.mState=% d\n", mData->mSession.mState));3891 LogFlowThisFunc(("mSession.mState=%s\n", Global::stringifySessionState(mData->mSession.mState))); 3892 3892 3893 3893 if (mData->mSession.mState == SessionState_Open || … … 4126 4126 tr ("The machine '%ls' is not registered"), mUserData->mName.raw()); 4127 4127 4128 LogFlowThisFunc(("mSession.state=% d\n", mData->mSession.mState));4128 LogFlowThisFunc(("mSession.state=%s\n", Global::stringifySessionState(mData->mSession.mState))); 4129 4129 4130 4130 if (mData->mSession.mState != SessionState_Open) -
trunk/src/VBox/Main/SessionImpl.cpp
r23223 r23675 30 30 #include "SessionImpl.h" 31 31 #include "ConsoleImpl.h" 32 #include "Global.h" 32 33 33 34 #include "Logging.h" … … 50 51 if (mState != SessionState_Open) \ 51 52 return setError (E_UNEXPECTED, \ 52 tr ("The session is not open")); \ 53 tr ("The session is not open (session state: %s)"), \ 54 Global::stringifySessionState(mState)); \ 53 55 } while (0) 54 56 … … 466 468 AutoWriteLock alock(this); 467 469 468 LogFlowThisFunc(("mState=% d, mType=%d\n", mState, mType));470 LogFlowThisFunc(("mState=%s, mType=%d\n", Global::stringifySessionState(mState), mType)); 469 471 470 472 if (mState == SessionState_Closing) … … 675 677 if (mState != SessionState_Open) 676 678 return setError (VBOX_E_INVALID_VM_STATE, 677 tr ("Machine session is not open (session state: % d)."),678 mState);679 tr ("Machine session is not open (session state: %s)."), 680 Global::stringifySessionState(mState)); 679 681 AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 680 682 CheckComArgNotNull(aName); … … 712 714 if (mState != SessionState_Open) 713 715 return setError (VBOX_E_INVALID_VM_STATE, 714 tr ("Machine session is not open (session state: % d)."),715 mState);716 tr ("Machine session is not open (session state: %s)."), 717 Global::stringifySessionState(mState)); 716 718 AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 717 719 if (!VALID_PTR (aPatterns) && (aPatterns != NULL)) … … 758 760 AutoWriteLock alock(this); 759 761 760 LogFlowThisFunc(("mState=% d, mType=%d\n", mState, mType));762 LogFlowThisFunc(("mState=%s, mType=%d\n", Global::stringifySessionState(mState), mType)); 761 763 762 764 if (mState != SessionState_Open) -
trunk/src/VBox/Main/include/Global.h
r23648 r23675 122 122 */ 123 123 static const char *stringifyMachineState(MachineState_T aState); 124 125 /** 126 * Stringify a session state. 127 * 128 * @returns Pointer to a read only string. 129 * @param aState Valid session state. 130 */ 131 static const char *stringifySessionState(MachineState_T aState); 124 132 }; 125 133
Note:
See TracChangeset
for help on using the changeset viewer.