[QT] some mac specifiy cleanup (memory handling, unnecessary code)
Rebased-From: 8b60808c1e
Github-Pull: #5880
This commit is contained in:
parent
81145a6ccd
commit
2c0840631d
@ -232,7 +232,7 @@ BitcoinGUI::~BitcoinGUI()
|
|||||||
trayIcon->hide();
|
trayIcon->hide();
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
delete appMenuBar;
|
delete appMenuBar;
|
||||||
MacDockIconHandler::instance()->setMainWindow(NULL);
|
MacDockIconHandler::cleanup();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,12 +14,6 @@ class QMenu;
|
|||||||
class QWidget;
|
class QWidget;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#ifdef __OBJC__
|
|
||||||
@class DockIconClickEventHandler;
|
|
||||||
#else
|
|
||||||
class DockIconClickEventHandler;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Macintosh-specific dock icon handler.
|
/** Macintosh-specific dock icon handler.
|
||||||
*/
|
*/
|
||||||
class MacDockIconHandler : public QObject
|
class MacDockIconHandler : public QObject
|
||||||
@ -33,7 +27,7 @@ public:
|
|||||||
void setIcon(const QIcon &icon);
|
void setIcon(const QIcon &icon);
|
||||||
void setMainWindow(QMainWindow *window);
|
void setMainWindow(QMainWindow *window);
|
||||||
static MacDockIconHandler *instance();
|
static MacDockIconHandler *instance();
|
||||||
|
static void cleanup();
|
||||||
void handleDockIconClickEvent();
|
void handleDockIconClickEvent();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@ -42,7 +36,6 @@ signals:
|
|||||||
private:
|
private:
|
||||||
MacDockIconHandler();
|
MacDockIconHandler();
|
||||||
|
|
||||||
DockIconClickEventHandler *m_dockIconClickEventHandler;
|
|
||||||
QWidget *m_dummyWidget;
|
QWidget *m_dummyWidget;
|
||||||
QMenu *m_dockMenu;
|
QMenu *m_dockMenu;
|
||||||
QMainWindow *mainWindow;
|
QMainWindow *mainWindow;
|
||||||
|
@ -68,7 +68,6 @@ void MacDockIconHandler::setMainWindow(QMainWindow *window) {
|
|||||||
|
|
||||||
MacDockIconHandler::~MacDockIconHandler()
|
MacDockIconHandler::~MacDockIconHandler()
|
||||||
{
|
{
|
||||||
[this->m_dockIconClickEventHandler release];
|
|
||||||
delete this->m_dummyWidget;
|
delete this->m_dummyWidget;
|
||||||
this->setMainWindow(NULL);
|
this->setMainWindow(NULL);
|
||||||
}
|
}
|
||||||
@ -118,6 +117,11 @@ MacDockIconHandler *MacDockIconHandler::instance()
|
|||||||
return s_instance;
|
return s_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacDockIconHandler::cleanup()
|
||||||
|
{
|
||||||
|
delete s_instance;
|
||||||
|
}
|
||||||
|
|
||||||
void MacDockIconHandler::handleDockIconClickEvent()
|
void MacDockIconHandler::handleDockIconClickEvent()
|
||||||
{
|
{
|
||||||
if (this->mainWindow)
|
if (this->mainWindow)
|
||||||
|
Loading…
Reference in New Issue
Block a user