Skip to content

Commit f66d3f4

Browse files
committed
Add compress options
1 parent b743231 commit f66d3f4

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/plugins/coreplugin/internal/BehaviorPreference.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ namespace Core::Internal {
123123
enum FileOptionFlag {
124124
FO_LockOpenedFiles = 0x01,
125125
FO_CheckForExternalChangedOnSave = 0x02,
126+
FO_Compress = 0x04,
126127
};
127128
Q_ENUM(FileOptionFlag)
128129
Q_DECLARE_FLAGS(FileOption, FileOptionFlag)

src/plugins/coreplugin/project/document/ProjectDocumentContext.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ namespace Core {
6565
auto model = document->model()->toOpenDspx();
6666
writeEditorInfo(model);
6767
std::stringstream out(std::ios::out);
68-
// TODO compress
69-
opendspx::Serializer::serialize(out, model, errors, opendspx::Serializer::CheckError, false);
68+
opendspx::Serializer::serialize(out, model, errors, opendspx::Serializer::CheckError, Internal::BehaviorPreference::fileOption() & Internal::BehaviorPreference::FO_Compress);
7069
if (errors.containsError()) {
7170
if (hasError) {
7271
*hasError = true;

src/plugins/coreplugin/qml/settings/FileBackupPage.qml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ ScrollView {
6666
}
6767
}
6868
}
69+
CheckBox {
70+
text: qsTr("Compress project files")
71+
TextMatcherItem on text { matcher: page.matcher }
72+
checked: page.fileOption & BehaviorPreference.FO_Compress
73+
onClicked: () => {
74+
if (checked) {
75+
page.fileOption |= BehaviorPreference.FO_Compress
76+
} else {
77+
page.fileOption &= ~BehaviorPreference.FO_Compress
78+
}
79+
}
80+
}
6981
}
7082
}
7183
}

0 commit comments

Comments
 (0)