summaryrefslogtreecommitdiffstats
path: root/kaddressbook/kabcore.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kaddressbook/kabcore.cpp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kaddressbook/kabcore.cpp')
-rw-r--r--kaddressbook/kabcore.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 66b0bb81..14f9577a 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
- with any edition of Qt, and distribute the resulting executable,
- without including the source code for Qt in the source distribution.
+ with any edition of TQt, and distribute the resulting executable,
+ without including the source code for TQt in the source distribution.
*/
// Needed for ugly hack, to be removed in 4.0
@@ -92,16 +92,16 @@
#include "kabcore.h"
-KABCore::KABCore( KXMLGUIClient *client, bool readWrite, TQWidget *parent,
+KABCore::KABCore( KXMLGUIClient *client, bool readWrite, TQWidget *tqparent,
const TQString &file, const char *name )
- : KAB::Core( client, parent, name ), mStatusBar( 0 ), mViewManager( 0 ),
+ : KAB::Core( client, tqparent, name ), mStatusBar( 0 ), mViewManager( 0 ),
mExtensionManager( 0 ), mJumpButtonBar( 0 ), mCategorySelectDialog( 0 ),
mCategoryEditDialog( 0 ), mLdapSearchDialog( 0 ), mReadWrite( readWrite ),
mModified( false )
{
- mWidget = new TQWidget( parent, name );
+ mWidget = new TQWidget( tqparent, name );
- mIsPart = !parent->isA( "KAddressBookMain" );
+ mIsPart = !tqparent->isA( "KAddressBookMain" );
mAddressBookChangedTimer = new TQTimer( this );
connect( mAddressBookChangedTimer, TQT_SIGNAL( timeout() ),
@@ -114,7 +114,7 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, TQWidget *parent,
mAddressBook = new KABC::AddressBook;
mAddressBook->addResource( new KABC::ResourceFile( file ) );
if ( !mAddressBook->load() ) {
- KMessageBox::error( parent, i18n("Unable to load '%1'.").arg( file ) );
+ KMessageBox::error( tqparent, i18n("Unable to load '%1'.").arg( file ) );
}
}
mAddressBook->setErrorHandler( new KABC::GuiErrorHandler( mWidget ) );
@@ -140,7 +140,7 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, TQWidget *parent,
mAddressBook->addCustomField( i18n( "Blog" ), KABC::Field::Personal,
"BlogFeed", "KADDRESSBOOK" );
- mSearchManager = new KAB::SearchManager( mAddressBook, parent );
+ mSearchManager = new KAB::SearchManager( mAddressBook, tqparent );
connect( mSearchManager, TQT_SIGNAL( contactsUpdated() ),
this, TQT_SLOT( slotContactsUpdated() ) );
@@ -270,7 +270,7 @@ TQStringList KABCore::selectedUIDs() const
return mViewManager->selectedUids();
}
-KABC::Resource *KABCore::requestResource( TQWidget *parent )
+KABC::Resource *KABCore::requestResource( TQWidget *tqparent )
{
TQPtrList<KABC::Resource> kabcResources = addressBook()->resources();
@@ -301,7 +301,7 @@ KABC::Resource *KABCore::requestResource( TQWidget *parent )
}
}
- KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent );
+ KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, tqparent );
return static_cast<KABC::Resource*>( res ); // upcast
}
@@ -351,7 +351,7 @@ void KABCore::setContactSelected( const TQString &uid )
return;
}
- KABC::Addressee addr = mAddressBook->tqfindByUid( uid );
+ KABC::Addressee addr = mAddressBook->findByUid( uid );
if ( !mDetailsViewer->isHidden() )
mDetailsViewer->setAddressee( addr );
#ifdef KDEPIM_NEW_DISTRLISTS
@@ -430,9 +430,9 @@ void KABCore::setContactSelected( const TQString &uid )
mActionMerge->setEnabled( ( list.size() == 2 ) && writable );
if ( mReadWrite ) {
- QClipboard *cb = TQApplication::clipboard();
+ TQClipboard *cb = TQApplication::clipboard();
#if defined(KABC_VCARD_ENCODING_FIX)
- const TQMimeSource *data = cb->data( QClipboard::Clipboard );
+ const TQMimeSource *data = cb->data( TQClipboard::Clipboard );
list = AddresseeUtil::clipboardToAddressees( data->tqencodedData( "text/x-vcard" ) );
#else
list = AddresseeUtil::clipboardToAddressees( cb->text() );
@@ -482,7 +482,7 @@ void KABCore::browse( const TQString& url )
void KABCore::selectAllContacts()
{
- mViewManager->setSelected( TQString::null, true );
+ mViewManager->setSelected( TQString(), true );
}
void KABCore::deleteContacts()
@@ -498,7 +498,7 @@ void KABCore::deleteDistributionLists( const TQStringList & names )
return;
if ( KMessageBox::warningContinueCancelList( mWidget, i18n( "Do you really want to delete this distribution list?",
"Do you really want to delete these %n distribution lists?", names.count() ),
- names, TQString::null, KStdGuiItem::del() ) == KMessageBox::Cancel )
+ names, TQString(), KStdGuiItem::del() ) == KMessageBox::Cancel )
return;
TQStringList uids;
@@ -517,7 +517,7 @@ void KABCore::deleteContacts( const TQStringList &uids )
TQStringList::ConstIterator it = uids.begin();
const TQStringList::ConstIterator endIt( uids.end() );
while ( it != endIt ) {
- KABC::Addressee addr = mAddressBook->tqfindByUid( *it );
+ KABC::Addressee addr = mAddressBook->findByUid( *it );
names.append( addr.realName().isEmpty() ? addr.preferredEmail() : addr.realName() );
++it;
}
@@ -533,7 +533,7 @@ void KABCore::deleteContacts( const TQStringList &uids )
"<b>Note:</b>The contacts will be also removed from all distribution lists."
"</qt>",
uids.count() ),
- names, TQString::null, KStdGuiItem::del() ) == KMessageBox::Cancel ) {
+ names, TQString(), KStdGuiItem::del() ) == KMessageBox::Cancel ) {
return;
}
@@ -541,7 +541,7 @@ void KABCore::deleteContacts( const TQStringList &uids )
mCommandHistory->addCommand( command );
// now if we deleted anything, refresh
- setContactSelected( TQString::null );
+ setContactSelected( TQString() );
setModified( true );
}
}
@@ -552,11 +552,11 @@ void KABCore::copyContacts()
#if defined(KABC_VCARD_ENCODING_FIX)
TQByteArray clipText = AddresseeUtil::addresseesToClipboard( addrList );
- QClipboard *cb = TQApplication::clipboard();
+ TQClipboard *cb = TQApplication::clipboard();
cb->setText( TQString::fromUtf8( clipText.data() ) );
#else
TQString clipText = AddresseeUtil::addresseesToClipboard( addrList );
- QClipboard *cb = TQApplication::clipboard();
+ TQClipboard *cb = TQApplication::clipboard();
cb->setText( clipText );
#endif
}
@@ -575,9 +575,9 @@ void KABCore::cutContacts()
void KABCore::pasteContacts()
{
- QClipboard *cb = TQApplication::clipboard();
+ TQClipboard *cb = TQApplication::clipboard();
#if defined(KABC_VCARD_ENCODING_FIX)
- const TQMimeSource *data = cb->data( QClipboard::Clipboard );
+ const TQMimeSource *data = cb->data( TQClipboard::Clipboard );
KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( data->tqencodedData( "text/x-vcard" ) );
#else
KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() );
@@ -640,19 +640,19 @@ void KABCore::setWhoAmI()
}
TQString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) );
- if ( KMessageBox::questionYesNo( mWidget, text.arg( addrList[ 0 ].assembledName() ), TQString::null, i18n("Use"), i18n("Do Not Use") ) == KMessageBox::Yes )
+ if ( KMessageBox::questionYesNo( mWidget, text.arg( addrList[ 0 ].assembledName() ), TQString(), i18n("Use"), i18n("Do Not Use") ) == KMessageBox::Yes )
static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self( true ) )->setWhoAmI( addrList[ 0 ] );
}
void KABCore::incrementalTextSearch( const TQString& text )
{
- setContactSelected( TQString::null );
+ setContactSelected( TQString() );
mSearchManager->search( text, mIncSearchWidget->currentFields() );
}
void KABCore::incrementalJumpButtonSearch( const TQString& character )
{
- mViewManager->setSelected( TQString::null, false );
+ mViewManager->setSelected( TQString(), false );
KABC::AddresseeList list = mSearchManager->contacts();
KABC::Field *field = mViewManager->currentSortField();
@@ -692,7 +692,7 @@ void KABCore::contactModified( const KABC::Addressee &addr )
Command *command = 0;
// check if it exists already
- KABC::Addressee origAddr = mAddressBook->tqfindByUid( addr.uid() );
+ KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() );
if ( origAddr.isEmpty() ) {
KABC::Addressee::List addressees;
addressees.append( addr );
@@ -829,9 +829,9 @@ void KABCore::editContact( const TQString &uid )
}
#endif
- KABC::Addressee addr = mAddressBook->tqfindByUid( localUID );
+ KABC::Addressee addr = mAddressBook->findByUid( localUID );
if ( !addr.isEmpty() ) {
- AddresseeEditorDialog *dialog = mEditorDict.find( addr.uid() );
+ AddresseeEditorDialog *dialog = mEditorDict.tqfind( addr.uid() );
if ( !dialog ) {
if ( !addr.resource()->readOnly() )
@@ -950,7 +950,7 @@ void KABCore::extensionModified( const KABC::Addressee::List &list )
Command *command = 0;
// check if it exists already
- KABC::Addressee origAddr = mAddressBook->tqfindByUid( (*it).uid() );
+ KABC::Addressee origAddr = mAddressBook->findByUid( (*it).uid() );
if ( origAddr.isEmpty() ) {
KABC::Addressee::List addressees;
addressees.append( *it );
@@ -973,7 +973,7 @@ void KABCore::extensionDeleted( const TQStringList &uidList )
mCommandHistory->addCommand( command );
// now if we deleted anything, refresh
- setContactSelected( TQString::null );
+ setContactSelected( TQString() );
setModified( true );
}
@@ -1084,7 +1084,7 @@ void KABCore::showContactsAddress( const TQString &addrUid )
if ( uidList.isEmpty() )
return;
- KABC::Addressee addr = mAddressBook->tqfindByUid( uidList.first() );
+ KABC::Addressee addr = mAddressBook->findByUid( uidList.first() );
if ( addr.isEmpty() )
return;
@@ -1139,9 +1139,9 @@ void KABCore::addressBookChanged()
mSearchManager->reload();
- mViewManager->setSelected( TQString::null, false );
+ mViewManager->setSelected( TQString(), false );
- TQString uid = TQString::null;
+ TQString uid = TQString();
if ( !selectedUids.isEmpty() ) {
uid = selectedUids.first();
mViewManager->setSelected( uid, true );
@@ -1152,10 +1152,10 @@ void KABCore::addressBookChanged()
updateCategories();
}
-AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( TQWidget *parent,
+AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( TQWidget *tqparent,
const char *name )
{
- AddresseeEditorDialog *dialog = new AddresseeEditorDialog( this, parent,
+ AddresseeEditorDialog *dialog = new AddresseeEditorDialog( this, tqparent,
name ? name : "editorDialog" );
connect( dialog, TQT_SIGNAL( contactModified( const KABC::Addressee& ) ),
TQT_SLOT( contactModified( const KABC::Addressee& ) ) );
@@ -1186,7 +1186,7 @@ void KABCore::slotEditorDestroyed( const TQString &uid )
KABC::Addressee addr = dialog->addressee();
if ( !addr.resource()->readOnly() ) {
- TQApplication::setOverrideCursor( Qt::waitCursor );
+ TQApplication::setOverrideCursor( TQt::waitCursor );
KABLock::self( mAddressBook )->unlock( addr.resource() );
TQApplication::restoreOverrideCursor();
}
@@ -1205,7 +1205,7 @@ void KABCore::initGUI()
mDetailsSplitter = new TQSplitter( mWidget );
mLeftSplitter = new TQSplitter( mDetailsSplitter );
- mLeftSplitter->setOrientation( KABPrefs::instance()->contactListAboveExtensions() ? Qt::Vertical : Qt::Horizontal );
+ mLeftSplitter->setOrientation( KABPrefs::instance()->contactListAboveExtensions() ? TQt::Vertical : TQt::Horizontal );
topLayout->addWidget( searchTB );
topLayout->addWidget( mDetailsSplitter );
@@ -1406,7 +1406,7 @@ void KABCore::initActions()
action->setWhatsThis( i18n( "You will be presented with a dialog, that offers you all possibilities to configure KAddressBook." ) );
// misc
- action = new KAction( i18n( "&Lookup Addresses in LDAP Directory..." ), "find", 0,
+ action = new KAction( i18n( "&Lookup Addresses in LDAP Directory..." ), "tqfind", 0,
this, TQT_SLOT( openLDAPDialog() ), actionCollection(), "ldap_lookup" );
action->setWhatsThis( i18n( "Search for contacts on a LDAP server<p>You will be presented with a dialog, where you can search for contacts and select the ones you want to add to your local address book." ) );
@@ -1449,7 +1449,7 @@ void KABCore::updateCategories()
TQStringList::ConstIterator it;
const TQStringList::ConstIterator endIt( customCategories.end() );
for ( it = customCategories.begin(); it != endIt; ++it ) {
- if ( categories.find( *it ) == categories.end() ) {
+ if ( categories.tqfind( *it ) == categories.end() ) {
categories.append( *it );
}
}
@@ -1503,14 +1503,14 @@ void KABCore::categoriesSelected( const TQStringList &categories )
{
bool merge = false;
TQString msg = i18n( "Merge with existing categories?" );
- if ( KMessageBox::questionYesNo( mWidget, msg, TQString::null, i18n( "Merge" ), i18n( "Do Not Merge" ) ) == KMessageBox::Yes )
+ if ( KMessageBox::questionYesNo( mWidget, msg, TQString(), i18n( "Merge" ), i18n( "Do Not Merge" ) ) == KMessageBox::Yes )
merge = true;
TQStringList uids = mViewManager->selectedUids();
TQStringList::ConstIterator it;
const TQStringList::ConstIterator endIt( uids.end() );
for ( it = uids.begin(); it != endIt; ++it ) {
- KABC::Addressee addr = mAddressBook->tqfindByUid( *it );
+ KABC::Addressee addr = mAddressBook->findByUid( *it );
if ( !addr.isEmpty() ) {
if ( !merge )
addr.setCategories( categories );
@@ -1617,7 +1617,7 @@ void KABCore::removeSelectedContactsFromDistList()
TQStringList::ConstIterator it = uids.begin();
const TQStringList::ConstIterator endIt( uids.end() );
while ( it != endIt ) {
- KABC::Addressee addr = mAddressBook->tqfindByUid( *it );
+ KABC::Addressee addr = mAddressBook->findByUid( *it );
names.append( addr.realName().isEmpty() ? addr.preferredEmail() : addr.realName() );
++it;
}
@@ -1635,7 +1635,7 @@ void KABCore::removeSelectedContactsFromDistList()
"any other distribution list."
"</qt>",
uids.count() ).arg( mSelectedDistributionList ),
- names, TQString::null, KStdGuiItem::del() ) == KMessageBox::Cancel ) {
+ names, TQString(), KStdGuiItem::del() ) == KMessageBox::Cancel ) {
return;
}