Skip to content

Commit

Permalink
Merge pull request #4517 from hansva/4515
Browse files Browse the repository at this point in the history
Only hide and disable the project metadata folder, fixes #4515
  • Loading branch information
hansva authored Nov 4, 2024
2 parents 902de83 + 9c5a6a9 commit 1111ca0
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,11 @@ private DragSource createTreeDragSource(final Tree tree) {
@Override
public void dragStart(DragSourceEvent event) {
ExplorerFile file = getSelectedFile();
String metadataFolder = hopGui.getVariables().getVariable(Const.HOP_METADATA_FOLDER);
// Avoid moving root folder, metadata folder or hidden file (like .git)
if (file == null
|| file.getFilename().equals(rootFolder)
|| file.getFilename().equals("metadata")
|| file.getFilename().contains(metadataFolder)
|| file.getName().startsWith(".")) {
event.doit = false;
return;
Expand Down Expand Up @@ -1372,10 +1373,13 @@ private void refreshFolder(TreeItem item, String path, int depth) {
for (FileObject child : children) {

String childName = child.getName().getBaseName();
String metadataFolder = hopGui.getVariables().getVariable(Const.HOP_METADATA_FOLDER);

// Skip hidden files or folders
if (!showingHiddenFiles
&& (child.isHidden() || childName.startsWith(".") || childName.equals("metadata"))) {
&& (child.isHidden()
|| childName.startsWith(".")
|| child.toString().contains(metadataFolder))) {
continue;
}

Expand Down

0 comments on commit 1111ca0

Please sign in to comment.