Commit 575509c8 authored by saubatn's avatar saubatn
Browse files

FIXED Bug 109 Inform user when using Application::Open() or calling directly a...

FIXED Bug 109 Inform user when using Application::Open() or calling directly a component constructor. Print a warning if Application::Open() does NOT return a top level component.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@1820 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 0b388204
......@@ -386,6 +386,10 @@ Component * Application::open(const QString & fileName) {
// restore the normal cursor/progress bar
restoreOverrideCursor();
resetProgressBar();
if(!comp->isTopLevel())
CAMITK_WARNING("Application", "Open", "Instanciating a NON top level component.")
return comp;
}
......@@ -443,6 +447,8 @@ Component * Application::openDirectory(const QString & dirName, const QString &
// restore the normal cursor/progress bar
restoreOverrideCursor();
resetProgressBar();
return comp;
}
......
......@@ -147,7 +147,9 @@ public:
*/
///@{
/// load the filename and returns the corresponding Component (return NULL if an error occurs)
/// load the filename and returns the corresponding top level Component (return NULL if an error occurs)
/// @note this method opens the filename and created the associated TOP LEVEL component
/// If you wish to open a subcomponent (not top level then), prefer directly calling its public constructor.
static Component * open(const QString &);
/** load a directory and returns the corresponding Component (return NULL if an error occurs)
......
Supports Markdown
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