summaryrefslogtreecommitdiff
path: root/distfoldd/distfolder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'distfoldd/distfolder.cc')
-rw-r--r--distfoldd/distfolder.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/distfoldd/distfolder.cc b/distfoldd/distfolder.cc
index 211aafe..f047d02 100644
--- a/distfoldd/distfolder.cc
+++ b/distfoldd/distfolder.cc
@@ -24,6 +24,16 @@ DistFolder::DistFolder(const QUuid& uuid, const QString& localPath, QObject *par
qDebug() << "Ready Folder UUID:" << _uuid;
}
+QString DistFolder::password() const
+{
+ return _password;
+}
+
+void DistFolder::setPassword(const QString &passwd)
+{
+ _password = passwd;
+}
+
bool DistFolder::readOnlySync() const
{
return _syncFlags & Agent::SYNC_READ_ONLY;
@@ -122,7 +132,7 @@ void DistFolder::handleNewConnection()
qDebug() << "Incoming connection";
ServerAgent *agent =
new ServerAgent(static_cast<QSslSocket*>(_server->nextPendingConnection()),
- _localPath, _syncFlags, this);
+ _localPath, _password, _syncFlags, this);
connect(agent, SIGNAL(destroyed()), SLOT(handleDestroyedAgent()));
_numAgents++;
qDebug() << "Num agents" << _numAgents;
@@ -166,7 +176,7 @@ void DistFolder::handleMoreRecentHost(const QHostAddress &address, uint port, co
Q_UNUSED(dateTime);
if (_numAgents == 0) {
qDebug() << "Trying to connect to" << address.toString() << port;
- ClientAgent *agent = new ClientAgent(address, port, _localPath, _syncFlags, this);
+ ClientAgent *agent = new ClientAgent(address, port, _localPath, _password, _syncFlags, this);
connect(agent, SIGNAL(destroyed()), SLOT(handleDestroyedAgent()));
connect(agent, SIGNAL(finished()), SLOT(handleClientFinished()));
_numAgents++;