[Uml-devel] CVS: kdesdk/umbrello/umbrello umldoc.cpp,1.4,1.5

kde at office.kde.org kde at office.kde.org
Tue Jan 28 15:17:03 UTC 2003


Update of /home/kde/kdesdk/umbrello/umbrello
In directory office:/tmp/cvs-serv12969

Modified Files:
	umldoc.cpp 
Log Message:
Added more helpful error message when loading a file which doesn't exist


Index: umldoc.cpp
===================================================================
RCS file: /home/kde/kdesdk/umbrello/umbrello/umldoc.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- umldoc.cpp	27 Jan 2003 21:37:14 -0000	1.4
+++ umldoc.cpp	28 Jan 2003 23:16:12 -0000	1.5
@@ -228,6 +228,14 @@
 	QString tmpfile;
 	KIO::NetAccess::download( url, tmpfile );
 	QFile file( tmpfile );
+	if ( !file.exists() ) {
+		KMessageBox::error(0, i18n("The file %1 does not exist.").arg(d.path()), i18n("Load Error"));
+		doc_url.setFileName(i18n("Untitled"));
+		loading = false;
+		newDocument();
+		return false;
+	}
+
 	if( !file.open( IO_ReadOnly ) ) {
 		KMessageBox::error(0, i18n("There was a problem loading file: %1").arg(d.path()), i18n("Load Error"));
 		doc_url.setFileName(i18n("Untitled"));





More information about the umbrello-devel mailing list