Commit 5eeb4c12 authored by Stéphane Albert's avatar Stéphane Albert

ENH: Add isEmpty() test to prevent qWarning() trace.

parent 9a5abec9
......@@ -95,13 +95,16 @@ void QtWidgetInputFilenameParameter::SelectFile()
assert( m_Input!=NULL );
QFileInfo finfo( m_Input->text() );
if( !m_Input->text().isEmpty() )
{
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
}
if (fileDialog.exec())
......
......@@ -80,13 +80,16 @@ void QtWidgetInputImageParameter::SelectFile()
assert( m_Input!=NULL );
QFileInfo finfo( m_Input->text() );
if( !m_Input->text().isEmpty() )
{
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
}
if (fileDialog.exec())
{
......
......@@ -73,13 +73,16 @@ void QtWidgetInputProcessXMLParameter::SelectFile()
assert( m_Input!=NULL );
QFileInfo finfo( m_Input->text() );
if( !m_Input->text().isEmpty() )
{
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
}
if (fileDialog.exec())
{
......
......@@ -76,13 +76,16 @@ void QtWidgetInputVectorDataParameter::SelectFile()
assert( m_Input!=NULL );
QFileInfo finfo( m_Input->text() );
if( !m_Input->text().isEmpty() )
{
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
}
if (fileDialog.exec())
{
......
......@@ -89,14 +89,16 @@ void QtWidgetOutputFilenameParameter::SelectFile()
assert( m_Input!=NULL );
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
if( !m_Input->text().isEmpty() )
{
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
}
if (fileDialog.exec())
{
......
......@@ -92,14 +92,16 @@ void QtWidgetOutputImageParameter::SelectFile()
assert( m_Input!=NULL );
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
if( !m_Input->text().isEmpty() )
{
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
}
if (fileDialog.exec())
{
......
......@@ -74,13 +74,16 @@ void QtWidgetOutputProcessXMLParameter::SelectFile()
assert( m_Input!=NULL );
QFileInfo finfo( m_Input->text() );
if( !m_Input->text().isEmpty() )
{
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
}
if (fileDialog.exec())
{
......
......@@ -73,13 +73,16 @@ void QtWidgetOutputVectorDataParameter::SelectFile()
assert( m_Input!=NULL );
QFileInfo finfo( m_Input->text() );
if( !m_Input->text().isEmpty() )
{
QFileInfo finfo( m_Input->text() );
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
fileDialog.setDirectory(
finfo.isDir()
? finfo.absoluteFilePath()
: finfo.absoluteDir()
);
}
if (fileDialog.exec())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment