bd2eb7387f
All user-facing functions (password handling, reading from stdin) are now in a dedicated "UserInterface" class, instead of spreading that between ConfigUserInterface and SyncContext. SyncContext no longer has the misleading "is a" [Config]UserInterface] relationship. Instead it "has a" UserInterface instance, which is set at runtime. Long term the plan is remove the need to subclass SyncContext. In the local sync that was already possible (LocalTransportContext->LocalTransportUI). The guarantee that there always is a usable instance that can be used without checking for NULL is provided by the getUserInterfaceNonNull() method, which falls back to a dummy instance if necessary. Reading data and password from stdin is moved out of the core libsyncevolution into the syncevolution binary. That way the D-Bus server and client-test do not accidentally attempt to read from stdin (has happened when setting up testing incorrectly).
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2011 Dinesh <saidinesh5@gmail.com>
|
|
* Copyright (C) 2012 Intel Corporation
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) version 3.
|
|
*
|
|
* This library 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
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
* 02110-1301 USA
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#ifdef USE_KDE_KWALLET
|
|
|
|
#include "KDEPlatform.h"
|
|
#include <syncevo/SyncContext.h>
|
|
#include <syncevo/UserInterface.h>
|
|
|
|
#include <syncevo/declarations.h>
|
|
SE_BEGIN_CXX
|
|
|
|
static class KDEInit
|
|
{
|
|
public:
|
|
KDEInit()
|
|
{
|
|
GetLoadPasswordSignal().connect(0, KWalletLoadPasswordSlot);
|
|
GetSavePasswordSignal().connect(0, KWalletSavePasswordSlot);
|
|
SyncContext::GetInitMainSignal().connect(KDEInitMainSlot);
|
|
}
|
|
} kdeinit;
|
|
|
|
SE_END_CXX
|
|
|
|
#endif // USE_KDE_WALLET
|