summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@nokia.com>2011-03-02 09:01:15 +0100
committerMaurice Kalinowski <maurice.kalinowski@nokia.com>2011-03-02 09:01:15 +0100
commitc95b618588e574913f8c0c7f1bb469120a41d978 (patch)
treec593cf9fa83fc388823a2264d5ce9cf3433f19d3
parent57696a08549b8aa4b6a4535d140fe5d57b8be6c2 (diff)
installation directory cannot be empty
The wizard page should not allow to specify an empty installation path. Hence reject the wizard to proceed Reviewed-by: Niels Weber Task-number: QTSDK-540
-rw-r--r--installerbuilder/installerbase/installerbasecommons.cpp7
-rw-r--r--installerbuilder/libinstaller/qinstallergui.cpp7
2 files changed, 14 insertions, 0 deletions
diff --git a/installerbuilder/installerbase/installerbasecommons.cpp b/installerbuilder/installerbase/installerbasecommons.cpp
index 80a95075e..2afb654c7 100644
--- a/installerbuilder/installerbase/installerbasecommons.cpp
+++ b/installerbuilder/installerbase/installerbasecommons.cpp
@@ -100,6 +100,13 @@ bool TargetDirectoryPageImpl::validatePage()
{
if ( !isVisible() )
return true;
+ if (targetDir().isEmpty()) {
+ MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(),
+ QLatin1String("forbiddenTargetDirectory"), tr("Error"),
+ tr( "The install directory cannot be empty, please specify a valid folder"),
+ QMessageBox::Ok);
+ return false;
+ }
const QFileInfo targetDirInfo = QFileInfo(targetDir());
const QDir dir( targetDir() );
diff --git a/installerbuilder/libinstaller/qinstallergui.cpp b/installerbuilder/libinstaller/qinstallergui.cpp
index 8f34a5a9f..b51545af1 100644
--- a/installerbuilder/libinstaller/qinstallergui.cpp
+++ b/installerbuilder/libinstaller/qinstallergui.cpp
@@ -1152,6 +1152,13 @@ void TargetDirectoryPage::initializePage()
bool TargetDirectoryPage::validatePage()
{
+ if (targetDir().isEmpty()) {
+ MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(),
+ QLatin1String("forbiddenTargetDirectory"), tr("Error"),
+ tr( "The install directory cannot be empty, please specify a valid folder"),
+ QMessageBox::Ok);
+ return false;
+ }
const QDir dir( targetDir() );
if( dir.exists() && dir.entryList( QDir::NoDotAndDotDot ).isEmpty() ) // it exists, but is empty (might be created by the Browse button (getExistingDirectory)