Skip to content

Commit

Permalink
DM: Moved killing of trash data folder to own data management function
Browse files Browse the repository at this point in the history
New function: KillTrashFolders

No functional changes
  • Loading branch information
MichaelHuth committed Aug 15, 2024
1 parent d8f6166 commit ce02f8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 1 addition & 7 deletions Packages/MIES/MIES_IgorHooks.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ static Function IH_KillTemporaries()
KillStrings/Z dfrHW:ITCDeviceList

// try to delete all trash folders
trashFolders = GetListOfObjects(dfr, TRASH_FOLDER_PREFIX + ".*", typeFlag = COUNTOBJECTS_DATAFOLDER, fullPath = 1)

numFolders = ItemsInList(trashFolders)
for(i = 0; i < numFolders; i += 1)
path = StringFromList(i, trashFolders)
KillDataFolder/Z $path
endfor
KillTrashFolders()

RemoveEmptyDataFolder(dfr)

Expand Down
12 changes: 12 additions & 0 deletions Packages/MIES/MIES_MiesUtilities_DataManagement.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,15 @@ threadsafe Function MoveToTrash([wv, dfr])
endif
endif
End

threadsafe Function KillTrashFolders()

string dfPath

DFREF dfr = GetMiesPath()
WAVE/T trashFolders = ListToTextWave(GetListOfObjects(dfr, TRASH_FOLDER_PREFIX + ".*", typeFlag = COUNTOBJECTS_DATAFOLDER, fullPath = 1), ";")

for(dfPath : trashFolders)
KillDataFolder/Z $dfPath
endfor
End

0 comments on commit ce02f8f

Please sign in to comment.