Rename KABC namespace

pull/1/head
Timothy Pearson 11 years ago
parent 65b54c8b51
commit ed060e4132

@ -2089,7 +2089,7 @@ if test $kde_qtver = 3; then
AC_SUBST(LIB_KJS, "-lkjs") AC_SUBST(LIB_KJS, "-lkjs")
AC_SUBST(LIB_SMB, "-lsmb") AC_SUBST(LIB_SMB, "-lsmb")
AC_SUBST(LIB_KAB, "-lkab") AC_SUBST(LIB_KAB, "-lkab")
AC_SUBST(LIB_KABC, "-ltdeabc") AC_SUBST(LIB_TDEABC, "-ltdeabc")
AC_SUBST(LIB_TDEHTML, "-ltdehtml") AC_SUBST(LIB_TDEHTML, "-ltdehtml")
AC_SUBST(LIB_KSPELL, "-ltdespell") AC_SUBST(LIB_KSPELL, "-ltdespell")
AC_SUBST(LIB_KPARTS, "-ltdeparts") AC_SUBST(LIB_KPARTS, "-ltdeparts")

@ -33,7 +33,7 @@ konversation_SOURCES = konviface.skel konviconfigdialog.cpp konversationstatusba
connectionsettings.cpp connectionmanager.cpp awaymanager.cpp connectionsettings.cpp connectionmanager.cpp awaymanager.cpp
konversation_COMPILE_FIRST = config/preferences_base.h konversation_COMPILE_FIRST = config/preferences_base.h
konversation_LDADD = $(LIB_KIO) $(LIB_XSS) $(LIB_KABC) $(LIB_KIMIFACE) linkaddressbook/liblinkaddressbookui.la blowfish/libblowfish.la config/libkonversationconfig.la konversation_LDADD = $(LIB_KIO) $(LIB_XSS) $(LIB_TDEABC) $(LIB_KIMIFACE) linkaddressbook/liblinkaddressbookui.la blowfish/libblowfish.la config/libkonversationconfig.la
xdg_apps_DATA = konversation.desktop xdg_apps_DATA = konversation.desktop

@ -489,13 +489,13 @@ void Channel::popupCommand(int id)
{ {
if(id == Konversation::AddressbookDelete) if(id == Konversation::AddressbookDelete)
{ {
KABC::Addressee addr = (*it)->getNickInfo()->getAddressee(); TDEABC::Addressee addr = (*it)->getNickInfo()->getAddressee();
addressbook->unassociateNick(addr, (*it)->getNickname(), m_server->getServerName(), m_server->getDisplayName()); addressbook->unassociateNick(addr, (*it)->getNickname(), m_server->getServerName(), m_server->getDisplayName());
} }
else else
{ {
//make new addressbook contact //make new addressbook contact
KABC::Addressee addr; TDEABC::Addressee addr;
NickInfoPtr nickInfo = (*it)->getNickInfo(); NickInfoPtr nickInfo = (*it)->getNickInfo();
if(nickInfo->getRealName().isEmpty()) if(nickInfo->getRealName().isEmpty())
addr.setGivenName(nickInfo->getNickname()); addr.setGivenName(nickInfo->getNickname());

@ -198,7 +198,7 @@ TQString ChannelNick::getHostmask() const
TQString ChannelNick::tooltip() TQString ChannelNick::tooltip()
{ {
// if(addressee.isEmpty()) return TQString(); // if(addressee.isEmpty()) return TQString();
KABC::Addressee addressee = nickInfo->getAddressee(); TDEABC::Addressee addressee = nickInfo->getAddressee();
TQString strTooltip; TQString strTooltip;
TQTextStream tooltip( &strTooltip, IO_WriteOnly ); TQTextStream tooltip( &strTooltip, IO_WriteOnly );

@ -322,7 +322,7 @@ KonversationMainWindow::KonversationMainWindow() : TDEMainWindow(0,"main_window"
m_bookmarkHandler = new KonviBookmarkHandler(this); m_bookmarkHandler = new KonviBookmarkHandler(this);
// set up KABC with a nice gui error dialog // set up KABC with a nice gui error dialog
KABC::GuiErrorHandler *m_guiErrorHandler = new KABC::GuiErrorHandler(this); TDEABC::GuiErrorHandler *m_guiErrorHandler = new TDEABC::GuiErrorHandler(this);
kapp->dcopClient()->setAcceptCalls( false ); kapp->dcopClient()->setAcceptCalls( false );
Konversation::Addressbook::self()->getAddressBook()->setErrorHandler(m_guiErrorHandler); Konversation::Addressbook::self()->getAddressBook()->setErrorHandler(m_guiErrorHandler);
kapp->dcopClient()->setAcceptCalls( true ); kapp->dcopClient()->setAcceptCalls( true );

@ -36,7 +36,7 @@ namespace Konversation
Addressbook::Addressbook() : DCOPObject( "KIMIface") Addressbook::Addressbook() : DCOPObject( "KIMIface")
{ {
addressBook = KABC::StdAddressBook::self(true); addressBook = TDEABC::StdAddressBook::self(true);
m_ticket=NULL; m_ticket=NULL;
} }
Addressbook::~Addressbook() Addressbook::~Addressbook()
@ -54,7 +54,7 @@ namespace Konversation
TQStringList Addressbook::allContacts() TQStringList Addressbook::allContacts()
{ {
TQStringList contactUIDS; TQStringList contactUIDS;
for( KABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it ) for( TDEABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it )
if(hasAnyNicks(*it)) contactUIDS.append((*it).uid()); if(hasAnyNicks(*it)) contactUIDS.append((*it).uid());
return contactUIDS; return contactUIDS;
} }
@ -62,7 +62,7 @@ namespace Konversation
TQStringList Addressbook::allContactsNicks() TQStringList Addressbook::allContactsNicks()
{ {
TQStringList contacts; TQStringList contacts;
for( KABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it ) for( TDEABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it )
contacts += TQStringList::split( TQChar( 0xE000 ), (*it).custom("messaging/irc", "All") ); contacts += TQStringList::split( TQChar( 0xE000 ), (*it).custom("messaging/irc", "All") );
return contacts; return contacts;
} }
@ -70,7 +70,7 @@ namespace Konversation
TQStringList Addressbook::onlineContacts() TQStringList Addressbook::onlineContacts()
{ {
TQStringList contactUIDS; TQStringList contactUIDS;
for( KABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it ) for( TDEABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it )
if(isOnline(*it)) contactUIDS.append((*it).uid()); if(isOnline(*it)) contactUIDS.append((*it).uid());
return contactUIDS; return contactUIDS;
@ -215,7 +215,7 @@ namespace Konversation
focusAndShowErrorMessage(i18n("Another TDE application tried to use Konversation for instant messaging, but did not specify any contact to send the message to. This is probably a bug in the other application.")); focusAndShowErrorMessage(i18n("Another TDE application tried to use Konversation for instant messaging, but did not specify any contact to send the message to. This is probably a bug in the other application."));
return; return;
} }
KABC::Addressee addressee = addressBook->findByUid(uid); TDEABC::Addressee addressee = addressBook->findByUid(uid);
if(addressee.isEmpty()) if(addressee.isEmpty())
{ {
focusAndShowErrorMessage(i18n("Another TDE application tried to use Konversation for instant messaging, but Konversation could not find the specified contact in the TDE address book.")); focusAndShowErrorMessage(i18n("Another TDE application tried to use Konversation for instant messaging, but Konversation could not find the specified contact in the TDE address book."));
@ -275,7 +275,7 @@ void Addressbook::sendFile(const TQString &uid, const KURL &sourceURL, const TQS
focusAndShowErrorMessage(i18n("Another TDE application tried to use Konversation to send a file to a contact, but did not specify any contact to send the file to. This is probably a bug in the other application.")); focusAndShowErrorMessage(i18n("Another TDE application tried to use Konversation to send a file to a contact, but did not specify any contact to send the file to. This is probably a bug in the other application."));
return; return;
} }
KABC::Addressee addressee = addressBook->findByUid(uid); TDEABC::Addressee addressee = addressBook->findByUid(uid);
if(addressee.isEmpty()) if(addressee.isEmpty())
{ {
focusAndShowErrorMessage(i18n("Another TDE application tried to use Konversation to send a file to a contact, but Konversation could not find the specified contact in the TDE address book.")); focusAndShowErrorMessage(i18n("Another TDE application tried to use Konversation to send a file to a contact, but Konversation could not find the specified contact in the TDE address book."));

@ -32,7 +32,7 @@ namespace Konversation
AddressbookBase::AddressbookBase() AddressbookBase::AddressbookBase()
{ {
KABC::StdAddressBook::setAutomaticSave( false ); TDEABC::StdAddressBook::setAutomaticSave( false );
m_ticket=NULL; m_ticket=NULL;
} }
@ -40,32 +40,32 @@ namespace Konversation
{ {
} }
KABC::AddressBook *AddressbookBase::getAddressBook() { return addressBook; } TDEABC::AddressBook *AddressbookBase::getAddressBook() { return addressBook; }
KABC::Addressee AddressbookBase::getKABCAddresseeFromNick(const TQString &ircnick, const TQString &servername, const TQString &servergroup) TDEABC::Addressee AddressbookBase::getKABCAddresseeFromNick(const TQString &ircnick, const TQString &servername, const TQString &servergroup)
{ {
KABC::AddressBook::Iterator it; TDEABC::AddressBook::Iterator it;
for( it = addressBook->begin(); it != addressBook->end(); ++it ) for( it = addressBook->begin(); it != addressBook->end(); ++it )
{ {
if(hasNick(*it, ircnick, servername, servergroup)) if(hasNick(*it, ircnick, servername, servergroup))
return (*it); return (*it);
} }
return KABC::Addressee(); return TDEABC::Addressee();
} }
KABC::Addressee AddressbookBase::getKABCAddresseeFromNick(const TQString &nick_server) TDEABC::Addressee AddressbookBase::getKABCAddresseeFromNick(const TQString &nick_server)
{ {
KABC::AddressBook::Iterator it; TDEABC::AddressBook::Iterator it;
for( it = addressBook->begin(); it != addressBook->end(); ++it ) for( it = addressBook->begin(); it != addressBook->end(); ++it )
{ {
if(hasNick(*it, nick_server)) if(hasNick(*it, nick_server))
return (*it); return (*it);
} }
return KABC::Addressee(); return TDEABC::Addressee();
} }
bool AddressbookBase::hasNick(const KABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup) bool AddressbookBase::hasNick(const TDEABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup)
{ {
TQString lnick = ircnick.lower(); TQString lnick = ircnick.lower();
@ -92,13 +92,13 @@ namespace Konversation
TQStringList AddressbookBase::allContactsNicksForServer(const TQString &servername, const TQString &servergroup) TQStringList AddressbookBase::allContactsNicksForServer(const TQString &servername, const TQString &servergroup)
{ {
TQStringList contacts; TQStringList contacts;
for( KABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it ) for( TDEABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it )
contacts += getNicks(*it, servername, servergroup); contacts += getNicks(*it, servername, servergroup);
return contacts; return contacts;
} }
TQStringList AddressbookBase::getNicks(const KABC::Addressee &addressee, const TQString &servername, const TQString &servergroup) TQStringList AddressbookBase::getNicks(const TDEABC::Addressee &addressee, const TQString &servername, const TQString &servergroup)
{ {
TQStringList nicks; TQStringList nicks;
@ -121,7 +121,7 @@ namespace Konversation
return nicks; return nicks;
} }
bool AddressbookBase::hasNick(const KABC::Addressee &addressee, const TQString &nick_server) bool AddressbookBase::hasNick(const TDEABC::Addressee &addressee, const TQString &nick_server)
{ {
TQString lnick_server = nick_server.lower(); TQString lnick_server = nick_server.lower();
TQStringList addresses = TQStringList::split( TQChar( 0xE000 ), addressee.custom("messaging/irc", "All") ); TQStringList addresses = TQStringList::split( TQChar( 0xE000 ), addressee.custom("messaging/irc", "All") );
@ -136,7 +136,7 @@ namespace Konversation
} }
TQString AddressbookBase::getBestNick(const KABC::Addressee &addressee) TQString AddressbookBase::getBestNick(const TDEABC::Addressee &addressee)
{ {
//Look for a nickinfo for this nick, and use that. That way we turn a nick that is online. //Look for a nickinfo for this nick, and use that. That way we turn a nick that is online.
NickInfoPtr nickInfo = getNickInfo(addressee); NickInfoPtr nickInfo = getNickInfo(addressee);
@ -151,7 +151,7 @@ namespace Konversation
return TQString(); return TQString();
} }
NickInfoPtr AddressbookBase::getNickInfo(const KABC::Addressee &addressee) NickInfoPtr AddressbookBase::getNickInfo(const TDEABC::Addressee &addressee)
{ {
NickInfoPtr lastNickInfo; NickInfoPtr lastNickInfo;
TQStringList addresses = TQStringList::split( TQChar( 0xE000 ), addressee.custom("messaging/irc", "All") ); TQStringList addresses = TQStringList::split( TQChar( 0xE000 ), addressee.custom("messaging/irc", "All") );
@ -175,11 +175,11 @@ namespace Konversation
return lastNickInfo; return lastNickInfo;
} }
bool AddressbookBase::hasAnyNicks(const KABC::Addressee &addressee) bool AddressbookBase::hasAnyNicks(const TDEABC::Addressee &addressee)
{ {
return !addressee.custom("messaging/irc", "All").isEmpty(); return !addressee.custom("messaging/irc", "All").isEmpty();
} }
void AddressbookBase::unassociateNick(KABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup) void AddressbookBase::unassociateNick(TDEABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup)
{ {
kdDebug() << "in unassociatenick for '" << ircnick << endl; kdDebug() << "in unassociatenick for '" << ircnick << endl;
@ -239,7 +239,7 @@ namespace Konversation
} }
/**For a given contact, adds the ircnick if they don't already have it. If you pass an addressBook, the contact is inserted /**For a given contact, adds the ircnick if they don't already have it. If you pass an addressBook, the contact is inserted
* if it has changed. */ * if it has changed. */
void AddressbookBase::associateNick(KABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup) void AddressbookBase::associateNick(TDEABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup)
{ {
//It's easiest to just remove it from the list if it's there already //It's easiest to just remove it from the list if it's there already
unassociateNick(addressee, ircnick, servername, servergroup); unassociateNick(addressee, ircnick, servername, servergroup);
@ -259,9 +259,9 @@ namespace Konversation
addressBook->insertAddressee(addressee); addressBook->insertAddressee(addressee);
} }
/** This function associates the nick for a person, then iterates over all the contacts unassociating the nick from everyone else. It saves the addressses that have changed.*/ /** This function associates the nick for a person, then iterates over all the contacts unassociating the nick from everyone else. It saves the addressses that have changed.*/
bool AddressbookBase::associateNickAndUnassociateFromEveryoneElse(KABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup) bool AddressbookBase::associateNickAndUnassociateFromEveryoneElse(TDEABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup)
{ {
for( KABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it ) for( TDEABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it )
if((*it).uid() != addressee.uid()) if((*it).uid() != addressee.uid())
unassociateNick(*it, ircnick, servername, servergroup); unassociateNick(*it, ircnick, servername, servergroup);
associateNick(addressee, ircnick, servername, servergroup); associateNick(addressee, ircnick, servername, servergroup);
@ -335,7 +335,7 @@ namespace Konversation
return true; return true;
} }
bool AddressbookBase::saveAddressee(KABC::Addressee &addressee) bool AddressbookBase::saveAddressee(TDEABC::Addressee &addressee)
{ {
Q_ASSERT(&addressee); Q_ASSERT(&addressee);
addressBook->insertAddressee(addressee); addressBook->insertAddressee(addressee);
@ -354,7 +354,7 @@ namespace Konversation
* @param addressee Addressbook contact you want to know of the presence of * @param addressee Addressbook contact you want to know of the presence of
* @return 0 (unknown), 1 (offline), 3 (away), 4 (online) * @return 0 (unknown), 1 (offline), 3 (away), 4 (online)
*/ */
int AddressbookBase::presenceStatusByAddressee(const KABC::Addressee &addressee) int AddressbookBase::presenceStatusByAddressee(const TDEABC::Addressee &addressee)
{ {
Q_ASSERT(&addressee); Q_ASSERT(&addressee);
NickInfoPtr nickInfo = getNickInfo(addressee); NickInfoPtr nickInfo = getNickInfo(addressee);
@ -370,7 +370,7 @@ namespace Konversation
return 4; return 4;
} }
bool AddressbookBase::isOnline(KABC::Addressee &addressee) bool AddressbookBase::isOnline(TDEABC::Addressee &addressee)
{ {
return !!getNickInfo(addressee); return !!getNickInfo(addressee);
} }
@ -396,7 +396,7 @@ namespace Konversation
return true; return true;
} }
bool AddressbookBase::sendEmail(const KABC::Addressee &addressee) bool AddressbookBase::sendEmail(const TDEABC::Addressee &addressee)
{ {
if(addressee.preferredEmail().isEmpty()) if(addressee.preferredEmail().isEmpty())
{ {
@ -430,7 +430,7 @@ namespace Konversation
{ {
NickInfoPtr nickInfo = (*it)->getNickInfo(); NickInfoPtr nickInfo = (*it)->getNickInfo();
Q_ASSERT(nickInfo); if(!nickInfo) return false; Q_ASSERT(nickInfo); if(!nickInfo) return false;
KABC::Addressee addr = nickInfo->getAddressee(); TDEABC::Addressee addr = nickInfo->getAddressee();
if(addr.isEmpty()) if(addr.isEmpty())
{ {
nicksWithoutAddressee.append(nickInfo->getNickname()); nicksWithoutAddressee.append(nickInfo->getNickname());

@ -37,36 +37,36 @@ namespace Konversation
public: public:
virtual ~AddressbookBase(); // This needs to be public so it can be deleted by our static pointer virtual ~AddressbookBase(); // This needs to be public so it can be deleted by our static pointer
KABC::Addressee getKABCAddresseeFromNick(const TQString &ircnick, const TQString &servername, const TQString &servergroup); TDEABC::Addressee getKABCAddresseeFromNick(const TQString &ircnick, const TQString &servername, const TQString &servergroup);
KABC::Addressee getKABCAddresseeFromNick(const TQString &nick_server); TDEABC::Addressee getKABCAddresseeFromNick(const TQString &nick_server);
bool hasNick(const KABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup); bool hasNick(const TDEABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup);
bool hasNick(const KABC::Addressee &addressee, const TQString &nick_server); bool hasNick(const TDEABC::Addressee &addressee, const TQString &nick_server);
/** For a given contact, remove the ircnick if they have it. If you /** For a given contact, remove the ircnick if they have it. If you
* pass an addressBook, the contact is inserted if it has changed. * pass an addressBook, the contact is inserted if it has changed.
*/ */
void unassociateNick(KABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup); void unassociateNick(TDEABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup);
void associateNick(KABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup); void associateNick(TDEABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup);
bool associateNickAndUnassociateFromEveryoneElse(KABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup); bool associateNickAndUnassociateFromEveryoneElse(TDEABC::Addressee &addressee, const TQString &ircnick, const TQString &servername, const TQString &servergroup);
/** If this user is online, return one of the nicks that they are /** If this user is online, return one of the nicks that they are
* using. Otherwise return the first nick listed. * using. Otherwise return the first nick listed.
* If there are multiple matches, it will prefer ones that are not set to away. * If there are multiple matches, it will prefer ones that are not set to away.
* @return online nick, first nick, or TQString() if they aren't known at all. * @return online nick, first nick, or TQString() if they aren't known at all.
*/ */
TQString getBestNick(const KABC::Addressee &addressee); TQString getBestNick(const TDEABC::Addressee &addressee);
bool hasAnyNicks(const KABC::Addressee &addresse); bool hasAnyNicks(const TDEABC::Addressee &addresse);
int presenceStatusByAddressee(const KABC::Addressee &addressee); int presenceStatusByAddressee(const TDEABC::Addressee &addressee);
bool isOnline(KABC::Addressee &addressee); bool isOnline(TDEABC::Addressee &addressee);
bool getAndCheckTicket(); bool getAndCheckTicket();
bool saveTicket(); bool saveTicket();
void releaseTicket(); void releaseTicket();
bool saveAddressee(KABC::Addressee &addressee); bool saveAddressee(TDEABC::Addressee &addressee);
bool saveAddressbook(); bool saveAddressbook();
TQStringList allContactsNicksForServer(const TQString &servername, const TQString &servergroup); TQStringList allContactsNicksForServer(const TQString &servername, const TQString &servergroup);
TQStringList getNicks(const KABC::Addressee &addressee, const TQString &servername, const TQString &servergroup); TQStringList getNicks(const TDEABC::Addressee &addressee, const TQString &servername, const TQString &servergroup);
KABC::AddressBook *getAddressBook(); TDEABC::AddressBook *getAddressBook();
/** Return an online NickInfo for this addressee. /** Return an online NickInfo for this addressee.
* If there are multiple matches, it tries to pick one that is not away. * If there are multiple matches, it tries to pick one that is not away.
@ -75,7 +75,7 @@ namespace Konversation
* @param addressee The addressee to get a nickInfo for * @param addressee The addressee to get a nickInfo for
* @return A nickInfo. It tries hard to return a nickInfo that is not away if one exists. * @return A nickInfo. It tries hard to return a nickInfo that is not away if one exists.
*/ */
static NickInfoPtr getNickInfo(const KABC::Addressee &addressee); static NickInfoPtr getNickInfo(const TDEABC::Addressee &addressee);
/** /**
* Lets outsiders tell us to emit presenceChanged signal. * Lets outsiders tell us to emit presenceChanged signal.
*/ */
@ -98,7 +98,7 @@ namespace Konversation
* to create a single email addressed to the addressee passed in. * to create a single email addressed to the addressee passed in.
* Gives an error dialog to the user if the addressee doesn't have an email address associated. * Gives an error dialog to the user if the addressee doesn't have an email address associated.
*/ */
bool sendEmail(const KABC::Addressee &addressee); bool sendEmail(const TDEABC::Addressee &addressee);
/** /**
* Run kaddressbook to edit the addressee passed in. * Run kaddressbook to edit the addressee passed in.
*/ */
@ -121,8 +121,8 @@ namespace Konversation
protected: protected:
AddressbookBase(); AddressbookBase();
KABC::AddressBook* addressBook; TDEABC::AddressBook* addressBook;
KABC::Ticket *m_ticket; TDEABC::Ticket *m_ticket;
}; };
} //NAMESPACE } //NAMESPACE

@ -27,12 +27,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <kdebug.h> #include <kdebug.h>
AddresseeItem::AddresseeItem( TQListView *parent, const KABC::Addressee &addressee) : AddresseeItem::AddresseeItem( TQListView *parent, const TDEABC::Addressee &addressee) :
TDEListViewItem( parent ), TDEListViewItem( parent ),
mAddressee( addressee ) mAddressee( addressee )
{ {
//We can't save showphoto because we don't have a d pointer //We can't save showphoto because we don't have a d pointer
KABC::Picture pic = mAddressee.photo(); TDEABC::Picture pic = mAddressee.photo();
if(!pic.isIntern()) if(!pic.isIntern())
pic = mAddressee.logo(); pic = mAddressee.logo();
if(pic.isIntern()) if(pic.isIntern())

@ -48,12 +48,12 @@ class AddresseeItem : public TDEListViewItem
@param parent The parent listview. @param parent The parent listview.
@param addressee The associated addressee. @param addressee The associated addressee.
*/ */
AddresseeItem( TQListView *parent, const KABC::Addressee &addressee ); AddresseeItem( TQListView *parent, const TDEABC::Addressee &addressee );
/** /**
Returns the addressee. Returns the addressee.
*/ */
KABC::Addressee addressee() const { return mAddressee; } TDEABC::Addressee addressee() const { return mAddressee; }
/** /**
Method used by TQListView to sort the items. Method used by TQListView to sort the items.
@ -61,6 +61,6 @@ class AddresseeItem : public TDEListViewItem
virtual TQString key( int column, bool ascending ) const; virtual TQString key( int column, bool ascending ) const;
private: private:
KABC::Addressee mAddressee; TDEABC::Addressee mAddressee;
}; };
#endif #endif

@ -104,7 +104,7 @@ void LinkAddressbookUI::slotLoadAddressees()
TQString realname; TQString realname;
int num_contacts_with_nick=0; //There shouldn't be more than 1 contact with this irc nick. Warn the user if there is. int num_contacts_with_nick=0; //There shouldn't be more than 1 contact with this irc nick. Warn the user if there is.
KABC::AddressBook::Iterator it; TDEABC::AddressBook::Iterator it;
for( it = m_addressBook->begin(); it != m_addressBook->end(); ++it ) for( it = m_addressBook->begin(); it != m_addressBook->end(); ++it )
if(Konversation::Addressbook::self()->hasNick(*it, m_lower_ircnick, m_servername, m_servergroup)) if(Konversation::Addressbook::self()->hasNick(*it, m_lower_ircnick, m_servername, m_servergroup))
{ {
@ -135,7 +135,7 @@ void LinkAddressbookUI::slotAddAddresseeClicked()
if ( !addresseeName.isEmpty() ) if ( !addresseeName.isEmpty() )
{ {
KABC::Addressee addr; TDEABC::Addressee addr;
addr.setNameFromString( addresseeName ); addr.setNameFromString( addresseeName );
m_addressBook->insertAddressee(addr); m_addressBook->insertAddressee(addr);
Konversation::Addressbook::self()->saveTicket(); Konversation::Addressbook::self()->saveTicket();
@ -159,7 +159,7 @@ void LinkAddressbookUI::slotOk()
AddresseeItem *item = 0L; AddresseeItem *item = 0L;
item = static_cast<AddresseeItem *>( m_mainWidget->addresseeListView->selectedItem() ); item = static_cast<AddresseeItem *>( m_mainWidget->addresseeListView->selectedItem() );
KABC::Addressee addr; TDEABC::Addressee addr;
if ( item ) if ( item )
{ {

@ -45,7 +45,7 @@ class LinkAddressbookUI : public KDialogBase
~LinkAddressbookUI(); ~LinkAddressbookUI();
private: private:
KABC::AddressBook* m_addressBook; TDEABC::AddressBook* m_addressBook;
TQString m_ircnick; TQString m_ircnick;
TQString m_lower_ircnick; //Same as above, but in lower case, for comparisons. TQString m_lower_ircnick; //Same as above, but in lower case, for comparisons.
TQString m_servername; TQString m_servername;

@ -103,7 +103,7 @@ void Nick::refresh()
setPixmap( 0, icon ); setPixmap( 0, icon );
KABC::Picture pic = nickInfo->getAddressee().photo(); TDEABC::Picture pic = nickInfo->getAddressee().photo();
if(!pic.isIntern()) if(!pic.isIntern())
{ {
@ -136,7 +136,7 @@ void Nick::refresh()
TQString Nick::calculateLabel1() TQString Nick::calculateLabel1()
{ {
NickInfoPtr nickinfo = getChannelNick()->getNickInfo(); NickInfoPtr nickinfo = getChannelNick()->getNickInfo();
KABC::Addressee addressee = nickinfo->getAddressee(); TDEABC::Addressee addressee = nickinfo->getAddressee();
if(!addressee.realName().isEmpty()) //if no addressee, realName will be empty if(!addressee.realName().isEmpty()) //if no addressee, realName will be empty
{ {

@ -118,7 +118,7 @@ void NickInfo::setNickname(const TQString& newNickname)
Q_ASSERT(!newNickname.isEmpty()); Q_ASSERT(!newNickname.isEmpty());
if(newNickname == m_nickname) return; if(newNickname == m_nickname) return;
KABC::Addressee newaddressee = Konversation::Addressbook::self()->getKABCAddresseeFromNick(newNickname, m_owningServer->getServerName(), m_owningServer->getDisplayName()); TDEABC::Addressee newaddressee = Konversation::Addressbook::self()->getKABCAddresseeFromNick(newNickname, m_owningServer->getServerName(), m_owningServer->getDisplayName());
//We now know who this person is //We now know who this person is
if(m_addressee.isEmpty() && !newaddressee.isEmpty()) if(m_addressee.isEmpty() && !newaddressee.isEmpty())
{ {
@ -237,12 +237,12 @@ void NickInfo::setOnlineSince(const TQDateTime& datetime)
startNickInfoChangedTimer(); startNickInfoChangedTimer();
} }
KABC::Addressee NickInfo::getAddressee() const { return m_addressee;} TDEABC::Addressee NickInfo::getAddressee() const { return m_addressee;}
void NickInfo::refreshAddressee() void NickInfo::refreshAddressee()
{ {
//m_addressee might not have changed, but information inside it may have. //m_addressee might not have changed, but information inside it may have.
KABC::Addressee addressee=Konversation::Addressbook::self()->getKABCAddresseeFromNick(m_nickname, m_owningServer->getServerName(), m_owningServer->getDisplayName()); TDEABC::Addressee addressee=Konversation::Addressbook::self()->getKABCAddresseeFromNick(m_nickname, m_owningServer->getServerName(), m_owningServer->getDisplayName());
if(!addressee.isEmpty() && addressee.uid() != m_addressee.uid()) if(!addressee.isEmpty() && addressee.uid() != m_addressee.uid())
{ {
//This nick now belongs to a different addressee. We need to update the status for both the old and new addressees. //This nick now belongs to a different addressee. We need to update the status for both the old and new addressees.
@ -295,8 +295,8 @@ void NickInfo::tooltipTableData(TQTextStream &tooltip) const
tooltip << "<tr><td colspan=\"2\" valign=\"top\">"; tooltip << "<tr><td colspan=\"2\" valign=\"top\">";
bool dirty = false; bool dirty = false;
KABC::Picture photo = m_addressee.photo(); TDEABC::Picture photo = m_addressee.photo();
KABC::Picture logo = m_addressee.logo(); TDEABC::Picture logo = m_addressee.logo();
bool isimage=false; bool isimage=false;
if(photo.isIntern()) if(photo.isIntern())
{ {
@ -375,8 +375,8 @@ void NickInfo::tooltipTableData(TQTextStream &tooltip) const
tooltip << "<tr><td><b>" << m_addressee.roleLabel() << ": </b></td><td>" << m_addressee.role() << "</td></tr>"; tooltip << "<tr><td><b>" << m_addressee.roleLabel() << ": </b></td><td>" << m_addressee.role() << "</td></tr>";
dirty=true; dirty=true;
} }
KABC::PhoneNumber::List numbers = m_addressee.phoneNumbers(); TDEABC::PhoneNumber::List numbers = m_addressee.phoneNumbers();
for( KABC::PhoneNumber::List::ConstIterator it = numbers.begin(); it != numbers.end(); ++it) for( TDEABC::PhoneNumber::List::ConstIterator it = numbers.begin(); it != numbers.end(); ++it)
{ {
tooltip << "<tr><td><b>" << (*it).label() << ": </b></td><td>" << (*it).number() << "</td></tr>"; tooltip << "<tr><td><b>" << (*it).label() << ": </b></td><td>" << (*it).number() << "</td></tr>";
dirty=true; dirty=true;

@ -73,7 +73,7 @@ class NickInfo : public TQObject, public TDEShared
Server* getServer() const; Server* getServer() const;
/// Return the kabc (kaddressbook) contact for this nick /// Return the kabc (kaddressbook) contact for this nick
KABC::Addressee getAddressee() const; TDEABC::Addressee getAddressee() const;
/** Set properties of NickInfo object. */ /** Set properties of NickInfo object. */
void setNickname(const TQString& newNickname); void setNickname(const TQString& newNickname);
@ -152,7 +152,7 @@ class NickInfo : public TQObject, public TDEShared
TQString m_netServer; TQString m_netServer;
TQString m_netServerInfo; TQString m_netServerInfo;
TQDateTime m_onlineSince; TQDateTime m_onlineSince;
KABC::Addressee m_addressee; TDEABC::Addressee m_addressee;
/** Whether this user is identified with nickserv. /** Whether this user is identified with nickserv.
* Found only by doing /whois nick * Found only by doing /whois nick
*/ */

@ -261,7 +261,7 @@ void NickListView::insertAssociationSubMenu()
ChannelNickList nickList=channel->getSelectedChannelNicks(); ChannelNickList nickList=channel->getSelectedChannelNicks();
for(ChannelNickList::ConstIterator it=nickList.begin();it!=nickList.end();++it) for(ChannelNickList::ConstIterator it=nickList.begin();it!=nickList.end();++it)
{ {
KABC::Addressee addr = (*it)->getNickInfo()->getAddressee(); TDEABC::Addressee addr = (*it)->getNickInfo()->getAddressee();
if(addr.isEmpty()) if(addr.isEmpty())
{ {
noAssociation=true; noAssociation=true;

@ -223,7 +223,7 @@ TQListViewItem* NicksOnline::findNetworkRoot(const TQString& name)
* @return needWhois True if a WHOIS needs to be performed on the nick * @return needWhois True if a WHOIS needs to be performed on the nick
* to get additional information. * to get additional information.
*/ */
TQString NicksOnline::getNickAdditionalInfo(NickInfoPtr nickInfo, KABC::Addressee addressee, TQString NicksOnline::getNickAdditionalInfo(NickInfoPtr nickInfo, TDEABC::Addressee addressee,
bool& needWhois) bool& needWhois)
{ {
TQString info; TQString info;
@ -310,7 +310,7 @@ void NicksOnline::updateServerOnlineList(Server* servr)
// Which server did NickInfo come from? // Which server did NickInfo come from?
Server* server=nickInfo->getServer(); Server* server=nickInfo->getServer();
// Get addressbook entry (if any) for the nick. // Get addressbook entry (if any) for the nick.
KABC::Addressee addressee = nickInfo->getAddressee(); TDEABC::Addressee addressee = nickInfo->getAddressee();
// Construct additional information string for nick. // Construct additional information string for nick.
bool needWhois = false; bool needWhois = false;
TQString nickAdditionalInfo = getNickAdditionalInfo(nickInfo, addressee, needWhois); TQString nickAdditionalInfo = getNickAdditionalInfo(nickInfo, addressee, needWhois);
@ -398,7 +398,7 @@ void NicksOnline::updateServerOnlineList(Server* servr)
if (!nickRoot) nickRoot = new NicksOnlineItem(NicksOnlineItem::NicknameItem,offlineRoot, nickname); if (!nickRoot) nickRoot = new NicksOnlineItem(NicksOnlineItem::NicknameItem,offlineRoot, nickname);
nickRoot->setText(nlvcServerName, serverName); nickRoot->setText(nlvcServerName, serverName);
// Get addressbook entry for the nick. // Get addressbook entry for the nick.
KABC::Addressee addressee = servr->getOfflineNickAddressee(nickname); TDEABC::Addressee addressee = servr->getOfflineNickAddressee(nickname);
// Format additional information for the nick. // Format additional information for the nick.
bool needWhois = false; bool needWhois = false;
TQString nickAdditionalInfo = getNickAdditionalInfo(0, addressee, needWhois); TQString nickAdditionalInfo = getNickAdditionalInfo(0, addressee, needWhois);
@ -664,7 +664,7 @@ void NicksOnline::doCommand(int id)
// Get NickInfo object corresponding to the nickname. // Get NickInfo object corresponding to the nickname.
NickInfoPtr nickInfo = server->getNickInfo(nickname); NickInfoPtr nickInfo = server->getNickInfo(nickname);
// Get addressbook entry for the nick. // Get addressbook entry for the nick.
KABC::Addressee addressee; TDEABC::Addressee addressee;
if(nickInfo) if(nickInfo)
{ {
@ -935,7 +935,7 @@ void NicksOnline::refreshItem(TQListViewItem* item)
if (server) if (server)
{ {
NickInfoPtr nickInfo = server->getNickInfo(nickname); NickInfoPtr nickInfo = server->getNickInfo(nickname);
KABC::Addressee addressee; TDEABC::Addressee addressee;
if (nickInfo) if (nickInfo)
addressee = nickInfo->getAddressee(); addressee = nickInfo->getAddressee();
else else

@ -172,7 +172,7 @@ class NicksOnline : public ChatWindow
* @return needWhois True if a WHOIS needs to be performed on the nick * @return needWhois True if a WHOIS needs to be performed on the nick
* to get additional information. * to get additional information.
*/ */
TQString getNickAdditionalInfo(NickInfoPtr nickInfo, KABC::Addressee addressee, TQString getNickAdditionalInfo(NickInfoPtr nickInfo, TDEABC::Addressee addressee,
bool& needWhois); bool& needWhois);
/** /**
* Invokes the KAddressBook contact editor for the specified contact id. * Invokes the KAddressBook contact editor for the specified contact id.

@ -490,7 +490,7 @@ void Query::nickInfoChanged()
text += " (" + KStringHandler::rsqueeze(m_nickInfo->getAwayMessage(),100) + ") "; text += " (" + KStringHandler::rsqueeze(m_nickInfo->getAwayMessage(),100) + ") ";
queryHostmask->setText(Konversation::removeIrcMarkup(text)); queryHostmask->setText(Konversation::removeIrcMarkup(text));
KABC::Picture pic = m_nickInfo->getAddressee().photo(); TDEABC::Picture pic = m_nickInfo->getAddressee().photo();
if(pic.isIntern()) if(pic.isIntern())
{ {
TQPixmap qpixmap(pic.data().scaleHeight(queryHostmask->height())); TQPixmap qpixmap(pic.data().scaleHeight(queryHostmask->height()));
@ -508,7 +508,7 @@ void Query::nickInfoChanged()
{ {
addresseeimage->hide(); addresseeimage->hide();
} }
KABC::Picture logo = m_nickInfo->getAddressee().logo(); TDEABC::Picture logo = m_nickInfo->getAddressee().logo();
if(logo.isIntern()) if(logo.isIntern())
{ {
TQPixmap qpixmap(logo.data().scaleHeight(queryHostmask->height())); TQPixmap qpixmap(logo.data().scaleHeight(queryHostmask->height()));

@ -2295,7 +2295,7 @@ NickInfoPtr Server::setWatchedNickOnline(const TQString& nickname)
} }
emit watchedNickChanged(this, nickname, true); emit watchedNickChanged(this, nickname, true);
KABC::Addressee addressee = nickInfo->getAddressee(); TDEABC::Addressee addressee = nickInfo->getAddressee();
if (!addressee.isEmpty()) Konversation::Addressbook::self()->emitContactPresenceChanged(addressee.uid()); if (!addressee.isEmpty()) Konversation::Addressbook::self()->emitContactPresenceChanged(addressee.uid());
appendMessageToFrontmost(i18n("Notify"),"<a href=\"#"+nickname+"\">"+ appendMessageToFrontmost(i18n("Notify"),"<a href=\"#"+nickname+"\">"+
@ -2310,7 +2310,7 @@ NickInfoPtr Server::setWatchedNickOnline(const TQString& nickname)
void Server::setWatchedNickOffline(const TQString& nickname, const NickInfoPtr nickInfo) void Server::setWatchedNickOffline(const TQString& nickname, const NickInfoPtr nickInfo)
{ {
if (nickInfo) { if (nickInfo) {
KABC::Addressee addressee = nickInfo->getAddressee(); TDEABC::Addressee addressee = nickInfo->getAddressee();
if (!addressee.isEmpty()) Konversation::Addressbook::self()->emitContactPresenceChanged(addressee.uid(), 1); if (!addressee.isEmpty()) Konversation::Addressbook::self()->emitContactPresenceChanged(addressee.uid(), 1);
} }
@ -3257,12 +3257,12 @@ void Server::startAwayTimer()
m_awayTime = TQDateTime::currentDateTime().toTime_t(); m_awayTime = TQDateTime::currentDateTime().toTime_t();
} }
KABC::Addressee Server::getOfflineNickAddressee(TQString& nickname) TDEABC::Addressee Server::getOfflineNickAddressee(TQString& nickname)
{ {
if (m_serverISON) if (m_serverISON)
return m_serverISON->getOfflineNickAddressee(nickname); return m_serverISON->getOfflineNickAddressee(nickname);
else else
return KABC::Addressee(); return TDEABC::Addressee();
} }
void Server::enableIdentifyMsg(bool enabled) void Server::enableIdentifyMsg(bool enabled)

@ -282,7 +282,7 @@ void resetNickSelection();
* @param nickname Desired nickname. Case insensitive. * @param nickname Desired nickname. Case insensitive.
* @return Addressbook entry of the nick or empty if not found. * @return Addressbook entry of the nick or empty if not found.
*/ */
KABC::Addressee getOfflineNickAddressee(TQString& nickname); TDEABC::Addressee getOfflineNickAddressee(TQString& nickname);
/** /**
* Returns a TQPtrList of all channels * Returns a TQPtrList of all channels

@ -73,7 +73,7 @@ TQStringList ServerISON::getAddressees()
return m_addresseesISON; return m_addresseesISON;
} }
KABC::Addressee ServerISON::getOfflineNickAddressee(TQString& nickname) TDEABC::Addressee ServerISON::getOfflineNickAddressee(TQString& nickname)
{ {
TQString lcNickname = nickname.lower(); TQString lcNickname = nickname.lower();
if(m_ISONList_invalid) if(m_ISONList_invalid)
@ -81,7 +81,7 @@ KABC::Addressee ServerISON::getOfflineNickAddressee(TQString& nickname)
if (m_offlineNickToAddresseeMap.contains(lcNickname)) if (m_offlineNickToAddresseeMap.contains(lcNickname))
return m_offlineNickToAddresseeMap[lcNickname]; return m_offlineNickToAddresseeMap[lcNickname];
else else
return KABC::Addressee(); return TDEABC::Addressee();
} }
void ServerISON::recalculateAddressees() void ServerISON::recalculateAddressees()
@ -92,7 +92,7 @@ void ServerISON::recalculateAddressees()
// Get all nicks known to be online. // Get all nicks known to be online.
const NickInfoMap* allNicks = m_server->getAllNicks(); const NickInfoMap* allNicks = m_server->getAllNicks();
// Build a map of online nicknames with associated addressbook entry, // Build a map of online nicknames with associated addressbook entry,
// indexed by KABC::Addressee uid. // indexed by TDEABC::Addressee uid.
// Note that there can be more than one nick associated with an addressee. // Note that there can be more than one nick associated with an addressee.
TQMap<TQString,TQStringList> addresseeToOnlineNickMap; TQMap<TQString,TQStringList> addresseeToOnlineNickMap;
NickInfoMap::ConstIterator nickInfoItEnd = allNicks->constEnd(); NickInfoMap::ConstIterator nickInfoItEnd = allNicks->constEnd();
@ -100,7 +100,7 @@ void ServerISON::recalculateAddressees()
nickInfoIt != nickInfoItEnd; ++nickInfoIt) nickInfoIt != nickInfoItEnd; ++nickInfoIt)
{ {
NickInfoPtr nickInfo = nickInfoIt.data(); NickInfoPtr nickInfo = nickInfoIt.data();
KABC::Addressee addressee = nickInfo->getAddressee(); TDEABC::Addressee addressee = nickInfo->getAddressee();
if (!addressee.isEmpty()) if (!addressee.isEmpty())
{ {
TQString uid = addressee.uid(); TQString uid = addressee.uid();
@ -117,7 +117,7 @@ void ServerISON::recalculateAddressees()
// Build notify list from nicks in addressbook, eliminating dups (case insensitive). // Build notify list from nicks in addressbook, eliminating dups (case insensitive).
TQMap<TQString,TQString> ISONMap; TQMap<TQString,TQString> ISONMap;
m_offlineNickToAddresseeMap.clear(); m_offlineNickToAddresseeMap.clear();
for( KABC::AddressBook::ConstIterator it = for( TDEABC::AddressBook::ConstIterator it =
Konversation::Addressbook::self()->getAddressBook()->begin(); Konversation::Addressbook::self()->getAddressBook()->begin();
it != Konversation::Addressbook::self()->getAddressBook()->end(); ++it ) it != Konversation::Addressbook::self()->getAddressBook()->end(); ++it )
{ {
@ -143,7 +143,7 @@ void ServerISON::recalculateAddressees()
// of the addressee associated with this server or server group (if any) // of the addressee associated with this server or server group (if any)
// to the notify list. // to the notify list.
// Simultaneously, build a map of all offline nicks and corresponding // Simultaneously, build a map of all offline nicks and corresponding
// KABC::Addressee, indexed by lowercase nickname. // TDEABC::Addressee, indexed by lowercase nickname.
TQStringList nicks = TQStringList::split( TQChar( 0xE000 ), TQStringList nicks = TQStringList::split( TQChar( 0xE000 ),
(*it).custom("messaging/irc", "All") ); (*it).custom("messaging/irc", "All") );
TQStringList::ConstIterator nicksItEnd = nicks.constEnd(); TQStringList::ConstIterator nicksItEnd = nicks.constEnd();

@ -28,7 +28,7 @@
class Server; class Server;
typedef TQMap<TQString,KABC::Addressee> OfflineNickToAddresseeMap; typedef TQMap<TQString,TDEABC::Addressee> OfflineNickToAddresseeMap;
class ServerISON : public TQObject class ServerISON : public TQObject
{ {
@ -77,7 +77,7 @@ class ServerISON : public TQObject
* @param nickname Desired nickname. Case insensitive. * @param nickname Desired nickname. Case insensitive.
* @return Addressbook entry of the nick or empty if not found. * @return Addressbook entry of the nick or empty if not found.
*/ */
KABC::Addressee getOfflineNickAddressee(TQString& nickname); TDEABC::Addressee getOfflineNickAddressee(TQString& nickname);
private slots: private slots:
void addressbookChanged(); void addressbookChanged();

Loading…
Cancel
Save