summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2018-02-19 13:42:22 +0200
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2018-02-19 12:06:23 +0000
commit07813048fd054494abfa11add99d2345bf143771 (patch)
treec303c69b6afdbb62c9195e418638db043fe115d4
parent7ea1499563363302eaf3e4d6c5b6db3a92f8647b (diff)
Fix initial directory when doing save as
Save as and save copy functions do not create new directory, so lets not assume they do when saving the previous directory. Task-number: QT3DS-1160 Change-Id: Idbd7c07130df3405c938dd06ee3eccb1841058dd Reviewed-by: Marianne Yrjänä <marianne.yrjana@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
-rw-r--r--src/Authoring/Studio/Workspace/Dialogs.h2
-rw-r--r--src/Authoring/Studio/_Win/Workspace/Dialogs.cpp8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/Authoring/Studio/Workspace/Dialogs.h b/src/Authoring/Studio/Workspace/Dialogs.h
index 99b6c9cd..c6545422 100644
--- a/src/Authoring/Studio/Workspace/Dialogs.h
+++ b/src/Authoring/Studio/Workspace/Dialogs.h
@@ -126,7 +126,7 @@ public:
const Q3DStudio::CString &inDefaultName);
std::pair<Qt3DSFile, bool> GetSaveAsChoice(const QString &inDialogTitle = "",
- bool inFilenameUntitled = false);
+ bool inNewDoc = false);
// Returns pair of file along with a boolean indicating the state of the create
// new directory checkbox.
std::pair<Qt3DSFile, bool>
diff --git a/src/Authoring/Studio/_Win/Workspace/Dialogs.cpp b/src/Authoring/Studio/_Win/Workspace/Dialogs.cpp
index 5a87b54d..4bceeecd 100644
--- a/src/Authoring/Studio/_Win/Workspace/Dialogs.cpp
+++ b/src/Authoring/Studio/_Win/Workspace/Dialogs.cpp
@@ -822,7 +822,7 @@ CDialogs::ESavePromptResult CDialogs::PromptForSave()
* @return an invalid file if the user cancels the save dialog.
*/
std::pair<Qt3DSFile, bool> CDialogs::GetSaveAsChoice(const QString &inDialogTitle,
- bool inFilenameUntitled)
+ bool inNewDoc)
{
Qt3DSFile theFile("");
QString theFileExt;
@@ -831,7 +831,7 @@ std::pair<Qt3DSFile, bool> CDialogs::GetSaveAsChoice(const QString &inDialogTitl
QString theFilename
= g_StudioApp.GetCore()->GetDoc()->GetDocumentPath().GetAbsolutePath().toQString();
- if (theFilename.isEmpty() || inFilenameUntitled)
+ if (theFilename.isEmpty() || inNewDoc)
theFilename = QObject::tr("Untitled");
theFileExt = QStringLiteral(".uip");
@@ -868,7 +868,9 @@ std::pair<Qt3DSFile, bool> CDialogs::GetSaveAsChoice(const QString &inDialogTitl
// customising a dialog box will force us to use non-native.
// defaulting this for now, until we can agree a better workflow for
// creating new projects
- theCreateDir = true;
+ // New directory is only created when creating a new project. When doing a "save as"
+ // or "save copy", a new directory is not created.
+ theCreateDir = inNewDoc;
if (theCreateDir) {
// If user checks "Create directory for project"