User: vg      
Date: 2008-08-18 13:09:31+0000
Modified:
   dba/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx

Log:
 INTEGRATION: CWS cmcfixes48 (1.8.24); FILE MERGED
 2008/07/24 13:16:23 cmc 1.8.24.1: #i92087# minimal firefox/etc profile finder 
implementation

File Changes:

Directory: /dba/connectivity/source/drivers/mozab/bootstrap/
============================================================

File [changed]: MNSProfileDiscover.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx?r1=1.8&r2=1.9
Delta lines:  +43 -8
--------------------
--- MNSProfileDiscover.cxx      2008-06-06 08:36:43+0000        1.8
+++ MNSProfileDiscover.cxx      2008-08-18 13:09:28+0000        1.9
@@ -32,6 +32,7 @@
 #include "precompiled_connectivity.hxx"
 
 #include "MNSProfileDiscover.hxx"
+#ifndef MINIMAL_PROFILEDISCOVER
 #include "MNSProfile.hxx"
 
 #include "pratom.h"
@@ -88,6 +89,7 @@
 
 // IID and CIDs of all the services needed
 static NS_DEFINE_CID(kCharsetConverterManagerCID, 
NS_ICHARSETCONVERTERMANAGER_CID);
+#endif
 
 // Registry Keys
 
@@ -105,7 +107,13 @@
 {
        namespace mozab
        {
-               ProfileStruct::ProfileStruct(MozillaProductType 
aProduct,::rtl::OUString aProfileName,nsILocalFile * aProfilePath)
+               ProfileStruct::ProfileStruct(MozillaProductType 
aProduct,::rtl::OUString aProfileName,
+#ifdef MINIMAL_PROFILEDISCOVER
+            const ::rtl::OUString& aProfilePath
+#else
+            nsILocalFile * aProfilePath
+#endif
+          )
                {
                        product=aProduct;
                        profileName = aProfileName;
@@ -113,6 +121,9 @@
                }
                ::rtl::OUString ProfileStruct::getProfilePath() 
                {
+#ifdef MINIMAL_PROFILEDISCOVER
+                       return profilePath;
+#else
                        if (profilePath)
                        {
                                nsAutoString path;
@@ -122,9 +133,9 @@
                        }
                        else
                 return ::rtl::OUString();
+#endif
                }
 
-
                ProfileAccess::~ProfileAccess()
                {
                }
@@ -132,20 +143,24 @@
                {
                        LoadProductsInfo();
                }
+
                sal_Int32 ProfileAccess::LoadProductsInfo()
                {
+#ifndef MINIMAL_PROFILEDISCOVER
                        //load mozilla profiles to m_ProductProfileList
                        LoadMozillaProfiles();
-                       sal_Int32 index=MozillaProductType_Mozilla;
-                       sal_Int32 
count=m_ProductProfileList[index].mProfileList.size();
+#endif
+                       sal_Int32 
count=m_ProductProfileList[MozillaProductType_Mozilla].mProfileList.size();
                        
                        //load thunderbird profiles to m_ProductProfileList
                        count += 
LoadXPToolkitProfiles(MozillaProductType_Thunderbird);
+
                        //load firefox profiles to m_ProductProfileList
                        //firefox profile does not containt address book, but 
maybe others need them
                        count += 
LoadXPToolkitProfiles(MozillaProductType_Firefox);
                        return count;
                }
+#ifndef MINIMAL_PROFILEDISCOVER
                nsresult ProfileAccess::LoadMozillaProfiles()
                {
                        sal_Int32 index=MozillaProductType_Mozilla;
@@ -249,13 +264,16 @@
                        }
                        return rv;
                }
+#endif
                //Thunderbird and firefox profiles are saved in profiles.ini
                sal_Int32 
ProfileAccess::LoadXPToolkitProfiles(MozillaProductType product)
                {
                        sal_Int32 index=product;
                        ProductStruct &m_Product = m_ProductProfileList[index];
 
+#ifndef MINIMAL_PROFILEDISCOVER
                        nsresult rv;
+#endif
                        ::rtl::OUString regDir = getRegistryDir(product);
             ::rtl::OUString profilesIni( regDir );
             profilesIni += ::rtl::OUString::createFromAscii( "profiles.ini" );
@@ -302,6 +320,7 @@
                                                isRelative = 
sIsRelative.toInt32();
                                        }
                                        
+#ifndef MINIMAL_PROFILEDISCOVER
                                        nsCOMPtr<nsILocalFile> rootDir;
                                        rv = NS_NewLocalFile(EmptyString(), 
PR_TRUE,
                                                                                
        getter_AddRefs(rootDir));
@@ -321,8 +340,15 @@
                                                rv = 
rootDir->SetPersistentDescriptor(filePath);
                                        }
                                        if (NS_FAILED(rv)) continue;
+#endif
 
-                                       ProfileStruct*  profileItem     = new 
ProfileStruct(product,profileName,rootDir);
+                                       ProfileStruct*  profileItem     = new 
ProfileStruct(product,profileName,
+#ifdef MINIMAL_PROFILEDISCOVER
+                                                       regDir + profilePath
+#else
+                                                       rootDir
+#endif
+                                               );
                                        m_Product.mProfileList[profileName] = 
profileItem;
 
                                        sal_Int32 isDefault = 0;
@@ -338,6 +364,7 @@
                        }
                        return m_Product.mProfileList.size();
                }
+
                ::rtl::OUString ProfileAccess::getProfilePath( 
::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& 
profileName ) throw (::com::sun::star::uno::RuntimeException)
                {
                        sal_Int32 index=product;
@@ -350,6 +377,7 @@
                        else
                                return 
m_Product.mProfileList[profileName]->getProfilePath();
                }
+
                ::sal_Int32 ProfileAccess::getProfileCount( 
::com::sun::star::mozilla::MozillaProductType product) throw 
(::com::sun::star::uno::RuntimeException)
                {
                        sal_Int32 index=product;
@@ -373,6 +401,7 @@
                        
                        return m_Product.mProfileList.size();
                }
+
                ::rtl::OUString ProfileAccess::getDefaultProfile( 
::com::sun::star::mozilla::MozillaProductType product ) throw 
(::com::sun::star::uno::RuntimeException)
                {
                        sal_Int32 index=product;
@@ -390,6 +419,7 @@
                        ProfileStruct * aProfile = 
(*m_Product.mProfileList.begin()).second;
                        return aProfile->getProfileName();
                }
+#ifndef MINIMAL_PROFILEDISCOVER
                nsresult ProfileAccess::isExistFileOrSymlink(nsILocalFile* 
aFile,PRBool *bExist)
                {
                        nsresult rv;
@@ -448,9 +478,12 @@
                        return nExist;
                }
 
-
+#endif
                ::sal_Bool ProfileAccess::isProfileLocked( 
::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& 
profileName ) throw (::com::sun::star::uno::RuntimeException)
                {
+#ifdef MINIMAL_PROFILEDISCOVER
+                       return sal_True;
+#else
                        ::rtl::OUString path = 
getProfilePath(product,profileName);
                        if (!path.getLength())
                                return sal_True;
@@ -474,7 +507,9 @@
                        if (rv)
                                return sal_True;
                        return sal_False;
+#endif
                }
+
                ::sal_Bool ProfileAccess::getProfileExists( 
::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& 
profileName ) throw (::com::sun::star::uno::RuntimeException)
                {
                        sal_Int32 index=product;
@@ -486,7 +521,7 @@
                        else
                                return sal_True;
                }
-
-
        }
 }
+
+




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to