- Timestamp:
- Jul 26, 2007 9:15:14 AM (18 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r3859 r3861 64 64 #define BOOL PRBool 65 65 #endif 66 67 #include <iprt/param.h> 68 #include <iprt/path.h> 66 69 67 70 #if defined (VBOX_GUI_DEBUG) … … 1998 2001 QString selectedLangId = gVBoxBuiltInLangName; 1999 2002 2000 QString nlsPath = qApp->applicationDirPath() + gVBoxLangSubDir; 2003 char szNlsPath[RTPATH_MAX]; 2004 int rc; 2005 2006 RTPathAppPrivateNoArch(szNlsPath, sizeof(szNlsPath)); 2007 Assert(RT_SUCCESS(rc)); 2008 2009 QString nlsPath = QString(szNlsPath) + gVBoxLangSubDir; 2001 2010 QDir nlsDir (nlsPath); 2002 2011 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r3828 r3861 40 40 41 41 #include <iprt/err.h> 42 #include <iprt/param.h> 43 #include <iprt/path.h> 42 44 43 45 #if defined (Q_WS_WIN32) … … 1761 1763 HH_DISPLAY_TOPIC, NULL); 1762 1764 #elif defined (Q_WS_X11) 1763 QString fullProgPath = qApp->applicationDirPath(); 1765 char szDocsPath[RTPATH_MAX]; 1766 int rc; 1767 1768 RTPathAppDocs(szDocsPath, sizeof(szDocsPath)); 1769 Assert(RT_SUCCESS(rc)); 1770 1771 QString fullProgPath = QString(szDocsPath); 1764 1772 QProcess kchmViewer (fullProgPath + "/kchmviewer"); 1765 1773 kchmViewer.addArgument (fullProgPath + "/VirtualBox.chm"); -
trunk/src/VBox/Main/ConsoleImpl.cpp
r3833 r3861 4656 4656 #ifdef VBOX_WITH_XPCOM 4657 4657 // VBoxC is located in the components subdirectory 4658 char szPath Program[RTPATH_MAX + sizeof("/components/VBoxC")];4659 rc = RTPath Program(szPathProgram, RTPATH_MAX);AssertRC(rc);4660 strcat(szPath Program, "/components/VBoxC");4661 rc = CFGMR3InsertString(pMod, "Path", szPath Program);RC_CHECK();4658 char szPathVBoxC[RTPATH_MAX]; 4659 rc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(rc); 4660 strcat(szPathVBoxC, "/components/VBoxC"); 4661 rc = CFGMR3InsertString(pMod, "Path", szPathVBoxC); RC_CHECK(); 4662 4662 #else 4663 4663 rc = CFGMR3InsertString(pMod, "Path", "VBoxC"); RC_CHECK(); -
trunk/src/VBox/Main/MachineImpl.cpp
r3668 r3861 2788 2788 /* get the path to the executable */ 2789 2789 char path [RTPATH_MAX]; 2790 RTPath Program(path, RTPATH_MAX);2790 RTPathAppPrivateArch (path, RTPATH_MAX); 2791 2791 size_t sz = strlen (path); 2792 2792 path [sz++] = RTPATH_DELIMITER; -
trunk/src/VBox/Main/glue/initterm.cpp
r3387 r3861 64 64 DirectoryServiceProvider() 65 65 : mCompRegLocation (NULL), mXPTIDatLocation (NULL) 66 , mComponentDirLocation (NULL), mCurrProcDirLocation (NULL) 66 67 {} 67 68 … … 69 70 70 71 HRESULT init (const char *aCompRegLocation, 71 const char *aXPTIDatLocation); 72 const char *aXPTIDatLocation, 73 const char *aComponentDirLocation, 74 const char *aCurrProcDirLocation); 72 75 73 76 NS_DECL_NSIDIRECTORYSERVICEPROVIDER … … 77 80 char *mCompRegLocation; 78 81 char *mXPTIDatLocation; 82 char *mComponentDirLocation; 83 char *mCurrProcDirLocation; 79 84 }; 80 85 … … 92 97 RTStrFree (mXPTIDatLocation); 93 98 mXPTIDatLocation = NULL; 99 } 100 if (mComponentDirLocation) 101 { 102 RTStrFree (mComponentDirLocation); 103 mComponentDirLocation = NULL; 104 } 105 if (mCurrProcDirLocation) 106 { 107 RTStrFree (mCurrProcDirLocation); 108 mCurrProcDirLocation = NULL; 94 109 } 95 110 } … … 101 116 HRESULT 102 117 DirectoryServiceProvider::init (const char *aCompRegLocation, 103 const char *aXPTIDatLocation) 118 const char *aXPTIDatLocation, 119 const char *aComponentDirLocation, 120 const char *aCurrProcDirLocation) 104 121 { 105 122 AssertReturn (aCompRegLocation, NS_ERROR_INVALID_ARG); … … 109 126 if (RT_SUCCESS (vrc)) 110 127 vrc = RTStrUtf8ToCurrentCP (&mXPTIDatLocation, aXPTIDatLocation); 128 if (RT_SUCCESS (vrc) && aComponentDirLocation) 129 vrc = RTStrUtf8ToCurrentCP (&mComponentDirLocation, aComponentDirLocation); 130 if (RT_SUCCESS (vrc) && aCurrProcDirLocation) 131 vrc = RTStrUtf8ToCurrentCP (&mCurrProcDirLocation, aCurrProcDirLocation); 111 132 112 133 return RT_SUCCESS (vrc) ? NS_OK : NS_ERROR_OUT_OF_MEMORY; … … 130 151 else if (strcmp (aProp, NS_XPCOM_XPTI_REGISTRY_FILE) == 0) 131 152 fileLocation = mXPTIDatLocation; 153 else if (mComponentDirLocation && strcmp (aProp, NS_XPCOM_COMPONENT_DIR) == 0) 154 fileLocation = mComponentDirLocation; 155 else if (mCurrProcDirLocation && strcmp (aProp, NS_XPCOM_CURRENT_PROCESS_DIR) == 0) 156 fileLocation = mCurrProcDirLocation; 132 157 else 133 158 return NS_ERROR_FAILURE; … … 185 210 /* prepare paths for registry files */ 186 211 char homeDir [RTPATH_MAX]; 212 char privateArchDir [RTPATH_MAX]; 187 213 int vrc = GetVBoxUserHomeDirectory (homeDir, sizeof (homeDir)); 188 214 if (RT_SUCCESS (vrc)) 215 vrc = RTPathAppPrivateArch (privateArchDir, sizeof (privateArchDir)); 216 if (RT_SUCCESS (vrc)) 189 217 { 190 218 char compReg [RTPATH_MAX]; 191 219 char xptiDat [RTPATH_MAX]; 220 char compDir [RTPATH_MAX]; 192 221 193 222 RTStrPrintf (compReg, sizeof (compReg), "%s%c%s", … … 195 224 RTStrPrintf (xptiDat, sizeof (xptiDat), "%s%c%s", 196 225 homeDir, RTPATH_DELIMITER, "xpti.dat"); 226 RTStrPrintf (compDir, sizeof (compDir), "%s%c/components", 227 privateArchDir, RTPATH_DELIMITER); 197 228 198 229 dsProv = new DirectoryServiceProvider(); 199 230 if (dsProv) 200 rc = dsProv->init (compReg, xptiDat );231 rc = dsProv->init (compReg, xptiDat, compDir, privateArchDir); 201 232 else 202 233 rc = NS_ERROR_OUT_OF_MEMORY; -
trunk/src/VBox/VMM/PDMLdr.cpp
r2981 r3861 940 940 static char * pdmR3File(const char *pszFile, const char *pszDefaultExt, bool fShared) 941 941 { 942 char *pszRet; 943 944 #ifdef VBOX_PATH_PRIVATE_LIBS 945 946 /* 947 * Unix: Search in /usr/lib/virtualbox 948 */ 949 pszRet = pdmR3FileConstruct( 950 # ifdef VBOX_PATH_SHARED_LIBS 951 fShared ? VBOX_PATH_SHARED_LIBS : VBOX_PATH_PRIVATE_LIBS, 952 # else 953 VBOX_PATH_PRIVATE_LIBS, 954 # endif 955 pszFile, pszDefaultExt); 956 957 #else 958 959 NOREF(fShared); 960 961 /* 962 * Default: Search in the program path. 963 */ 964 char szPath[RTPATH_MAX]; 965 int rc = RTPathProgram(szPath, sizeof(szPath)); 942 char szPath[RTPATH_MAX]; 943 int rc; 944 945 rc = fShared ? RTPathSharedLibs(szPath, sizeof(szPath)) 946 : RTPathAppPrivateArch(szPath, sizeof(szPath)); 966 947 if (!VBOX_SUCCESS(rc)) 967 948 { … … 970 951 } 971 952 972 pszRet = pdmR3FileConstruct(szPath, pszFile, pszDefaultExt); 973 974 #endif 975 976 return pszRet; 953 return pdmR3FileConstruct(szPath, pszFile, pszDefaultExt); 977 954 } 978 955
Note:
See TracChangeset
for help on using the changeset viewer.