summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/LashClient.cpp34
-rw-r--r--src/LashClient.hpp20
-rw-r--r--src/LashProxy.cpp9
3 files changed, 18 insertions, 45 deletions
diff --git a/src/LashClient.cpp b/src/LashClient.cpp
index c41fef6..a7dd4ae 100644
--- a/src/LashClient.cpp
+++ b/src/LashClient.cpp
@@ -1,5 +1,5 @@
-// -*- Mode: C++ ; indent-tabs-mode: t -*-
/* This file is part of Patchage.
+ * Copyright (C) 2008-2010 David Robillard <http://drobilla.net>
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
*
* Patchage is free software; you can redistribute it and/or modify it under the
@@ -22,31 +22,25 @@
using namespace std;
struct LashClientImpl {
- LashProxy* proxy;
- Project* project;
- string id;
- string name;
+ Project* project;
+ string id;
+ string name;
};
LashClient::LashClient(
- LashProxy* proxy,
- Project* project,
+ Project* project,
const string& id,
const string& name)
{
- _impl = new LashClientImpl;
- _impl->proxy = proxy;
+ _impl = new LashClientImpl();
_impl->project = project;
- _impl->id = id;
- _impl->name = name;
-
- //g_app->info_msg("client created");
+ _impl->id = id;
+ _impl->name = name;
}
LashClient::~LashClient()
{
delete _impl;
- //g_app->info_msg("client destroyed");
}
Project*
@@ -68,16 +62,10 @@ LashClient::get_name() const
}
void
-LashClient::do_rename(const string& name)
+LashClient::set_name(const string& name)
{
if (_impl->name != name) {
- //_impl->proxy->client_rename(_impl->id, name);
+ _impl->name = name;
+ _signal_renamed.emit();
}
}
-
-void
-LashClient::on_name_changed(const string& name)
-{
- _impl->name = name;
- _signal_renamed.emit();
-}
diff --git a/src/LashClient.hpp b/src/LashClient.hpp
index 6ae6a2b..bd18d6c 100644
--- a/src/LashClient.hpp
+++ b/src/LashClient.hpp
@@ -1,6 +1,5 @@
-// -*- Mode: C++ ; indent-tabs-mode: t -*-
/* This file is part of Patchage.
- * Copyright (C) 2008-2009 David Robillard <http://drobilla.net>
+ * Copyright (C) 2008-2010 David Robillard <http://drobilla.net>
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
*
* Patchage is free software; you can redistribute it and/or modify it under the
@@ -24,37 +23,28 @@
#include <sigc++/signal.h>
class LashClientImpl;
-class LashProxy;
-class LashProxyImpl;
class Project;
class LashClient
{
public:
LashClient(
- LashProxy* proxy,
- Project* project,
+ Project* project,
const std::string& id,
const std::string& name);
~LashClient();
- Project*
- get_project();
+ Project* get_project();
- const std::string& get_id() const;
+ const std::string& get_id() const;
const std::string& get_name() const;
- void do_rename(const std::string& name);
+ void set_name(const std::string& name);
sigc::signal<void> _signal_renamed;
private:
- friend class LashProxyImpl;
-
- void
- on_name_changed(const std::string& name);
-
LashClientImpl* _impl;
};
diff --git a/src/LashProxy.cpp b/src/LashProxy.cpp
index fb4fffc..02fd311 100644
--- a/src/LashProxy.cpp
+++ b/src/LashProxy.cpp
@@ -355,7 +355,7 @@ LashProxyImpl::dbus_message_hook(
client = me->_session->find_client_by_id(client_id);
if (client) {
- client->on_name_changed(client_name);
+ client->set_name(client_name);
}
return DBUS_HANDLER_RESULT_HANDLED;
@@ -491,12 +491,7 @@ LashProxyImpl::on_client_added(
string id,
string name)
{
- shared_ptr<LashClient> client(
- new LashClient(
- _interface,
- project.get(),
- id,
- name));
+ shared_ptr<LashClient> client(new LashClient(project.get(), id, name));
project->on_client_added(client);
_session->client_add(client);