summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-09-29 15:05:35 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2012-10-02 23:09:03 +0200
commit790712e802bf8126664a4905ab1aa787c732ecc4 (patch)
tree20dd9a5dbd236666a8ce56fd725651dd7c306dd9
parent71360e3837b6f5a222c5441262f96bdcb803af16 (diff)
Implement ConnectedStatus
This should be changed to a read-only property, or even better, removed in favour of events.
-rw-r--r--SPICEConsoleAPI.cpp2
-rw-r--r--SPICEConsoleAPI.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/SPICEConsoleAPI.cpp b/SPICEConsoleAPI.cpp
index 7774308..d71e8fa 100644
--- a/SPICEConsoleAPI.cpp
+++ b/SPICEConsoleAPI.cpp
@@ -57,7 +57,7 @@ void SPICEConsoleAPI::SetUsbFilter(const std::string &filter)
int SPICEConsoleAPI::ConnectedStatus()
{
- return -1;
+ return m_connected_status;
}
/* attribute string SSLChannels; */
diff --git a/SPICEConsoleAPI.h b/SPICEConsoleAPI.h
index c0dce9a..82d4757 100644
--- a/SPICEConsoleAPI.h
+++ b/SPICEConsoleAPI.h
@@ -29,7 +29,7 @@ public:
/// @see FB::JSAPIAuto::registerEvent
////////////////////////////////////////////////////////////////////////////
SPICEConsoleAPI(const SPICEConsolePtr& plugin, const FB::BrowserHostPtr& host) :
- m_plugin(plugin), m_host(host)
+ m_plugin(plugin), m_host(host), m_connected_status(-2)
{
registerMethod("connect", make_method(this, &SPICEConsoleAPI::connect));
registerMethod("show", make_method(this, &SPICEConsoleAPI::show));
@@ -97,6 +97,7 @@ private:
FB::BrowserHostPtr m_host;
std::map<std::string, std::string> m_languages;
std::string m_usb_filter;
+ int m_connected_status;
/* Properties */
std::string m_SSLChannels;