deskflow/src/lib/synergy/AppUtil.cpp
SerhiiGadzhilov 65ec504696
Synergy 1267 endless notifications during connection (#7104)
* SYNERGY-1267 Endless notification during connection

* SYNERGY-1267 Endless notification. Server part

* SYNERGY-1267 Change notification trace level

* Update ChangeLog

* SYNERGY-1267 Fix Linux compilation

* SYNERGY-1267 Fix code smell

* SYNERGY-1267 Add requested changes
2021-10-13 13:01:27 +03:00

54 lines
1.2 KiB
C++

/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2002 Chris Schoeneman
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "synergy/AppUtil.h"
#include "algorithm"
AppUtil* AppUtil::s_instance = nullptr;
AppUtil::AppUtil() :
m_app(nullptr)
{
s_instance = this;
}
AppUtil::~AppUtil()
{
}
void
AppUtil::adoptApp(IApp* app)
{
app->setByeFunc(&exitAppStatic);
m_app = app;
}
IApp&
AppUtil::app() const
{
assert(m_app != nullptr);
return *m_app;
}
AppUtil&
AppUtil::instance()
{
assert(s_instance != nullptr);
return *s_instance;
}