/*
* Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl
+ * Copyright (C) 2011-2013 Philipp Spitzer, gregor herrmann, Stefan Stahl
*
* This file is part of ConfClerk.
*
#include "searchhead.h"
#include <QMessageBox>
-SearchTabContainer::SearchTabContainer(QWidget *aParent) : TabContainer( aParent )
-{
+SearchTabContainer::SearchTabContainer(QWidget *aParent): TabContainer(aParent), sqlEngine(0) {
header = new SearchHead(this);
header->setObjectName(QString::fromUtf8("header"));
QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
void SearchTabContainer::showSearchDialog(bool show) {
header->setVisible(show);
treeView->setVisible(!show);
+ if (show) header->searchEdit->setFocus(Qt::OtherFocusReason);
}
void SearchTabContainer::searchButtonClicked() {
+ if (!sqlEngine) return;
+
QHash<QString,QString> columns;
SearchHead *searchHeader = static_cast<SearchHead*>(header);
if (confId == -1) return;
Conference conf = Conference::getById(confId);
- SqlEngine::searchEvent( confId, columns, keyword );
+ sqlEngine->searchEvent( confId, columns, keyword );
int nrofFounds = 0;
for (QDate d = conf.start(); d <= conf.end(); d = d.addDays(1))