]> ruin.nu Git - adress.git/blobdiff - mainwindow.cpp
Fixed the search function.
[adress.git] / mainwindow.cpp
index f07283884ccbb285d906bbc5b305dd0c7a7f8fcc..69131c7eb461414b489ba474135557dd62d7eb95 100644 (file)
@@ -2,6 +2,7 @@
 #include <iostream>
 
 #include "contactmodifyer.h"
+#include "searchresult.h"
 
 /* BRÖÖL
  *  Constructs a MainWindow which is a child of 'parent', with the 
@@ -118,7 +119,7 @@ void MainWindow::slotLoad()
                QString adr             = t.readLine();
                QString pn              = t.readLine();
     if (fname == "" && lname == "" && lname == "" && pn == "")
-                             continue;
+                       continue;
                (void) new CContact(fname, lname, adr, pn);
        }
        updateView();
@@ -128,7 +129,12 @@ void MainWindow::slotLoad()
  */
 void MainWindow::slotSearch()
 {
-    qWarning( "MainWindow::slotSearch() not yet implemented!" ); 
+       if (SearchLine->text().isNull())
+               return;
+
+       SearchResult search(SearchLine->text(), SearchCombo->currentItem() + 1);
+       search.show();
+       updateView();
 }
 
 void MainWindow::slotModify(QListViewItem* lvi)