From 8cdf4662f16ad0496b2883ae6bd02470c7365887 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Sun, 30 Aug 2015 11:42:12 +0200 Subject: [PATCH] lazy integrity check --- src/main.cpp | 5 +---- src/mainwindow.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 53c19ba..6515067 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -128,10 +128,7 @@ int main(int argc, char **argv) { // all string literals are UTF-8 // QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -#ifdef APP_INTEGRITY - if (Extra::integrityCheck()) -#endif - showWindow(app, dataDir); + showWindow(app, dataDir); return app.exec(); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a77ac27..6eb56c9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -221,15 +221,22 @@ void MainWindow::lazyInit() { JsFunctions::instance(); - checkForUpdate(); - // Hack to give focus to searchlineedit QMetaObject::invokeMethod(views->currentWidget(), "appear"); View* view = qobject_cast (views->currentWidget()); QString desc = view->metadata().value("description").toString(); if (!desc.isEmpty()) showMessage(desc); +#ifdef APP_INTEGRITY + if (!Extra::integrityCheck()) { + deleteLater(); + return; + } +#endif + ChannelAggregator::instance()->start(); + + checkForUpdate(); } void MainWindow::changeEvent(QEvent *e) { -- 2.39.5