@@ -88,12 +88,22 @@ void NavDatabase::create(const QString& codec)
8888 if (options != nullptr )
8989 qDebug () << Q_FUNC_INFO << *options;
9090
91- createInternal (codec);
91+ bool foundError = false ;
92+ createInternal (codec, foundError);
9293 if (aborted)
9394 // Remove all (partial) changes
9495 db->rollback ();
9596 else
9697 createDatabaseReportShort ();
98+
99+ if (foundError)
100+ {
101+ qWarning () << Qt::endl;
102+ qWarning () << " *****************************************************************************" ;
103+ qWarning () << " *** Found warnings during basic validation. See log for more information. ***" ;
104+ qWarning () << " *****************************************************************************" ;
105+ qWarning () << Qt::endl;
106+ }
97107}
98108
99109void NavDatabase::createAirspaceSchema ()
@@ -551,7 +561,7 @@ int NavDatabase::countMsSimSteps()
551561 return total;
552562}
553563
554- void NavDatabase::createInternal (const QString& sceneryConfigCodec)
564+ void NavDatabase::createInternal (const QString& sceneryConfigCodec, bool & foundError )
555565{
556566 SceneryCfg sceneryCfg (sceneryConfigCodec);
557567
@@ -837,7 +847,7 @@ void NavDatabase::createInternal(const QString& sceneryConfigCodec)
837847 }
838848
839849 if (options->isBasicValidation ())
840- basicValidation (&progress);
850+ basicValidation (&progress, foundError );
841851
842852 if (options->isDatabaseReport ())
843853 {
@@ -1195,29 +1205,32 @@ bool NavDatabase::loadFsxP3dMsfsPost(ProgressHandler *progress)
11951205 return false ;
11961206}
11971207
1198- bool NavDatabase::basicValidation (ProgressHandler *progress)
1208+ bool NavDatabase::basicValidation (ProgressHandler *progress, bool & foundError )
11991209{
12001210 if ((aborted = progress->reportOther (tr (" Basic Validation" ))))
12011211 return true ;
12021212
12031213 const QMap<QString, int >& basicValidationTables = options->getBasicValidationTables ();
12041214 for (auto it = basicValidationTables.begin (); it != basicValidationTables.end (); ++it)
1205- basicValidateTable (it.key (), it.value ());
1215+ basicValidateTable (it.key (), it.value (), foundError );
12061216
12071217 return false ;
12081218}
12091219
1210- void NavDatabase::basicValidateTable (const QString& table, int minCount)
1220+ void NavDatabase::basicValidateTable (const QString& table, int minCount, bool & foundError )
12111221{
12121222 SqlUtil util (db);
12131223 if (!util.hasTable (table))
12141224 throw Exception (" Table \" " + table + " \" not found." );
12151225
12161226 int count = 0 ;
12171227 if ((count = util.rowCount (table)) < minCount)
1218- throw Exception (QString (" Table \" %1\" has only %2 rows. Minimum required is %3" ).arg (table).arg (count).arg (minCount));
1219-
1220- qInfo () << " Table" << table << " is OK. Has" << count << " rows. Minimum required is" << minCount;
1228+ {
1229+ qWarning () << " *** Table" << table << " has only" << count << " rows. Minimum required is" << minCount << " ***" ;
1230+ foundError = true ;
1231+ }
1232+ else
1233+ qInfo () << " Table" << table << " is OK. Has" << count << " rows. Minimum required is" << minCount;
12211234}
12221235
12231236void NavDatabase::runPreparationPost245 (atools::sql::SqlDatabase& db)
0 commit comments