Skip to content

Commit

Permalink
PR fix: Remove additional log lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lazysegtree committed Feb 4, 2025
1 parent ae9a586 commit 79e048a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
6 changes: 1 addition & 5 deletions src/internal/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func returnFocusType(focusPanel focusPanelType) filePanelFocusType {

// Need to rename folder to directory.
func returnDirectoryElement(location string, displayDotFile bool, sortOptions sortOptionsModelData) (directoryElement []element) {
slog.Debug("returnFolderElement() called.")
dirEntries, err := os.ReadDir(location)
if err != nil {
outPutLog("Return folder element function error", err)
Expand All @@ -66,6 +65,7 @@ func returnDirectoryElement(location string, displayDotFile bool, sortOptions so
var order func(i, j int) bool
reversed := sortOptions.reversed

// Todo : These strings should not be hardcoded here, but defined as constants
switch sortOptions.options[sortOptions.selected] {
case "Name":
order = func(i, j int) bool {
Expand Down Expand Up @@ -124,17 +124,13 @@ func returnDirectoryElement(location string, displayDotFile bool, sortOptions so
}

sort.Slice(dirEntries, order)

for _, item := range dirEntries {
directoryElement = append(directoryElement, element{
name: item.Name(),
directory: item.IsDir(),
location: filepath.Join(location, item.Name()),
})
}

slog.Debug("returnFolderElement() returning.", "directoryElement", directoryElement)

return directoryElement
}

Expand Down
3 changes: 0 additions & 3 deletions src/internal/get_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (

// Return all sidebar directories
func getDirectories() []directory {
slog.Debug("getDirectories() called")
directories := []directory{}

directories = append(directories, getWellKnownDirectories()...)
Expand All @@ -28,7 +27,6 @@ func getDirectories() []directory {
location: "Disks+-*/=?",
})
directories = append(directories, getExternalMediaFolders()...)
slog.Debug("getDirectories() returning", "directories", directories)
return directories
}

Expand Down Expand Up @@ -68,7 +66,6 @@ func getPinnedDirectories() []directory {
jsonData, err := os.ReadFile(variable.PinnedFile)
if err != nil {
outPutLog("Read superfile data error", err)
// Should exit here
return directories
}

Expand Down
8 changes: 0 additions & 8 deletions src/internal/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ func (m model) Init() tea.Cmd {
// Update function for bubble tea to provide internal communication to the
// application
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
slog.Debug("model.Update() called.", "current width", m.fullWidth,
"current height", m.fullHeight)
var cmd tea.Cmd

switch msg := msg.(type) {
Expand All @@ -72,15 +70,11 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

// check if there already have listening message
if !ListeningMessage {
slog.Debug("ListeningMessage is false in model Update()")
cmd = tea.Batch(cmd, listenForChannelMessage(channel))
}

m.getFilePanelItems()

slog.Debug("model.Update() returning.", "current width", m.fullWidth,
"current height", m.fullHeight)

return m, tea.Batch(cmd)
}

Expand Down Expand Up @@ -254,7 +248,6 @@ func (m *model) handleKeyInput(msg tea.KeyMsg, cmd tea.Cmd) tea.Cmd {
// Update the file panel state. Change name of renamed files, filter out files
// in search, update typingb bar, etc
func (m *model) updateFilePanelsState(msg tea.Msg, cmd *tea.Cmd) {
slog.Debug("updateFilePanelsState() called")
focusPanel := &m.fileModel.filePanels[m.filePanelFocusIndex]
if m.firstTextInput {
m.firstTextInput = false
Expand All @@ -275,7 +268,6 @@ func (m *model) updateFilePanelsState(msg tea.Msg, cmd *tea.Cmd) {

// Update the sidebar state. Change name of the renaming pinned directory.
func (m *model) updateSidebarState(msg tea.Msg, cmd *tea.Cmd) {
slog.Debug("updateSidebarState() is called")
sidebar := &m.sidebarModel
if sidebar.renaming {
sidebar.rename, *cmd = sidebar.rename.Update(msg)
Expand Down

0 comments on commit 79e048a

Please sign in to comment.