aboutsummaryrefslogtreecommitdiff
path: root/lumina-fileinfo/dialog.cpp
diff options
context:
space:
mode:
authorwi <william.os4y@gmail.com>2015-04-20 22:29:30 +0200
committerwi <william.os4y@gmail.com>2015-04-20 22:29:30 +0200
commitc262492c368accde32b290fcbc0d03e465aeb9df (patch)
treeb7f65e497cbfbfdfafaf878b45d8ae98de1b5e20 /lumina-fileinfo/dialog.cpp
parentMerge remote-tracking branch 'upstream/master' into deskEditor (diff)
downloadlumina-c262492c368accde32b290fcbc0d03e465aeb9df.tar.gz
lumina-c262492c368accde32b290fcbc0d03e465aeb9df.tar.bz2
lumina-c262492c368accde32b290fcbc0d03e465aeb9df.zip
test the return code of the command to mv file to refresh the icon.
Diffstat (limited to 'lumina-fileinfo/dialog.cpp')
-rw-r--r--lumina-fileinfo/dialog.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lumina-fileinfo/dialog.cpp b/lumina-fileinfo/dialog.cpp
index b0217db8..0c7c3a6a 100644
--- a/lumina-fileinfo/dialog.cpp
+++ b/lumina-fileinfo/dialog.cpp
@@ -284,17 +284,26 @@ void Dialog::on_pbApply_clicked()
//hack required to update the icon on the desktop
QTemporaryFile tempFile ;
tempFile.setAutoRemove(false);
+ tempFile.setFileTemplate("/tmp/lumina-XXXXXX");
tempFile.open();
tempFile.close();
- //TODO: capture errors
QString cmd = "mv";
cmd = cmd + " " + desktopFileName + " " + tempFile.fileName();
int ret = LUtils::runCmd(cmd);
+ if (ret !=0 ) {
+ qDebug() << "Problem to execute:" << cmd;
+ QMessageBox::critical(this, tr("Problem to write to disk"), tr("We have a problem to execute the following command:") + cmd);
+
+ }
cmd = "mv";
cmd = cmd + " " + tempFile.fileName() + " " + desktopFileName;
ret = LUtils::runCmd(cmd);
+ if (ret !=0 ) {
+ qDebug() << "Problem to execute:" << cmd;
+ QMessageBox::critical(this, tr("Problem to write to disk"), tr("We have a problem to execute the following command:") + cmd);
+ }
}
bgstack15