summaryrefslogtreecommitdiffstats
path: root/framework/domain/actions/sinkactions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/domain/actions/sinkactions.cpp')
-rw-r--r--framework/domain/actions/sinkactions.cpp13
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
58static ActionHandlerHelper synchronizeHandler("org.kde.kube.actions.synchronize", 58static 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