Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

CollectProgramsThread Struct Reference

Thread for collecting start menu entries. More...

#include <searchprogram.h>

Inheritance diagram for CollectProgramsThread:
Inheritance graph
[legend]
Collaboration diagram for CollectProgramsThread:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CollectProgramsThread (COLLECT_CALLBACK callback, HWND hwnd, void *para)
 ~CollectProgramsThread ()
int Run ()
void free_dirs ()

Public Attributes

bool _cache_valid

Protected Member Functions

void collect_programs (const ShellPath &path)

Protected Attributes

COLLECT_CALLBACK _callback
HWND _hwnd
void * _para
ShellDirectoryStack _dirs

Detailed Description

Thread for collecting start menu entries.

Definition at line 35 of file searchprogram.h.


Constructor & Destructor Documentation

CollectProgramsThread::CollectProgramsThread ( COLLECT_CALLBACK  callback,
HWND  hwnd,
void *  para 
) [inline]

Definition at line 37 of file searchprogram.h.

     :  _cache_valid(false),
        _callback(callback),
        _hwnd(hwnd),
        _para(para)
    {
    }
CollectProgramsThread::~CollectProgramsThread (  ) [inline]

Definition at line 45 of file searchprogram.h.

References free_dirs().

    {
        free_dirs();
    }

Here is the call graph for this function:


Member Function Documentation

void CollectProgramsThread::collect_programs ( const ShellPath path ) [protected]

Definition at line 57 of file searchprogram.cpp.

References Thread::_alive, _callback, _dirs, Entry::_down, _para, GetDesktopFolder(), Entry::smart_scan(), and SORT_NONE.

Referenced by Run().

{
    ShellDirectory* dir = new ShellDirectory(GetDesktopFolder(), path, 0);
    _dirs.push(dir);

    dir->smart_scan(SORT_NONE);

    for(Entry*entry=dir->_down; _alive && entry; entry=entry->_next) {
        if (entry->_shell_attribs & SFGAO_HIDDEN)
            continue;

        if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
            collect_programs(entry->create_absolute_pidl());
        else if (entry->_shell_attribs & SFGAO_LINK)
            if (_alive)
                _callback(entry, _para);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CollectProgramsThread::free_dirs (  )

Definition at line 76 of file searchprogram.cpp.

References _dirs, and Entry::free_subentries().

Referenced by FindProgramDlg::Refresh(), and ~CollectProgramsThread().

{
    while(!_dirs.empty()) {
        ShellDirectory* dir = _dirs.top();
        dir->free_subentries();
        _dirs.pop();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int CollectProgramsThread::Run (  ) [virtual]

Implements Thread.

Definition at line 38 of file searchprogram.cpp.

References Thread::_alive, _cache_valid, _hwnd, and collect_programs().

{
    try {
        collect_programs(SpecialFolderPath(CSIDL_COMMON_PROGRAMS, _hwnd));
    } catch(COMException&) {
    }

    if (_alive)
        try {
            collect_programs(SpecialFolderPath(CSIDL_PROGRAMS, _hwnd));
        } catch(COMException&) {
        }

    if (_alive)
        _cache_valid = true;

    return 0;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 53 of file searchprogram.h.

Referenced by FindProgramDlg::Notify(), FindProgramDlg::Refresh(), and Run().

Definition at line 56 of file searchprogram.h.

Referenced by collect_programs().

Definition at line 59 of file searchprogram.h.

Referenced by collect_programs(), and free_dirs().

Definition at line 57 of file searchprogram.h.

Referenced by Run().

void* CollectProgramsThread::_para [protected]

Definition at line 58 of file searchprogram.h.

Referenced by collect_programs().


The documentation for this struct was generated from the following files:

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage