Clang: Fix exception catching

Change-Id: I5914ee4056e821359109786190b7006ef992b60e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-03-28 13:18:39 +02:00
parent 410a2b95c4
commit 4b97126d28
3 changed files with 82 additions and 72 deletions

View File

@@ -59,33 +59,35 @@ QStringList processArguments(QCoreApplication &application)
}
int main(int argc, char *argv[])
try {
//QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false"));
{
try {
//QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false"));
QCoreApplication::setOrganizationName(QStringLiteral("QtProject"));
QCoreApplication::setOrganizationDomain(QStringLiteral("qt-project.org"));
QCoreApplication::setApplicationName(QStringLiteral("ClangRefactoringBackend"));
QCoreApplication::setApplicationVersion(QStringLiteral("0.1.0"));
QCoreApplication::setOrganizationName(QStringLiteral("QtProject"));
QCoreApplication::setOrganizationDomain(QStringLiteral("qt-project.org"));
QCoreApplication::setApplicationName(QStringLiteral("ClangRefactoringBackend"));
QCoreApplication::setApplicationVersion(QStringLiteral("0.1.0"));
QCoreApplication application(argc, argv);
QCoreApplication application(argc, argv);
const QStringList arguments = processArguments(application);
const QString connectionName = arguments[0];
const QString databasePath = arguments[1];
const QStringList arguments = processArguments(application);
const QString connectionName = arguments[0];
const QString databasePath = arguments[1];
Sqlite::Database database{Utils::PathString{databasePath}};
RefactoringDatabaseInitializer<Sqlite::Database> databaseInitializer{database};
FilePathCaching filePathCache{database};
SymbolIndexing symbolIndexing{database, filePathCache};
RefactoringServer clangCodeModelServer{symbolIndexing, filePathCache};
ConnectionServer<RefactoringServer, RefactoringClientProxy> connectionServer;
connectionServer.setServer(&clangCodeModelServer);
connectionServer.start(connectionName);
Sqlite::Database database{Utils::PathString{databasePath}};
RefactoringDatabaseInitializer<Sqlite::Database> databaseInitializer{database};
FilePathCaching filePathCache{database};
SymbolIndexing symbolIndexing{database, filePathCache};
RefactoringServer clangCodeModelServer{symbolIndexing, filePathCache};
ConnectionServer<RefactoringServer, RefactoringClientProxy> connectionServer;
connectionServer.setServer(&clangCodeModelServer);
connectionServer.start(connectionName);
return application.exec();
} catch (const Sqlite::Exception &exception) {
exception.printWarning();
return application.exec();
} catch (const Sqlite::Exception &exception) {
exception.printWarning();
}
}