Skip to content

Commit

Permalink
Fixed different bugs in code for saving course data to file
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertKrajewski committed Jan 3, 2016
1 parent 1c66366 commit c1cdaa4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion l2pitemmodel.cpp
Expand Up @@ -141,9 +141,17 @@ void L2pItemModel::saveDataToFile()
#else
QString dataPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
#endif
QFile file(dataPath + DATAFILENAME);

if(!QDir(dataPath).exists())
{
QDir().mkdir(dataPath);
}

QFile file(dataPath + "/" + DATAFILENAME);
if(!file.open(QIODevice::WriteOnly))
{
Utils::errorMessageBox(tr("Kursinformationen nicht speicherbar."),
file.errorString());
return;
}
QTextStream ts(&file);
Expand Down

0 comments on commit c1cdaa4

Please sign in to comment.