aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilliam <william.os4y@gmail.com>2015-03-13 19:37:32 +0100
committerwilliam <william.os4y@gmail.com>2015-03-13 20:51:56 +0100
commit2d7034f3e5d67704eed149a2be807c8e32c18c94 (patch)
tree734b3e5aeecc900a4e6cac017aad489fac4bafeb
parentsetText() does not flag Modified() automatically (diff)
downloadlumina-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.cpp17
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;
+ }
}
bgstack15