diff options
author | william <william.os4y@gmail.com> | 2015-03-13 19:37:32 +0100 |
---|---|---|
committer | william <william.os4y@gmail.com> | 2015-03-13 20:51:56 +0100 |
commit | 2d7034f3e5d67704eed149a2be807c8e32c18c94 (patch) | |
tree | 734b3e5aeecc900a4e6cac017aad489fac4bafeb | |
parent | setText() does not flag Modified() automatically (diff) | |
download | lumina-2d7034f3e5d67704eed149a2be807c8e32c18c94.tar.gz lumina-2d7034f3e5d67704eed149a2be807c8e32c18c94.tar.bz2 lumina-2d7034f3e5d67704eed149a2be807c8e32c18c94.zip |
fix: when the user click cancel we don't change any values
-rw-r--r-- | desktop-editor/dialog.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/desktop-editor/dialog.cpp b/desktop-editor/dialog.cpp index d0cc28ca..fdf17d62 100644 --- a/desktop-editor/dialog.cpp +++ b/desktop-editor/dialog.cpp @@ -101,7 +101,9 @@ void Dialog::on_pbCommand_clicked() QString fileName = QFileDialog::getOpenFileName(this, tr("Open command"), commandFolder, tr("All Files (*)")); - ui->lCommand->setText(fileName); + if (!fileName.isEmpty()) { + ui->lCommand->setText(fileName); + } } @@ -112,8 +114,10 @@ void Dialog::on_pbWorkingDir_clicked() tr("Working Directory"), ui->lWorkingDir->text(), options); - ui->lWorkingDir->setText(directory); - ui->lWorkingDir->setModified(true); + if (!directory.isEmpty()) { + ui->lWorkingDir->setText(directory); + ui->lWorkingDir->setModified(true); + } } //this function is just like a regexp. @@ -208,7 +212,8 @@ void Dialog::on_pbIcon_clicked() QString fileName = QFileDialog::getOpenFileName(this, tr("Open command"), iconFolder, tr("Image Files (*.png *.jpg *.bmp)")); - qDebug() << "icon:" << fileName; - ui->pbIcon->setIcon(QPixmap(fileName)); - iconFileName=fileName; + if (!fileName.isEmpty()) { + ui->pbIcon->setIcon(QPixmap(fileName)); + iconFileName=fileName; + } } |