Fix a bug. Add some destructors. comment out one that causes problems.

This commit is contained in:
Kevin Whitaker
2017-02-22 21:38:37 -05:00
parent 8bb9728039
commit 8992875180
10 changed files with 70 additions and 3 deletions

2
run.sh Normal file → Executable file
View File

@@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
./arbitrateor --docroot /use/share/Wt --http-address 0.0.0.0 --http-port 8080 -c wt_config.xml ./arbitrateor --docroot /usr/share/Wt --http-address 0.0.0.0 --http-port 8080 -c wt_config.xml

View File

@@ -746,11 +746,12 @@ void GroovePlayerMgr::grooveAudioScannerLoop()
} }
for(std::filesystem::directory_entry p: std::filesystem::directory_iterator(musicScanDir)) for(std::filesystem::directory_entry p: std::filesystem::directory_iterator(musicScanDir))
{ {
if(addFileToTrackDBIfTagged(&sqlSession, p.path()) == ScanResults::ACCEPTED) ScanResults result = addFileToTrackDBIfTagged(&sqlSession, p.path());
if(result == ScanResults::ACCEPTED)
{ {
Wt::log("info") << p.path().string() << " was added to DB"; Wt::log("info") << p.path().string() << " was added to DB";
} }
else else if(result != ScanResults::DUPLICATE_TRACK && result != ScanResults::WRONG_FILETYPE)
{ {
Wt::log("info") << p.path().string() + " was not accepted."; Wt::log("info") << p.path().string() + " was not accepted.";
} }

View File

@@ -40,6 +40,14 @@ AdminInterface::AdminInterface(WebInterface* app)
addBtn->clicked().connect(this, &AdminInterface::addClicked); addBtn->clicked().connect(this, &AdminInterface::addClicked);
} }
AdminInterface::~AdminInterface()
{
delete addBtn;
delete passwordField;
delete usernameField;
delete userLayout;
}
void AdminInterface::addClicked() void AdminInterface::addClicked()
{ {
Wt::Dbo::Session sqlSession; Wt::Dbo::Session sqlSession;

View File

@@ -30,6 +30,7 @@ class AdminInterface : public Wt::WContainerWidget
{ {
public: public:
AdminInterface(WebInterface* app); AdminInterface(WebInterface* app);
~AdminInterface();
WebInterface* app; WebInterface* app;
Wt::WHBoxLayout* userLayout; Wt::WHBoxLayout* userLayout;

View File

@@ -56,6 +56,18 @@ LoginInterface::LoginInterface(WebInterface* app)
loginContainer->setWidth(Wt::WLength(50, Wt::WLength::Percentage)); loginContainer->setWidth(Wt::WLength(50, Wt::WLength::Percentage));
} }
LoginInterface::~LoginInterface()
{
delete loginButton;
delete passwordField;
delete usernameField;
delete passwordContainer;
delete usernameContainer;
delete loginMessage;
delete loginLayout;
delete loginContainer;
}
void LoginInterface::checkSessionValidity() void LoginInterface::checkSessionValidity()
{ {
Wt::Dbo::Session sqlSession; Wt::Dbo::Session sqlSession;

View File

@@ -33,6 +33,7 @@ class LoginInterface : public Wt::WContainerWidget
{ {
public: public:
LoginInterface(WebInterface* app); LoginInterface(WebInterface* app);
~LoginInterface();
void checkSessionValidity(); void checkSessionValidity();
void createUser(Wt::Dbo::Session* session, std::string username, std::string rawPassword, bool isAdmin); void createUser(Wt::Dbo::Session* session, std::string username, std::string rawPassword, bool isAdmin);
private: private:

View File

@@ -144,6 +144,40 @@ PlayerInterface::PlayerInterface(WebInterface* app)
voteTracksLayout->addLayout(track3); voteTracksLayout->addLayout(track3);
} }
PlayerInterface::~PlayerInterface()
{
// Keep these out until I have a good reason to use.
// delete mainDisplay;
// delete requestPane;
// delete uploadPane;
// delete adminPane;
// delete track3vote;
// delete track2vote;
// delete track1vote;
// delete track3votecount;
// delete track2votecount;
// delete track1votecount;
// delete track3details;
// delete track2details;
// delete track1details;
// delete voteTracksLayout;
// delete voteTracksContainer;
// delete votePanel;
// delete voteControlContainer;
// delete voteMetaLayout;
// delete voteMetaContainer;
// delete skipRequest;
// delete skipDeny;
// delete playpause;
// delete currentTrackDetails;
// delete trackProgress;
// delete currentTrackProgress;
// delete skipControls;
// delete playControlLayout;
// delete playControlWidget;
// delete interfaceLayout;
}
void PlayerInterface::playpauseClicked() void PlayerInterface::playpauseClicked()
{ {
if(!isPaused) if(!isPaused)

View File

@@ -39,6 +39,7 @@ class PlayerInterface : public Wt::WContainerWidget
{ {
public: public:
PlayerInterface(WebInterface* app); PlayerInterface(WebInterface* app);
~PlayerInterface();
WebInterface* app; WebInterface* app;
Wt::WVBoxLayout* interfaceLayout; Wt::WVBoxLayout* interfaceLayout;

View File

@@ -40,6 +40,14 @@ UploadInterface::UploadInterface(WebInterface* app)
mainLayout->addWidget(logs); mainLayout->addWidget(logs);
} }
UploadInterface::~UploadInterface()
{
delete clearLogs;
delete logs;
delete fileDrop;
delete mainLayout;
}
void UploadInterface::reInitUploadBox() void UploadInterface::reInitUploadBox()
{ {
if(fileDrop != nullptr) delete fileDrop; if(fileDrop != nullptr) delete fileDrop;

View File

@@ -32,6 +32,7 @@ class UploadInterface : public Wt::WContainerWidget
{ {
public: public:
UploadInterface(WebInterface* app); UploadInterface(WebInterface* app);
~UploadInterface();
WebInterface* app; WebInterface* app;
Wt::WVBoxLayout* mainLayout; Wt::WVBoxLayout* mainLayout;