summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-09-08 11:34:38 (UTC)
committer zautrix <zautrix>2004-09-08 11:34:38 (UTC)
commit1fcec858408b88bb412af18fbf853b49b6970d8a (patch) (unidiff)
tree702e94a74f0bb90335b9b193d28e31c1dc392c03 /kaddressbook
parentcdff4506a9148c47406af86968da73c0dbfca0ba (diff)
downloadkdepimpi-1fcec858408b88bb412af18fbf853b49b6970d8a.zip
kdepimpi-1fcec858408b88bb412af18fbf853b49b6970d8a.tar.gz
kdepimpi-1fcec858408b88bb412af18fbf853b49b6970d8a.tar.bz2
Fixed QCOP call problem of kopiemail
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index d1d385c..74e5cf7 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1809,346 +1809,346 @@ void KABCore::addActionsManually()
1809 KToolBar* tb = mMainWindow->toolBar(); 1809 KToolBar* tb = mMainWindow->toolBar();
1810 1810
1811#ifdef DESKTOP_VERSION 1811#ifdef DESKTOP_VERSION
1812 QMenuBar* mb = mMainWindow->menuBar(); 1812 QMenuBar* mb = mMainWindow->menuBar();
1813 1813
1814 //US setup menubar. 1814 //US setup menubar.
1815 //Disable the following block if you do not want to have a menubar. 1815 //Disable the following block if you do not want to have a menubar.
1816 mb->insertItem( "&File", fileMenu ); 1816 mb->insertItem( "&File", fileMenu );
1817 mb->insertItem( "&Edit", editMenu ); 1817 mb->insertItem( "&Edit", editMenu );
1818 mb->insertItem( "&View", viewMenu ); 1818 mb->insertItem( "&View", viewMenu );
1819 mb->insertItem( "&Settings", settingsMenu ); 1819 mb->insertItem( "&Settings", settingsMenu );
1820 mb->insertItem( "&Change selected", changeMenu ); 1820 mb->insertItem( "&Change selected", changeMenu );
1821 mb->insertItem( "&Help", helpMenu ); 1821 mb->insertItem( "&Help", helpMenu );
1822 mIncSearchWidget = new IncSearchWidget( tb ); 1822 mIncSearchWidget = new IncSearchWidget( tb );
1823 // tb->insertWidget(-1, 0, mIncSearchWidget); 1823 // tb->insertWidget(-1, 0, mIncSearchWidget);
1824 1824
1825#else 1825#else
1826 //US setup toolbar 1826 //US setup toolbar
1827 QMenuBar *menuBarTB = new QMenuBar( tb ); 1827 QMenuBar *menuBarTB = new QMenuBar( tb );
1828 QPopupMenu *popupBarTB = new QPopupMenu( this ); 1828 QPopupMenu *popupBarTB = new QPopupMenu( this );
1829 menuBarTB->insertItem( "ME", popupBarTB); 1829 menuBarTB->insertItem( "ME", popupBarTB);
1830 tb->insertWidget(-1, 0, menuBarTB); 1830 tb->insertWidget(-1, 0, menuBarTB);
1831 mIncSearchWidget = new IncSearchWidget( tb ); 1831 mIncSearchWidget = new IncSearchWidget( tb );
1832 1832
1833 tb->enableMoving(false); 1833 tb->enableMoving(false);
1834 popupBarTB->insertItem( "&File", fileMenu ); 1834 popupBarTB->insertItem( "&File", fileMenu );
1835 popupBarTB->insertItem( "&Edit", editMenu ); 1835 popupBarTB->insertItem( "&Edit", editMenu );
1836 popupBarTB->insertItem( "&View", viewMenu ); 1836 popupBarTB->insertItem( "&View", viewMenu );
1837 popupBarTB->insertItem( "&Settings", settingsMenu ); 1837 popupBarTB->insertItem( "&Settings", settingsMenu );
1838 mViewManager->getFilterAction()->plug ( popupBarTB); 1838 mViewManager->getFilterAction()->plug ( popupBarTB);
1839 popupBarTB->insertItem( "&Change selected", changeMenu ); 1839 popupBarTB->insertItem( "&Change selected", changeMenu );
1840 popupBarTB->insertItem( "&Help", helpMenu ); 1840 popupBarTB->insertItem( "&Help", helpMenu );
1841 if (QApplication::desktop()->width() > 320 ) { 1841 if (QApplication::desktop()->width() > 320 ) {
1842 // mViewManager->getFilterAction()->plug ( tb); 1842 // mViewManager->getFilterAction()->plug ( tb);
1843 } 1843 }
1844#endif 1844#endif
1845 // mActionQuit->plug ( mMainWindow->toolBar()); 1845 // mActionQuit->plug ( mMainWindow->toolBar());
1846 1846
1847 1847
1848 1848
1849 //US Now connect the actions with the menue entries. 1849 //US Now connect the actions with the menue entries.
1850 mActionPrint->plug( fileMenu ); 1850 mActionPrint->plug( fileMenu );
1851 mActionMail->plug( fileMenu ); 1851 mActionMail->plug( fileMenu );
1852 fileMenu->insertSeparator(); 1852 fileMenu->insertSeparator();
1853 1853
1854 mActionNewContact->plug( fileMenu ); 1854 mActionNewContact->plug( fileMenu );
1855 mActionNewContact->plug( tb ); 1855 mActionNewContact->plug( tb );
1856 1856
1857 mActionEditAddressee->plug( fileMenu ); 1857 mActionEditAddressee->plug( fileMenu );
1858 if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 1858 if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
1859 (!KABPrefs::instance()->mMultipleViewsAtOnce )) 1859 (!KABPrefs::instance()->mMultipleViewsAtOnce ))
1860 mActionEditAddressee->plug( tb ); 1860 mActionEditAddressee->plug( tb );
1861 1861
1862 fileMenu->insertSeparator(); 1862 fileMenu->insertSeparator();
1863 mActionSave->plug( fileMenu ); 1863 mActionSave->plug( fileMenu );
1864 fileMenu->insertItem( "&Import", ImportMenu ); 1864 fileMenu->insertItem( "&Import", ImportMenu );
1865 fileMenu->insertItem( "&Emport", ExportMenu ); 1865 fileMenu->insertItem( "&Emport", ExportMenu );
1866 fileMenu->insertSeparator(); 1866 fileMenu->insertSeparator();
1867 mActionMailVCard->plug( fileMenu ); 1867 mActionMailVCard->plug( fileMenu );
1868#ifndef DESKTOP_VERSION 1868#ifndef DESKTOP_VERSION
1869 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); 1869 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu );
1870 if ( Ir::supported() ) mActionBeam->plug(fileMenu ); 1870 if ( Ir::supported() ) mActionBeam->plug(fileMenu );
1871#endif 1871#endif
1872 fileMenu->insertSeparator(); 1872 fileMenu->insertSeparator();
1873 mActionQuit->plug( fileMenu ); 1873 mActionQuit->plug( fileMenu );
1874#ifdef _WIN32_ 1874#ifdef _WIN32_
1875 mActionImportOL->plug( ImportMenu ); 1875 mActionImportOL->plug( ImportMenu );
1876#endif 1876#endif
1877 // edit menu 1877 // edit menu
1878 mActionUndo->plug( editMenu ); 1878 mActionUndo->plug( editMenu );
1879 mActionRedo->plug( editMenu ); 1879 mActionRedo->plug( editMenu );
1880 editMenu->insertSeparator(); 1880 editMenu->insertSeparator();
1881 mActionCut->plug( editMenu ); 1881 mActionCut->plug( editMenu );
1882 mActionCopy->plug( editMenu ); 1882 mActionCopy->plug( editMenu );
1883 mActionPaste->plug( editMenu ); 1883 mActionPaste->plug( editMenu );
1884 mActionDelete->plug( editMenu ); 1884 mActionDelete->plug( editMenu );
1885 editMenu->insertSeparator(); 1885 editMenu->insertSeparator();
1886 mActionSelectAll->plug( editMenu ); 1886 mActionSelectAll->plug( editMenu );
1887 1887
1888 mActionRemoveVoice->plug( changeMenu ); 1888 mActionRemoveVoice->plug( changeMenu );
1889 // settings menu 1889 // settings menu
1890//US special menuentry to configure the addressbook resources. On KDE 1890//US special menuentry to configure the addressbook resources. On KDE
1891// you do that through the control center !!! 1891// you do that through the control center !!!
1892 mActionConfigResources->plug( settingsMenu ); 1892 mActionConfigResources->plug( settingsMenu );
1893 settingsMenu->insertSeparator(); 1893 settingsMenu->insertSeparator();
1894 1894
1895 mActionConfigKAddressbook->plug( settingsMenu ); 1895 mActionConfigKAddressbook->plug( settingsMenu );
1896 1896
1897 if ( mIsPart ) { 1897 if ( mIsPart ) {
1898 mActionConfigShortcuts->plug( settingsMenu ); 1898 mActionConfigShortcuts->plug( settingsMenu );
1899 mActionConfigureToolbars->plug( settingsMenu ); 1899 mActionConfigureToolbars->plug( settingsMenu );
1900 1900
1901 } else { 1901 } else {
1902 mActionKeyBindings->plug( settingsMenu ); 1902 mActionKeyBindings->plug( settingsMenu );
1903 } 1903 }
1904 1904
1905 settingsMenu->insertSeparator(); 1905 settingsMenu->insertSeparator();
1906 1906
1907 mActionJumpBar->plug( settingsMenu ); 1907 mActionJumpBar->plug( settingsMenu );
1908 mActionDetails->plug( settingsMenu ); 1908 mActionDetails->plug( settingsMenu );
1909 if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 1909 if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
1910 mActionDetails->plug( tb ); 1910 mActionDetails->plug( tb );
1911 settingsMenu->insertSeparator(); 1911 settingsMenu->insertSeparator();
1912 1912
1913 mActionWhoAmI->plug( settingsMenu ); 1913 mActionWhoAmI->plug( settingsMenu );
1914 mActionCategories->plug( settingsMenu ); 1914 mActionCategories->plug( settingsMenu );
1915 1915
1916 mActionLicence->plug( helpMenu ); 1916 mActionLicence->plug( helpMenu );
1917 mActionFaq->plug( helpMenu ); 1917 mActionFaq->plug( helpMenu );
1918 mActionAboutKAddressbook->plug( helpMenu ); 1918 mActionAboutKAddressbook->plug( helpMenu );
1919 1919
1920 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 1920 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
1921 1921
1922 mActionSave->plug( tb ); 1922 mActionSave->plug( tb );
1923 mViewManager->getFilterAction()->plug ( tb); 1923 mViewManager->getFilterAction()->plug ( tb);
1924 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { 1924 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) {
1925 mActionUndo->plug( tb ); 1925 mActionUndo->plug( tb );
1926 mActionDelete->plug( tb ); 1926 mActionDelete->plug( tb );
1927 mActionRedo->plug( tb ); 1927 mActionRedo->plug( tb );
1928 } 1928 }
1929 } 1929 }
1930 //mActionQuit->plug ( tb ); 1930 //mActionQuit->plug ( tb );
1931 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 1931 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
1932 1932
1933 //US link the searchwidget first to this. 1933 //US link the searchwidget first to this.
1934 // The real linkage to the toolbar happens later. 1934 // The real linkage to the toolbar happens later.
1935//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 1935//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
1936//US tb->insertItem( mIncSearchWidget ); 1936//US tb->insertItem( mIncSearchWidget );
1937/*US 1937/*US
1938 mIncSearchWidget = new IncSearchWidget( tb ); 1938 mIncSearchWidget = new IncSearchWidget( tb );
1939 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1939 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1940 SLOT( incrementalSearch( const QString& ) ) ); 1940 SLOT( incrementalSearch( const QString& ) ) );
1941 1941
1942 mJumpButtonBar = new JumpButtonBar( this, this ); 1942 mJumpButtonBar = new JumpButtonBar( this, this );
1943 1943
1944//US topLayout->addWidget( mJumpButtonBar ); 1944//US topLayout->addWidget( mJumpButtonBar );
1945 this->layout()->add( mJumpButtonBar ); 1945 this->layout()->add( mJumpButtonBar );
1946*/ 1946*/
1947 1947
1948#endif //KAB_EMBEDDED 1948#endif //KAB_EMBEDDED
1949} 1949}
1950void KABCore::showLicence() 1950void KABCore::showLicence()
1951{ 1951{
1952 KApplication::showLicence(); 1952 KApplication::showLicence();
1953} 1953}
1954void KABCore::removeVoice() 1954void KABCore::removeVoice()
1955{ 1955{
1956 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) 1956 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
1957 return; 1957 return;
1958 KABC::Addressee::List list = mViewManager->selectedAddressees(); 1958 KABC::Addressee::List list = mViewManager->selectedAddressees();
1959 KABC::Addressee::List::Iterator it; 1959 KABC::Addressee::List::Iterator it;
1960 for ( it = list.begin(); it != list.end(); ++it ) { 1960 for ( it = list.begin(); it != list.end(); ++it ) {
1961 PhoneNumber::List phoneNumbers = (*it).phoneNumbers(); 1961 PhoneNumber::List phoneNumbers = (*it).phoneNumbers();
1962 PhoneNumber::List::Iterator phoneIt; 1962 PhoneNumber::List::Iterator phoneIt;
1963 bool found = false; 1963 bool found = false;
1964 for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { 1964 for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) {
1965 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found 1965 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found
1966 if ((*phoneIt).type() - PhoneNumber::Voice ) { 1966 if ((*phoneIt).type() - PhoneNumber::Voice ) {
1967 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); 1967 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice );
1968 (*it).insertPhoneNumber( (*phoneIt) ); 1968 (*it).insertPhoneNumber( (*phoneIt) );
1969 found = true; 1969 found = true;
1970 } 1970 }
1971 } 1971 }
1972 1972
1973 } 1973 }
1974 if ( found ) 1974 if ( found )
1975 contactModified((*it) ); 1975 contactModified((*it) );
1976 } 1976 }
1977} 1977}
1978 1978
1979 1979
1980 1980
1981void KABCore::clipboardDataChanged() 1981void KABCore::clipboardDataChanged()
1982{ 1982{
1983 1983
1984 if ( mReadWrite ) 1984 if ( mReadWrite )
1985 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 1985 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
1986 1986
1987} 1987}
1988 1988
1989void KABCore::updateActionMenu() 1989void KABCore::updateActionMenu()
1990{ 1990{
1991 UndoStack *undo = UndoStack::instance(); 1991 UndoStack *undo = UndoStack::instance();
1992 RedoStack *redo = RedoStack::instance(); 1992 RedoStack *redo = RedoStack::instance();
1993 1993
1994 if ( undo->isEmpty() ) 1994 if ( undo->isEmpty() )
1995 mActionUndo->setText( i18n( "Undo" ) ); 1995 mActionUndo->setText( i18n( "Undo" ) );
1996 else 1996 else
1997 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 1997 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
1998 1998
1999 mActionUndo->setEnabled( !undo->isEmpty() ); 1999 mActionUndo->setEnabled( !undo->isEmpty() );
2000 2000
2001 if ( !redo->top() ) 2001 if ( !redo->top() )
2002 mActionRedo->setText( i18n( "Redo" ) ); 2002 mActionRedo->setText( i18n( "Redo" ) );
2003 else 2003 else
2004 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 2004 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
2005 2005
2006 mActionRedo->setEnabled( !redo->isEmpty() ); 2006 mActionRedo->setEnabled( !redo->isEmpty() );
2007} 2007}
2008 2008
2009void KABCore::configureKeyBindings() 2009void KABCore::configureKeyBindings()
2010{ 2010{
2011#ifndef KAB_EMBEDDED 2011#ifndef KAB_EMBEDDED
2012 KKeyDialog::configure( actionCollection(), true ); 2012 KKeyDialog::configure( actionCollection(), true );
2013#else //KAB_EMBEDDED 2013#else //KAB_EMBEDDED
2014 qDebug("KABCore::configureKeyBindings() not implemented"); 2014 qDebug("KABCore::configureKeyBindings() not implemented");
2015#endif //KAB_EMBEDDED 2015#endif //KAB_EMBEDDED
2016} 2016}
2017 2017
2018#ifdef KAB_EMBEDDED 2018#ifdef KAB_EMBEDDED
2019void KABCore::configureResources() 2019void KABCore::configureResources()
2020{ 2020{
2021 KRES::KCMKResources dlg( this, "" , 0 ); 2021 KRES::KCMKResources dlg( this, "" , 0 );
2022 2022
2023 if ( !dlg.exec() ) 2023 if ( !dlg.exec() )
2024 return; 2024 return;
2025 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2025 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2026} 2026}
2027#endif //KAB_EMBEDDED 2027#endif //KAB_EMBEDDED
2028 2028
2029 2029
2030/* this method will be called through the QCop interface from Ko/Pi to select addresses 2030/* this method will be called through the QCop interface from Ko/Pi to select addresses
2031 * for the attendees list of an event. 2031 * for the attendees list of an event.
2032 */ 2032 */
2033void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2033void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2034{ 2034{
2035 QStringList nameList; 2035 QStringList nameList;
2036 QStringList emailList; 2036 QStringList emailList;
2037 QStringList uidList; 2037 QStringList uidList;
2038 2038
2039 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2039 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2040 uint i=0; 2040 uint i=0;
2041 for (i=0; i < list.count(); i++) 2041 for (i=0; i < list.count(); i++)
2042 { 2042 {
2043 nameList.append(list[i].realName()); 2043 nameList.append(list[i].realName());
2044 emailList.append(list[i].preferredEmail()); 2044 emailList.append(list[i].preferredEmail());
2045 uidList.append(list[i].uid()); 2045 uidList.append(list[i].uid());
2046 } 2046 }
2047 2047
2048 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); 2048 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
2049 2049
2050} 2050}
2051 2051
2052/* this method will be called through the QCop interface from other apps to show details of a contact. 2052/* this method will be called through the QCop interface from other apps to show details of a contact.
2053 */ 2053 */
2054void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2054void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2055{ 2055{
2056 qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2056 qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2057 2057
2058 QString foundUid = QString::null; 2058 QString foundUid = QString::null;
2059 if ( ! uid.isEmpty() ) { 2059 if ( ! uid.isEmpty() ) {
2060 Addressee adrr = mAddressBook->findByUid( uid ); 2060 Addressee adrr = mAddressBook->findByUid( uid );
2061 if ( !adrr.isEmpty() ) { 2061 if ( !adrr.isEmpty() ) {
2062 foundUid = uid; 2062 foundUid = uid;
2063 } 2063 }
2064 if ( email == "sendbacklist" ) { 2064 if ( email == "sendbacklist" ) {
2065 qDebug("ssssssssssssssssssssssend "); 2065 //qDebug("ssssssssssssssssssssssend ");
2066 QStringList nameList; 2066 QStringList nameList;
2067 QStringList emailList; 2067 QStringList emailList;
2068 QStringList uidList; 2068 QStringList uidList;
2069 nameList.append(adrr.realName()); 2069 nameList.append(adrr.realName());
2070 emailList = adrr.emails(); 2070 emailList = adrr.emails();
2071 uidList.append( adrr.preferredEmail()); 2071 uidList.append( adrr.preferredEmail());
2072 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 2072 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
2073 return; 2073 return;
2074 } 2074 }
2075 2075
2076 } 2076 }
2077 2077
2078 if ( email == "sendback" ) 2078 if ( email == "sendbacklist" )
2079 return; 2079 return;
2080 if (foundUid.isEmpty()) 2080 if (foundUid.isEmpty())
2081 { 2081 {
2082 //find the uid of the person first 2082 //find the uid of the person first
2083 Addressee::List namelist; 2083 Addressee::List namelist;
2084 Addressee::List emaillist; 2084 Addressee::List emaillist;
2085 2085
2086 if (!name.isEmpty()) 2086 if (!name.isEmpty())
2087 namelist = mAddressBook->findByName( name ); 2087 namelist = mAddressBook->findByName( name );
2088 2088
2089 if (!email.isEmpty()) 2089 if (!email.isEmpty())
2090 emaillist = mAddressBook->findByEmail( email ); 2090 emaillist = mAddressBook->findByEmail( email );
2091 qDebug("count %d %d ", namelist.count(),emaillist.count() ); 2091 qDebug("count %d %d ", namelist.count(),emaillist.count() );
2092 //check if we have a match in Namelist and Emaillist 2092 //check if we have a match in Namelist and Emaillist
2093 if ((namelist.count() == 0) && (emaillist.count() > 0)) { 2093 if ((namelist.count() == 0) && (emaillist.count() > 0)) {
2094 foundUid = emaillist[0].uid(); 2094 foundUid = emaillist[0].uid();
2095 } 2095 }
2096 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2096 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2097 foundUid = namelist[0].uid(); 2097 foundUid = namelist[0].uid();
2098 else 2098 else
2099 { 2099 {
2100 for (int i = 0; i < namelist.count(); i++) 2100 for (int i = 0; i < namelist.count(); i++)
2101 { 2101 {
2102 for (int j = 0; j < emaillist.count(); j++) 2102 for (int j = 0; j < emaillist.count(); j++)
2103 { 2103 {
2104 if (namelist[i] == emaillist[j]) 2104 if (namelist[i] == emaillist[j])
2105 { 2105 {
2106 foundUid = namelist[i].uid(); 2106 foundUid = namelist[i].uid();
2107 } 2107 }
2108 } 2108 }
2109 } 2109 }
2110 } 2110 }
2111 } 2111 }
2112 else 2112 else
2113 { 2113 {
2114 foundUid = uid; 2114 foundUid = uid;
2115 } 2115 }
2116 2116
2117 if (!foundUid.isEmpty()) 2117 if (!foundUid.isEmpty())
2118 { 2118 {
2119 2119
2120 // raise Ka/Pi if it is in the background 2120 // raise Ka/Pi if it is in the background
2121#ifndef DESKTOP_VERSION 2121#ifndef DESKTOP_VERSION
2122#ifndef KORG_NODCOP 2122#ifndef KORG_NODCOP
2123 //QCopEnvelope e("QPE/Application/kapi", "raise()"); 2123 //QCopEnvelope e("QPE/Application/kapi", "raise()");
2124#endif 2124#endif
2125#endif 2125#endif
2126 2126
2127 mMainWindow->showMaximized(); 2127 mMainWindow->showMaximized();
2128 mMainWindow-> raise(); 2128 mMainWindow-> raise();
2129 2129
2130 mViewManager->setSelected( "", false); 2130 mViewManager->setSelected( "", false);
2131 mViewManager->refreshView( "" ); 2131 mViewManager->refreshView( "" );
2132 mViewManager->setSelected( foundUid, true ); 2132 mViewManager->setSelected( foundUid, true );
2133 mViewManager->refreshView( foundUid ); 2133 mViewManager->refreshView( foundUid );
2134 2134
2135 if ( !mMultipleViewsAtOnce ) 2135 if ( !mMultipleViewsAtOnce )
2136 { 2136 {
2137 setDetailsVisible( true ); 2137 setDetailsVisible( true );
2138 mActionDetails->setChecked(true); 2138 mActionDetails->setChecked(true);
2139 } 2139 }
2140 } 2140 }
2141} 2141}
2142 2142
2143 2143
2144void KABCore::faq() 2144void KABCore::faq()
2145{ 2145{
2146 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); 2146 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" );
2147} 2147}
2148 2148
2149 2149
2150 2150
2151 2151
2152#ifndef KAB_EMBEDDED 2152#ifndef KAB_EMBEDDED
2153#include "kabcore.moc" 2153#include "kabcore.moc"
2154#endif //KAB_EMBEDDED 2154#endif //KAB_EMBEDDED