Commit f33afc88 authored by Matthias Möller's avatar Matthias Möller

does not accept save location, if directory does not exists

closes #2261

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19634 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 829a145c
......@@ -517,6 +517,13 @@ bool LoadWidget::validFilename() {
return true;
}
bool LoadWidget::dirExists()
{
QFileInfo firstEntered = selectedFiles()[0];
// Test if directory exists
return QDir(firstEntered.dir()).exists();
}
void LoadWidget::accept() {
if( (!loadMode_) || validFilename() ) {
......@@ -524,7 +531,11 @@ void LoadWidget::accept() {
if ( loadMode_ )
loadFile();
else
{
if (!dirExists()) //if dir does not exist, don't accept
return;
saveFile();
}
QFileDialog::accept();
}
......
......@@ -83,6 +83,8 @@ class LoadWidget : public QFileDialog
int showSave(IdList _ids, QString _filename);
bool validFilename();
/// returns true, if the directory of the specified filename (user input via widget) exists
bool dirExists();
public slots :
virtual void accept();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment