OTHER: Fix memleak and fixed small bug in hideEvent handlers
When promoe was minimized or on a different virtual desktop when it was quit, the visible setting of playlist and equalizer was set to false. So even when those two were visible before switching to a different desktop they where set to closed when promoe was started the next time
This commit is contained in:
parent
4df3266088
commit
c7e1a7fa6b
8 changed files with 105 additions and 112 deletions
|
@ -15,7 +15,6 @@
|
|||
|
||||
#include "playlistwindow.h"
|
||||
|
||||
#include <QMoveEvent>
|
||||
#include <QResizeEvent>
|
||||
#include <QPoint>
|
||||
#include <QIcon>
|
||||
|
@ -27,15 +26,16 @@
|
|||
|
||||
PlaylistWindow::PlaylistWindow (QWidget *parent) : BaseWindow (parent)
|
||||
{
|
||||
QSettings s;
|
||||
setObjectName ("playlist"); // Name of the config group
|
||||
#ifndef _WIN32
|
||||
setWindowIcon (QIcon (":icon.png"));
|
||||
#endif
|
||||
|
||||
QSettings s;
|
||||
setWindowFlags (Qt::Dialog | Qt::FramelessWindowHint);
|
||||
setAttribute (Qt::WA_DeleteOnClose);
|
||||
|
||||
s.beginGroup ("playlist");
|
||||
s.beginGroup (objectName ());
|
||||
if (!s.contains ("size")) {
|
||||
s.setValue ("size", QSize (275, 350));
|
||||
}
|
||||
|
@ -58,26 +58,6 @@ PlaylistWindow::PlaylistWindow (QWidget *parent) : BaseWindow (parent)
|
|||
//setSizeIncrement (25, 29);
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistWindow::hideEvent (QHideEvent *event)
|
||||
{
|
||||
QSettings s;
|
||||
s.setValue ("playlist/visible", false);
|
||||
|
||||
emit visibilityChanged (false);
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistWindow::showEvent (QShowEvent *event)
|
||||
{
|
||||
QSettings s;
|
||||
s.setValue ("playlist/visible", true);
|
||||
mw ()->attachWidgets ();
|
||||
|
||||
emit visibilityChanged (true);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistWindow::switchDisplay (void)
|
||||
{
|
||||
|
@ -119,13 +99,6 @@ PlaylistWindow::resizeEvent (QResizeEvent *event)
|
|||
mw ()->attachWidgets ();
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistWindow::moveEvent (QMoveEvent *event)
|
||||
{
|
||||
QSettings s;
|
||||
s.setValue ("playlist/pos", pos ());
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistWindow::enterEvent (QEvent *event)
|
||||
{
|
||||
|
|
|
@ -20,10 +20,7 @@
|
|||
#include "basewindow.h"
|
||||
|
||||
class QEvent;
|
||||
class QMoveEvent;
|
||||
class QResizeEvent;
|
||||
class QHideEvent;
|
||||
class QShowEvent;
|
||||
class QPoint;
|
||||
|
||||
// our own classes
|
||||
|
@ -41,8 +38,6 @@ class PlaylistWindow : public BaseWindow {
|
|||
void setActive (bool);
|
||||
|
||||
signals:
|
||||
void visibilityChanged(bool visible);
|
||||
|
||||
// setTime is used to set playtime in playlistcontrols
|
||||
void setDisplayTime (int seconds);
|
||||
|
||||
|
@ -50,11 +45,8 @@ class PlaylistWindow : public BaseWindow {
|
|||
void switchDisplay (void);
|
||||
|
||||
protected:
|
||||
void hideEvent (QHideEvent *event);
|
||||
void showEvent (QShowEvent *event);
|
||||
void enterEvent (QEvent *event);
|
||||
void leaveEvent (QEvent *event);
|
||||
void moveEvent (QMoveEvent *event);
|
||||
void resizeEvent (QResizeEvent *event);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue