Fixed the search function.
authorMichael Andreen <harv@ruin.nu>
Thu, 7 Dec 2000 08:42:43 +0000 (08:42 +0000)
committerMichael Andreen <harv@ruin.nu>
Thu, 7 Dec 2000 08:42:43 +0000 (08:42 +0000)
Makefile
adress.pro
mainwindow.cpp
mainwindow.h

index 75bb5b5..0f36f19 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building adress
-# Generated by tmake at 15:56, 2000/12/02
+# Generated by tmake at 18:11, 2000/12/04
 #     Project: adress
 #    Template: app
 #############################################################################
@@ -25,15 +25,18 @@ GZIP        =       gzip -9f
 
 HEADERS =      contact.h \
                contactmodifyer.h \
-               mainwindow.h
+               mainwindow.h \
+               searchresult.h
 SOURCES =      contact.cpp \
                contactmodifyer.cpp \
                main.cpp \
-               mainwindow.cpp
+               mainwindow.cpp \
+               searchresult.cpp
 OBJECTS =      contact.o \
                contactmodifyer.o \
                main.o \
                mainwindow.o \
+               searchresult.o \
                ui/contactmodifyerbase.o \
                ui/mainwindowbase.o \
                ui/searchresultbase.o
@@ -48,11 +51,13 @@ UICIMPLS =  ui/contactmodifyerbase.cpp \
                ui/searchresultbase.cpp
 SRCMOC =       moc_contactmodifyer.cpp \
                moc_mainwindow.cpp \
+               moc_searchresult.cpp \
                ui/moc_contactmodifyerbase.cpp \
                ui/moc_mainwindowbase.cpp \
                ui/moc_searchresultbase.cpp
 OBJMOC =       moc_contactmodifyer.o \
                moc_mainwindow.o \
+               moc_searchresult.o \
                ui/moc_contactmodifyerbase.o \
                ui/moc_mainwindowbase.o \
                ui/moc_searchresultbase.o
@@ -125,7 +130,18 @@ main.o: main.cpp \
 mainwindow.o: mainwindow.cpp \
                mainwindow.h \
                ui/mainwindowbase.h \
-               contact.h
+               contact.h \
+               contactmodifyer.h \
+               ui/contactmodifyerbase.h \
+               searchresult.h \
+               ui/searchresultbase.h
+
+searchresult.o: searchresult.cpp \
+               searchresult.h \
+               ui/searchresultbase.h \
+               contact.h \
+               contactmodifyer.h \
+               ui/contactmodifyerbase.h
 
 ui/contactmodifyerbase.h: ui/contactmodifyerbase.ui
        $(UIC) ui/contactmodifyerbase.ui -o ui/contactmodifyerbase.h
@@ -169,6 +185,10 @@ moc_mainwindow.o: moc_mainwindow.cpp \
                ui/mainwindowbase.h \
                contact.h
 
+moc_searchresult.o: moc_searchresult.cpp \
+               searchresult.h \
+               ui/searchresultbase.h
+
 ui/moc_contactmodifyerbase.o: ui/moc_contactmodifyerbase.cpp \
                ui/contactmodifyerbase.h
 
@@ -184,6 +204,9 @@ moc_contactmodifyer.cpp: contactmodifyer.h
 moc_mainwindow.cpp: mainwindow.h
        $(MOC) mainwindow.h -o moc_mainwindow.cpp
 
+moc_searchresult.cpp: searchresult.h
+       $(MOC) searchresult.h -o moc_searchresult.cpp
+
 ui/moc_contactmodifyerbase.cpp: ui/contactmodifyerbase.h
        $(MOC) ui/contactmodifyerbase.h -o ui/moc_contactmodifyerbase.cpp
 
index 5bb0a66..f50af33 100644 (file)
@@ -2,11 +2,13 @@ TEMPLATE      = app
 CONFIG         = qt warn_on debug
 HEADERS                = contact.h \
                  contactmodifyer.h \
-                 mainwindow.h
+                 mainwindow.h \
+                 searchresult.h
 SOURCES                = contact.cpp \
                  contactmodifyer.cpp \
                  main.cpp \
-                 mainwindow.cpp
+                 mainwindow.cpp \
+                 searchresult.cpp
 INTERFACES     = ui/contactmodifyerbase.ui \
                  ui/mainwindowbase.ui \
                  ui/searchresultbase.ui
index f072838..69131c7 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)
index ad0638d..abe1ade 100644 (file)
@@ -6,6 +6,7 @@
 #include <qtextstream.h>
 #include <qstring.h>
 #include <qlistview.h>
+#include <qcombobox.h>
 #include "contact.h"
 
 class MainWindow : public CMainWindowBase