[Uml-devel] KDE/kdesdk/umbrello/umbrello/codeimport
Ralf Habacker
ralf.habacker at gmail.com
Tue Jan 10 14:34:42 UTC 2012
SVN commit 1272958 by habacker:
Added return value to import methods to be able to react immediatly on error.
M +8 -5 classimport.cpp
M +2 -2 classimport.h
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/classimport.cpp #1272957:1272958
@@ -61,28 +61,31 @@
* Import files. :TODO: can be deleted
* @param fileNames List of files to import.
*/
-void ClassImport::importFiles(const QStringList& fileNames)
+bool ClassImport::importFiles(const QStringList& fileNames)
{
initialize();
UMLDoc *umldoc = UMLApp::app()->document();
uint processedFilesCount = 0;
+ bool result = true;
foreach (const QString& fileName, fileNames) {
umldoc->writeToStatusBar(i18n("Importing file: %1 Progress: %2/%3",
fileName, processedFilesCount, fileNames.size()));
- parseFile(fileName);
+ if (!parseFile(fileName))
+ result = false;
processedFilesCount++;
}
- umldoc->writeToStatusBar(i18nc("ready to status bar", "Ready."));
+ umldoc->writeToStatusBar(result ? i18nc("ready to status bar", "Ready.") : i18nc("failed to status bar", "Failed."));
+ return result;
}
/**
* Import files.
* @param files List of files to import.
*/
-void ClassImport::importFile(const QString& fileName)
+bool ClassImport::importFile(const QString& fileName)
{
initialize();
- parseFile(fileName);
+ return parseFile(fileName);
}
/**
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/classimport.h #1272957:1272958
@@ -28,8 +28,8 @@
ClassImport(CodeImpThread* thread = 0) : m_thread(thread), m_enabled(true) {}
virtual ~ClassImport() {}
- void importFiles(const QStringList& fileNames);
- void importFile(const QString& fileName);
+ bool importFiles(const QStringList& fileNames);
+ bool importFile(const QString& fileName);
/**
* Return state of the importer. It may be disabled because of
More information about the umbrello-devel
mailing list