Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Sep 8, 2015
1 parent 11a31f5 commit 3ef1dc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion API
Submodule API updated from eb69b8 to 81abf0
12 changes: 7 additions & 5 deletions base/lib/core/presenter/Presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ bool Presenter::saveDocument(Document * doc)
bool Presenter::saveDocumentAs(Document * doc)
{
QFileDialog d{m_view, tr("Save Document As")};
auto binFilter{tr("Binary (*.scorebin)")};
auto jsonFilter{tr("JSON (*.scorejson)")};
QString binFilter{tr("Binary (*.scorebin)")};
QString jsonFilter{tr("JSON (*.scorejson)")};
QStringList filters;
filters << binFilter
<< jsonFilter;
Expand All @@ -206,18 +206,20 @@ bool Presenter::saveDocumentAs(Document * doc)

if(d.exec())
{
auto savename = d.selectedFiles().first();
QString savename = d.selectedFiles().first();
auto suf = d.selectedNameFilter();

if(!savename.isEmpty())
{
if(suf == binFilter)
{
savename += ".scorebin";
if(!savename.contains(".scorebin"))
savename += ".scorebin";
}
else
{
savename += ".scorejson";
if(!savename.contains(".scorejson"))
savename += ".scorejson";
}

QSaveFile f{savename};
Expand Down

0 comments on commit 3ef1dc7

Please sign in to comment.