Skip to content

Commit deb0f3c

Browse files
committed
[bugfix, win32] governor actor, fix parsing folder path
1 parent 8cd0a4b commit deb0f3c

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ find_package(uriparser REQUIRED)
3232
find_package(tomlplusplus REQUIRED)
3333
find_package(nlohmann_json REQUIRED)
3434

35-
set(SYNCSPIRIT_VERSION "v0.3.2")
35+
set(SYNCSPIRIT_VERSION "v0.3.3")
3636

3737
configure_file(misc/syncspirit-config.h.in include/syncspirit-config.h @ONLY)
3838
set(Protobuf_IMPORT_DIRS ${syncspirit_SOURCE_DIR}/src/protobuf)

src/ui-daemon/command/add_folder.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ outcome::result<command_ptr_t> add_folder_t::construct(std::string_view in) noex
1919
std::string id;
2020

2121
auto it = pair_iterator_t(in);
22+
bool skip_colon = false;
2223
while (true) {
23-
auto r = it.next();
24+
auto r = it.next(skip_colon);
2425
if (r) {
2526
auto &v = r.value();
2627
if (v.first == "label") {
@@ -29,6 +30,7 @@ outcome::result<command_ptr_t> add_folder_t::construct(std::string_view in) noex
2930
path = v.second;
3031
} else if (v.first == "id") {
3132
id = v.second;
33+
skip_colon = true;
3234
}
3335
} else {
3436
break;
@@ -91,6 +93,8 @@ bool add_folder_t::execute(governor_actor_t &actor) noexcept {
9193
}
9294
}
9395

96+
log->debug("{}, going to add folder '{}' on '{}'", actor.get_identity(), folder.label(), folder.path());
97+
9498
auto diff = cluster_diff_ptr_t(new modify::create_folder_t(folder));
9599
actor.send<model::payload::model_update_t>(actor.coordinator, std::move(diff), this);
96100
actor.add_callback(this, [&actor, folder_id = folder.id()]() -> bool {

src/ui-daemon/command/pair_iterator.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55

66
using namespace syncspirit::daemon::command;
77

8-
std::optional<pair_iterator_t::pair_t> pair_iterator_t::next() noexcept {
9-
auto colon = in.find(":");
10-
if (colon == in.npos) {
11-
colon = in.size();
8+
std::optional<pair_iterator_t::pair_t> pair_iterator_t::next(bool skip_colon) noexcept {
9+
auto colon = in.size();
10+
if (!skip_colon) {
11+
auto colon_pos = in.find(":");
12+
if (colon_pos != in.npos) {
13+
colon = colon_pos;
14+
}
1215
}
1316

1417
auto it = in.substr(0, colon);

src/ui-daemon/command/pair_iterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct pair_iterator_t {
1414

1515
inline pair_iterator_t(std::string_view in_) noexcept : in(in_) {}
1616

17-
std::optional<pair_t> next() noexcept;
17+
std::optional<pair_t> next(bool skip_colon = false) noexcept;
1818
std::string_view in;
1919
};
2020

0 commit comments

Comments
 (0)