diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-04-23 13:58:18 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-04-23 13:58:18 (GMT) |
commit | 456b5dab0f6ac8cce024f2f7e6fefc5464d6d744 (patch) | |
tree | 577b551c3b9fe388304287bbcb35642a5e46f668 /Source/QtDialog/QMacInstallDialog.cxx | |
parent | 4801fb841f31b6358ee9654c5f85ce3a8be0cd87 (diff) | |
download | CMake-456b5dab0f6ac8cce024f2f7e6fefc5464d6d744.zip CMake-456b5dab0f6ac8cce024f2f7e6fefc5464d6d744.tar.gz CMake-456b5dab0f6ac8cce024f2f7e6fefc5464d6d744.tar.bz2 |
ENH: add better error checks to symlink create stuff
Diffstat (limited to 'Source/QtDialog/QMacInstallDialog.cxx')
-rw-r--r-- | Source/QtDialog/QMacInstallDialog.cxx | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/Source/QtDialog/QMacInstallDialog.cxx b/Source/QtDialog/QMacInstallDialog.cxx index 70293f8..fbeb10e 100644 --- a/Source/QtDialog/QMacInstallDialog.cxx +++ b/Source/QtDialog/QMacInstallDialog.cxx @@ -69,12 +69,38 @@ void QMacInstallDialog::DoInstall() if(cmSystemTools::FileExists(newName.c_str())) { std::cout << "rm [" << newName << "]\n"; - cmSystemTools::RemoveFile(newName.c_str()); + if(!cmSystemTools::RemoveFile(newName.c_str())) + { + QString message = tr("Failed to remove file " + "installation may be incomplete: "); + message += newName.c_str(); + QString title = tr("Error Removing file"); + QMessageBox::StandardButton btn = + QMessageBox::critical(this, title, message, + QMessageBox::Ok|QMessageBox::Abort); + if(btn == QMessageBox::Abort) + { + return; + } + } } std::cout << "ln -s [" << file << "] ["; std::cout << newName << "]\n"; - cmSystemTools::CreateSymlink(file.c_str(), - newName.c_str()); + if(!cmSystemTools::CreateSymlink(file.c_str(), + newName.c_str())) + { + QString message = tr("Failed create symlink " + "installation may be incomplete: "); + message += newName.c_str(); + QString title = tr("Error Creating Symlink"); + QMessageBox::StandardButton btn = + QMessageBox::critical(this, title, message, + QMessageBox::Ok|QMessageBox::Abort); + if(btn == QMessageBox::Abort) + { + return; + } + } } this->done(0); } |