summaryrefslogtreecommitdiffstats
path: root/examples/c4touch.c
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2020-04-20 21:51:58 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2020-04-20 21:52:07 +0200
commit4ded6e352ee0fb5d96d2e1b9f051aac1f07b4886 (patch)
tree8d29721809a690acbbaa2efb56402f55eb6436c1 /examples/c4touch.c
parentd42414b65cdb0156a5a2064a08c894c19370d7a7 (diff)
downloadcc4group-4ded6e352ee0fb5d96d2e1b9f051aac1f07b4886.tar.gz
cc4group-4ded6e352ee0fb5d96d2e1b9f051aac1f07b4886.zip
Rework group saving
save / saveParent write back to the original group saveParent saves changes in child groups (openAsChild) by saving the top-most parent saveAs / saveAsOverwrite resembles the old save / saveOverwrite For all other saving methods, groups opend with openAsChild are saved as if there was no parent
Diffstat (limited to 'examples/c4touch.c')
-rw-r--r--examples/c4touch.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/c4touch.c b/examples/c4touch.c
index 40312c6..a8bfb16 100644
--- a/examples/c4touch.c
+++ b/examples/c4touch.c
@@ -49,7 +49,14 @@ int main(int argc, char* argv[])
cc4group.setMaker(group, argv[2], NULL, true);
}
- success = (exists ? cc4group.saveOverwrite : cc4group.save)(group, argv[1]);
+ if(exists)
+ {
+ success = cc4group.saveParent(group);
+ }
+ else
+ {
+ success = cc4group.saveAs(group, argv[1]);
+ }
if(!success)
{