fixing save accepting .pres and no .pres extension in the name
This commit is contained in:
parent
37c7038f6f
commit
5e7fde14c6
2 changed files with 9 additions and 2 deletions
|
@ -122,7 +122,7 @@ Kirigami.ApplicationWindow {
|
|||
defaultSuffix: ".pres"
|
||||
selectExisting: false
|
||||
onAccepted: {
|
||||
save(saveFileDialog.fileUrl + ".pres");
|
||||
save(saveFileDialog.fileUrl);
|
||||
}
|
||||
onRejected: {
|
||||
print("Canceled")
|
||||
|
|
|
@ -557,7 +557,14 @@ bool ServiceItemModel::save(QUrl file) {
|
|||
QString filename = file.toString().right(file.toString().size() - 7);
|
||||
qDebug() << filename;
|
||||
|
||||
KTar tar(filename, "application/zstd");
|
||||
QString tarname;
|
||||
if (filename.endsWith(".pres")) {
|
||||
qDebug() << "Perfect just go with it!";
|
||||
tarname = filename;
|
||||
} else
|
||||
tarname = filename + ".pres";
|
||||
|
||||
KTar tar(tarname, "application/zstd");
|
||||
|
||||
if (tar.open(QIODevice::WriteOnly)) {
|
||||
qDebug() << tar.isOpen();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue