-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow saving as non-zipped (fz instead of fzz) for version control? #3132
Comments
I also needed this feature, so I hacked it into the code. It's not particularly elegant, but it only took about 30 lines in FolderUtils::createZipAndSaveTo and FolderUtils::unzipTo that just mocked the zipping/unzipping and just copied the files directly without compressing. |
Nice, can you share the code? We could add it as a "save as...extracted fz" option. |
I forked it and committed these changes into my fork. My code works, but is quite ugly because I was trying to do it fast. The way the code in my branch works, there's a method at https://github.com/ptaffet/fritzing-app/blob/master/src/utils/folderutils.cpp#L345 that you can use to decide whether to create a real fzz or a fake fzz that just lists the files (then the files that would be in the fzz are saved directly in the same folder as the fake fzz). I was thinking that it could return true if the save destination is in a github repo or something like that, but to integrate this into actual production code, it should be a user decision. |
This would be a nice to have feature!
If @ptaffet is not available for tidying his patch I may try to to do it, although my experience with C++ and Qt code is a bit rusty/limited. |
@zeehio: absolutely, I'm happy to review! |
@zeehio My code is ugly, but worse, the way is exposed to the user is not acceptable for a production style. It should be an option in the Save As box. That requires more knowledge of Qt. I'm pretty busy this month, but feel free to use anything in my code. Two design points that need to be worked out are:
|
Yeah, this can get tricky, so let's approach it pragmatically:
|
I just submitted a first pull request that allows to save and load uncompressed fz files. I am not fully satisfied with the proposed solution (I think it should be extended to custom parts and other bundled file types) but it seems a good starting point for getting some feedback. As you can read on the pull request, I basically followed your suggestions, so now it should be possible to load and save uncompressed fritzing sketches. Just a disclaimer: I have done my best, but saving and loading data is something that needs to be coded well, or data may be lost... so please be thorough when reviewing the code, as I may not be aware of all the possible code paths or I may have misunderstood something. I am doing this on my free time and I can't be hold responsible of data loss or other issues :-S |
No issues found with this by now, so it will be released with 0.9.3. Thanks again! |
Would it be possible to add the ability to save in a more git-friendly format? I.e., the fz XML format without the zipping.
The text was updated successfully, but these errors were encountered: