From ba3c5aa40274c11f9cefd4e9842be3488cad07b4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 15 Jun 2018 14:05:25 +0200 Subject: Fix indentation, cleanup, refactoring, deletions * Remove unused methods for adding hostname and user to xml * Avoid copying/(de)serializing XML a thousand times * Fix Session::isValid() or rather make it a bit more usable (although it's unused currently) * baseDir is global, not per VSession, which doesn't make any sense without the legacy approach of recusively loading one xml file per entry --- src/dialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dialog.cpp') diff --git a/src/dialog.cpp b/src/dialog.cpp index 926c65b..7e22962 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -52,7 +52,7 @@ Dialog::Dialog(int defaultTab, bool examMode, QWidget *parent) ui->treeView->setFocusProxy(ui->filterEdit); // ui->filterEdit->installEventFilter(this); - qApp->installEventFilter(this); + QCoreApplication::instance()->installEventFilter(this); ui->helpBox->hide(); ui->newsBox->hide(); @@ -286,7 +286,7 @@ bool Dialog::selectSession(const QString& name) { bool Dialog::selectSessionByUuid(const QString& name) { QModelIndex root(ui->treeView->rootIndex()); - for (int tab = 0; tab < TAB_COUNT; ++tab) { + for (int tab = 0; tab < TAB_COUNT; ++tab) { for (int i = 0; i < model_[tab]->rowCount(root); ++i) { QModelIndex section(model_[tab]->index(i, 0, root)); if (!section.isValid()) { @@ -405,7 +405,7 @@ void Dialog::onCenterTimer() { if (autoQuit_ > 0) { autoQuit_--; if (autoQuit_ == 0) { - qApp->exit(0); + QCoreApplication::instance()->exit(0); } else if (autoQuit_ < 60) { ui->lblAutoQuit->setText(this->trUtf8("Auto logout in %1").arg(autoQuit_)); ui->lblAutoQuit->show(); -- cgit v1.2.3-55-g7522