Adjust whitespace in if statements.
[toast/confclerk.git] / src / gui / searchtabcontainer.cpp
index 0800f99e67e05edf91b047f84650a7f91aa5388c..3c3d7bdd326c42cef91b777c04023ec61864a5b0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl
+ * Copyright (C) 2011-2017 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
  * This file is part of ConfClerk.
  *
@@ -53,25 +53,26 @@ int SearchTabContainer::searchResultCount(const QDate& date) const {
 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;
+    QMultiHash<QString,QString> columns;
 
     SearchHead *searchHeader = static_cast<SearchHead*>(header);
-    if( searchHeader->searchTitle->isChecked() )
-        columns.insertMulti("EVENT", "title");
-    if( searchHeader->searchAbstract->isChecked() )
-        columns.insertMulti("EVENT", "abstract");
-    if( searchHeader->searchTag->isChecked() )
-        columns.insertMulti("EVENT", "tag");
-    if( searchHeader->searchSpeaker->isChecked() )
-        columns["PERSON"] = "name";
-    if( searchHeader->searchRoom->isChecked() )
-        columns["ROOM"] = "name";
+    if (searchHeader->searchTitle->isChecked())
+        columns.insert("EVENT", "title");
+    if (searchHeader->searchAbstract->isChecked())
+        columns.insert("EVENT", "abstract");
+    if (searchHeader->searchTag->isChecked())
+        columns.insert("EVENT", "tag");
+    if (searchHeader->searchSpeaker->isChecked())
+        columns.insert("PERSON", "name");
+    if (searchHeader->searchRoom->isChecked())
+        columns.insert("ROOM", "name");
 
     QString keyword = searchHeader->searchEdit->text();