Searching without active conference doesn't give an error message anymore (resolves...
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 26 Jun 2011 18:28:57 +0000 (18:28 +0000)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 26 Jun 2011 18:28:57 +0000 (18:28 +0000)
src/gui/searchtabcontainer.cpp
src/mvc/conference.h

index 246b4ea..fa5f22d 100644 (file)
@@ -86,6 +86,8 @@ void SearchTabContainer::searchButtonClicked()
     QString keyword = searchHeader->searchEdit->text();
 
     int confId = Conference::activeConference();
     QString keyword = searchHeader->searchEdit->text();
 
     int confId = Conference::activeConference();
+    if (confId == -1) return;
+
     SqlEngine::searchEvent( confId, columns, keyword );
 
     QDate startDate = Conference::getById(confId).start();
     SqlEngine::searchEvent( confId, columns, keyword );
 
     QDate startDate = Conference::getById(confId).start();
index 897c396..1d70439 100644 (file)
@@ -35,7 +35,7 @@ public:
 public:
     static Conference getById(int id);
     static QList<Conference> getAll();
 public:
     static Conference getById(int id);
     static QList<Conference> getAll();
-    static int activeConference();
+    static int activeConference(); ///< returns -1 if no conference is active
     static void deleteConference(int id);
 
 public:
     static void deleteConference(int id);
 
 public: