From 36f42f62d06473215b5e16a92e89ea379933de22 Mon Sep 17 00:00:00 2001 From: Alessandro Ferro <49845537+xfarrow@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:55:37 +0200 Subject: [PATCH] Comments --- Guify/src/controllers/DesktopController.java | 6 ++++++ Guify/src/views/Desktop.java | 17 +++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Guify/src/controllers/DesktopController.java b/Guify/src/controllers/DesktopController.java index 10c880c..be91be7 100644 --- a/Guify/src/controllers/DesktopController.java +++ b/Guify/src/controllers/DesktopController.java @@ -420,11 +420,14 @@ public class DesktopController { } /** + * Checks if the specified path is readable by the current user + * @return true if readable, false otherwise * @deprecated This method is deprecated. Catch SftpException and look for * "Permission denied" instead. This prevents unnecessary * overhead */ public boolean isReadable(String path) { + // Create the construct [ -r "/path" ] && echo 1 || echo 0 StringBuilder command = new StringBuilder(); command.append("[ -r \""); command.append(path.equals("~") @@ -435,10 +438,13 @@ public class DesktopController { } /** + * Checks if the specified path is writable by the current user + * @return true if writable, false otherwise * @deprecated This method is deprecated. Catch SftpException and look for * "Permission denied" instead */ public boolean isWriteable(String path) { + // Create the construct [ -w "/path" ] && echo 1 || echo 0 StringBuilder command = new StringBuilder(); command.append("[ -w \""); command.append(path.equals("~") diff --git a/Guify/src/views/Desktop.java b/Guify/src/views/Desktop.java index c46063f..4987f6e 100644 --- a/Guify/src/views/Desktop.java +++ b/Guify/src/views/Desktop.java @@ -674,9 +674,7 @@ public class Desktop extends JFrame implements IDesktopFrame { return; } drawComponentsForDirectory( - controller.getCurrentWorkingDirectory()); // TODO - // optimize - // this + controller.getCurrentWorkingDirectory()); } // Hover on @@ -791,12 +789,7 @@ public class Desktop extends JFrame implements IDesktopFrame { return; } drawComponentsForDirectory( - controller.getCurrentWorkingDirectory()); // TODO: - // avoid - // a - // complete - // desktop - // reload + controller.getCurrentWorkingDirectory()); } }); @@ -822,7 +815,7 @@ public class Desktop extends JFrame implements IDesktopFrame { deleteBtn = new JButton(); deleteBtn.setBorderPainted(false); - deleteBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border); + deleteBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border; deleteBtn.setToolTipText("Delete"); try { deleteBtn.setIcon(new ImageIcon(ImageIO @@ -973,7 +966,7 @@ public class Desktop extends JFrame implements IDesktopFrame { JButton queueBtn = new JButton(); queueBtn.setBorderPainted(false); - queueBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border); + queueBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border; queueBtn.setToolTipText("Queue"); try { queueBtn.setIcon(new ImageIcon(ImageIO @@ -1032,7 +1025,7 @@ public class Desktop extends JFrame implements IDesktopFrame { JButton goToBtn = new JButton(); goToBtn.setBorderPainted(false); - goToBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border); + goToBtn.setBorder(new EmptyBorder(0, 0, 0, 0)); // Set empty border goToBtn.setToolTipText("Go"); try { goToBtn.setIcon(new ImageIcon(ImageIO