ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

LPCTSTR FileTypeManager::set_type ( struct Entry entry,
bool  dont_hide_ext = false 
)

Definition at line 220 of file explorer.cpp.

Referenced by WinDirectory::read_directory(), and ShellDirectory::read_directory().

{
    LPCTSTR ext = _tcsrchr(entry->_data.cFileName, TEXT('.'));

    if (ext) {
        const FileTypeInfo& type = (*this)[ext];

        if (!type._displayname.empty())
            entry->_type_name = _tcsdup(type._displayname);

         // hide some file extensions
        if (type._neverShowExt && !dont_hide_ext) {
            int len = ext - entry->_data.cFileName;

            if (entry->_display_name != entry->_data.cFileName)
                free(entry->_display_name);

            entry->_display_name = (LPTSTR) malloc((len+1)*sizeof(TCHAR));
            lstrcpyn(entry->_display_name, entry->_data.cFileName, len + 1);
        }

        if (is_exe_file(ext))
            entry->_data.dwFileAttributes |= ATTRIBUTE_EXECUTABLE;
    }

    return ext;
}

Generated on Sun May 27 2012 06:20:20 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.