diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-13 23:57:18 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-13 23:57:18 +0100 |
commit | 68f95cf68c3a8d29c2cc81929287eabb3a6d7682 (patch) | |
tree | fd2df971d1389a8072f6b99e1fbf2ef6f7553910 /framework/domain | |
parent | 5ec954917c9a59ce0ec8ba3a30b99bb9cd30e297 (diff) | |
download | kube-68f95cf68c3a8d29c2cc81929287eabb3a6d7682.tar.gz kube-68f95cf68c3a8d29c2cc81929287eabb3a6d7682.zip |
Sync action
Diffstat (limited to 'framework/domain')
-rw-r--r-- | framework/domain/actions/sinkactions.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/framework/domain/actions/sinkactions.cpp b/framework/domain/actions/sinkactions.cpp index a19ab149..57d63752 100644 --- a/framework/domain/actions/sinkactions.cpp +++ b/framework/domain/actions/sinkactions.cpp | |||
@@ -57,15 +57,16 @@ static ActionHandlerHelper deleteHandler("org.kde.kube.actions.delete", | |||
57 | 57 | ||
58 | static ActionHandlerHelper synchronizeHandler("org.kde.kube.actions.synchronize", | 58 | static ActionHandlerHelper synchronizeHandler("org.kde.kube.actions.synchronize", |
59 | [](Context *context) -> bool { | 59 | [](Context *context) -> bool { |
60 | return context->property("folder").isValid(); | 60 | return true; |
61 | }, | 61 | }, |
62 | [](Context *context) { | 62 | [](Context *context) { |
63 | auto folder = context->property("folder").value<Sink::ApplicationDomain::Folder::Ptr>(); | 63 | if (auto folder = context->property("folder").value<Sink::ApplicationDomain::Folder::Ptr>()) { |
64 | if (!folder) { | 64 | qDebug() << "Synchronizing resource " << folder->resourceInstanceIdentifier(); |
65 | qWarning() << "Failed to get the folder: " << context->property("folder"); | 65 | Sink::Store::synchronize(Sink::Query::ResourceFilter(folder->resourceInstanceIdentifier())).exec(); |
66 | return; | 66 | } else { |
67 | qDebug() << "Synchronizing all"; | ||
68 | Sink::Store::synchronize(Sink::Query()).exec(); | ||
67 | } | 69 | } |
68 | Sink::Store::synchronize(Sink::Query::ResourceFilter(folder->resourceInstanceIdentifier())).exec(); | ||
69 | } | 70 | } |
70 | ); | 71 | ); |
71 | 72 | ||