void AIIO_FixupAssetPath( gPathMap_t& pm ) { std::string rootFolder( "/" ); rootFolder.append( ASSET_Q3_ROOT ); if ( pm.path[ 0 ] != '/' ) { rootFolder.append( 1, '/' ); } pm.path = rootFolder + pm.path; }
nsresult nsWMUtils::GetRootFolder(nsIFile **aRootFolder) { nsCOMPtr<nsIWindowsRegKey> key; if (NS_FAILED(nsWMUtils::FindWMKey(getter_AddRefs(key)))) { IMPORT_LOG0("*** Error finding Windows Live Mail registry account keys\n"); return NS_ERROR_NOT_AVAILABLE; } // This is essential to proceed; it is the location on disk of xml-type account files; // it is in reg_expand_sz so it will need expanding to absolute path. nsString storeRoot; nsresult rv = key->ReadStringValue(NS_LITERAL_STRING("Store Root"), storeRoot); key->Close(); // Finished with windows registry key. We do not want to return before this closing if (NS_FAILED(rv) || storeRoot.IsEmpty()) { IMPORT_LOG0("*** Error finding Windows Live Mail Store Root\n"); return rv; } uint32_t size = ::ExpandEnvironmentStringsW((LPCWSTR)storeRoot.get(), nullptr, 0); nsString expandedStoreRoot; expandedStoreRoot.SetLength(size - 1); if (expandedStoreRoot.Length() != size - 1) return false; ::ExpandEnvironmentStringsW((LPCWSTR)storeRoot.get(), (LPWSTR)expandedStoreRoot.BeginWriting(), size); storeRoot = expandedStoreRoot; nsCOMPtr<nsIFile> rootFolder(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv)); NS_ENSURE_SUCCESS(rv, rv); rv = rootFolder->InitWithPath(storeRoot); NS_ENSURE_SUCCESS(rv, rv); rootFolder.forget(aRootFolder); return NS_OK; }
void TabsSettings::init ( ) { AppLnkSet rootFolder( MimeType::appsFolderName ( )); QStringList types = rootFolder. types ( ); m_list-> insertItem ( tr( "All Tabs" )); m_ids << GLOBALID; for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); m_ids << *it; } m_list-> insertItem ( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ), tr( "Documents" ) ); m_ids += "Documents"; // No tr Config cfg ( "Launcher" ); readTabSettings ( cfg ); cfg. setGroup ( "GUI" ); m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); m_staticbackground->setChecked( cfg.readBoolEntry( "StaticBackground", true ) ); }