Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake
include(GitExternal)

set(VERSION_MAJOR "1")
set(VERSION_MINOR "2")
set(VERSION_MINOR "3")
set(VERSION_PATCH "0")
set(VERSION_ABI 2)

Expand Down
2 changes: 2 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

# git master {#master}

* Add a function to get the host corresponding to a given instance.

# Release 1.2 (02-11-2015) {#Release010200}

* Added a new library ServusQt: Provides servus::qt::ItemModel which implements
Expand Down
3 changes: 1 addition & 2 deletions servus/qt/itemModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ QVariant ItemModel::data( const QModelIndex& index_, const int role ) const
if( item->children().isEmpty( ))
return QVariant();
return QString::fromStdString(
_impl->service.get( item->objectName().toStdString(),
"servus_host" ));
_impl->service.getHost( item->objectName().toStdString( )));
default:
return QVariant();
}
Expand Down
5 changes: 5 additions & 0 deletions servus/servus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ Strings Servus::getKeys( const std::string& instance ) const
return _impl->getKeys( instance );
}

const std::string& Servus::getHost( const std::string& instance ) const
{
return get( instance, "servus_host" );
}

bool Servus::containsKey( const std::string& instance,
const std::string& key ) const
{
Expand Down
3 changes: 3 additions & 0 deletions servus/servus.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ class Servus
/** @return all keys discovered on the given instance. @version 1.1 */
SERVUS_API Strings getKeys( const std::string& instance ) const;

/** @return the host corresponding to the given instance. @version 1.3 */
SERVUS_API const std::string& getHost( const std::string& instance ) const;

/** @return true if the given key was discovered. @version 1.1 */
SERVUS_API bool containsKey( const std::string& instance,
const std::string& key ) const;
Expand Down