Skip to content

Commit 2e0c06c

Browse files
committed
Save as is wonky on macOs, this fixes it
1 parent 0d9baf9 commit 2e0c06c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Desktop/widgets/filemenu/computer.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ FileEvent *Computer::browseOpen(const QString &path)
6565
FileEvent *Computer::browseSave(const QString &path, FileEvent::FileMode mode)
6666
{
6767
QString caption = tr("Save");
68-
QString filter = tr("JASP Files") += " (*.jasp)";
68+
QString filter = tr("JASP Files") + " (*.jasp)";
6969

7070
QString browsePath = path;
7171
if (path == "")
7272
browsePath = _computerListModel->getMostRecent();
7373

74-
if (_hasFileName)
75-
browsePath += QDir::separator() + _fileName;
74+
if (!_fileName.isEmpty())
75+
browsePath += QDir::separator() + _fileName + ".jasp";
7676

7777
switch(mode)
7878
{
@@ -138,13 +138,11 @@ void Computer::analysesExportResults()
138138
void Computer::setFileName(const QString &filename)
139139
{
140140
_fileName = filename;
141-
_hasFileName = true;
142141
}
143142

144143
void Computer::clearFileName()
145144
{
146145
_fileName = "";
147-
_hasFileName = false;
148146
}
149147

150148
void Computer::browsePath(QString path)

Desktop/widgets/filemenu/computer.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ public slots:
5353
void browseSaveSignal(const QString & path = "", FileEvent::FileMode mode = FileEvent::FileSave);
5454

5555
private:
56-
// these two variables are a hack!
57-
bool _hasFileName;
58-
QString _fileName;
56+
QString _fileName; ///< Used to show right filename in save-as JASP file dialog
5957

6058
ComputerListModel *_computerListModel = nullptr;
6159
};

0 commit comments

Comments
 (0)