Author Topic: _ProjectSet_WorkingDir then find in <Project> does not reflect the set value  (Read 2287 times)

ehab

  • Senior Community Member
  • Posts: 285
  • Hero Points: 15
  • coding with SE is like playing music
 :D

current project working dir is . but when i change that using
Code: [Select]
_ProjectSet_WorkingDir(_ProjectHandle(),"c:\somepath\");
and then invoke find in <Project> i expected the search will happen in somepath but its in the current project working dir!

is this a bug? any hints where i can make the change so it reads the correct value.

thanks for any directions.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1205
  • Hero Points: 116
Project file lists are cached, so if you are changing some property on the fly via macro, you may need to clear the cache.  Try _clearProjectFileListCache()

Code: [Select]
/**
 * Clears the cached file list for the given project.  This
 * should be called whenever a project changes.
 *
 * @param workspaceFile          full path to workspace file
 * @param projectFile            full path to project file
 * 
 * @categories Project_Functions
 */
extern void _clearProjectFileListCache(_str workspaceFile, _str projectFile);

ehab

  • Senior Community Member
  • Posts: 285
  • Hero Points: 15
  • coding with SE is like playing music
Lee, thanks for quick response.

i added
Code: [Select]
_clearProjectFileListCache(_workspace_filename,_project_get_filename());
before i set the new path but i cannot select subdirs in find dialog when look in : <Project>

any ideas why?

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1205
  • Hero Points: 116
<Project> only searches files listed in the current active project.  It does not additionally search working paths if that is what you are asking/expecting.

ehab

  • Senior Community Member
  • Posts: 285
  • Hero Points: 15
  • coding with SE is like playing music
i wanted to set a project working dir on the fly and then expected to use the find in files. Is there a workaround? if not then i'll next try if i can set the Find in files directory before show.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1205
  • Hero Points: 116
You could set the Find in: to "." (no quote) and which starts search at the current working directory.  Just make sure the working directory is set to c:\somepath, or whatever it is you want to search.

ehab

  • Senior Community Member
  • Posts: 285
  • Hero Points: 15
  • coding with SE is like playing music
such a simple solution. works fine : )

thanks again lee and have a nice weekend.

ehab

  • Senior Community Member
  • Posts: 285
  • Hero Points: 15
  • coding with SE is like playing music
just in an extra tip for the recored:

Code: [Select]
   _str prj_p=_ProjectGet_WorkingDir(_ProjectHandle());
   find_in_files('',prj_p);