Rename conn -> CONN ( Also made it Global )

Following Changes have been made:

1. conn -> CONN
2. CONN is now a global as a lot of functions were requiring it and
   passing them as a parameter didn't seem intuitive.
3. In progressBar.go now we are sending only the short path instead of
   absolute path.
This commit is contained in:
aditya-K2
2021-11-13 11:32:00 +05:30
parent c19a053126
commit e4ed3bbab7
4 changed files with 52 additions and 57 deletions

5
App.go
View File

@@ -1,7 +1,6 @@
package main
import (
"github.com/fhs/gompd/mpd"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
@@ -16,9 +15,9 @@ type Application struct {
pBar *progressBar
}
func newApplication(conn mpd.Client, r *Renderer) *Application {
func newApplication(r *Renderer) *Application {
var pBar *progressBar = newProgressBar(conn, r)
var pBar *progressBar = newProgressBar(r)
expandedView := tview.NewTable()
Navbar := tview.NewTable()
searchBar := tview.NewTable()