Commit 0ca77a3b authored by Bartosz Brachaczek's avatar Bartosz Brachaczek

Simplify almost all disconnect() calls

It means less code and lesser error probability. See
TalkableProxyModel::removeFilter() for example - there was a typo
in the second disconnect().
Signed-off-by: 's avatarBartosz Brachaczek <b.brachaczek@gmail.com>
parent 0043b2d6
......@@ -120,10 +120,7 @@ void AccountManager::itemAboutToBeUnregisterd(Account item)
QMutexLocker locker(&mutex());
AccountsAwareObject::notifyAccountUnregistered(item);
disconnect(item.protocolHandler(), SIGNAL(connectionError(Account, const QString &, const QString &)),
this, SLOT(connectionError(Account, const QString &, const QString &)));
disconnect(item.protocolHandler(), SIGNAL(invalidPassword(Account)),
this, SLOT(providePassword(Account)));
disconnect(item.protocolHandler(), 0, this, 0);
emit accountAboutToBeUnregistered(item);
}
......@@ -132,7 +129,7 @@ void AccountManager::itemUnregistered(Account item)
{
QMutexLocker locker(&mutex());
disconnect(item, SIGNAL(updated()), this, SLOT(accountDataUpdated()));
disconnect(item, 0, this, 0);
emit accountUnregistered(item);
}
......
......@@ -295,10 +295,7 @@ void AccountShared::protocolUnregistered(ProtocolFactory* factory)
return;
disconnect(ProtocolHandler, SIGNAL(statusChanged(Account, Status)), MyStatusContainer, SLOT(triggerStatusUpdated()));
disconnect(ProtocolHandler, SIGNAL(contactStatusChanged(Contact, Status)),
this, SIGNAL(buddyStatusChanged(Contact, Status)));
disconnect(ProtocolHandler, SIGNAL(connected(Account)), this, SIGNAL(connected()));
disconnect(ProtocolHandler, SIGNAL(disconnected(Account)), this, SIGNAL(disconnected()));
disconnect(ProtocolHandler, 0, this, 0);
setDisconnectStatus();
......
......@@ -48,16 +48,7 @@ AccountsModel::AccountsModel(QObject *parent) :
AccountsModel::~AccountsModel()
{
disconnect(AccountManager::instance(), SIGNAL(accountUpdated(Account)),
this, SLOT(accountUpdated(Account)));
disconnect(AccountManager::instance(), SIGNAL(accountAboutToBeRegistered(Account)),
this, SLOT(accountAboutToBeRegistered(Account)));
disconnect(AccountManager::instance(), SIGNAL(accountRegistered(Account)),
this, SLOT(accountRegistered(Account)));
disconnect(AccountManager::instance(), SIGNAL(accountAboutToBeUnregistered(Account)),
this, SLOT(accountAboutToBeUnregistered(Account)));
disconnect(AccountManager::instance(), SIGNAL(accountUnregistered(Account)),
this, SLOT(accountUnregistered(Account)));
disconnect(AccountManager::instance(), 0, this, 0);
}
int AccountsModel::columnCount(const QModelIndex &parent) const
......
......@@ -91,7 +91,7 @@ void AccountsProxyModel::removeFilter(AbstractAccountFilter *filter)
return;
invalidateFilter();
disconnect(filter, SIGNAL(filterChanged()), this, SLOT(filterChangedSlot()));
disconnect(filter, 0, this, 0);
}
void AccountsProxyModel::filterChangedSlot()
......
......@@ -91,8 +91,7 @@ void AvatarJobRunner::timeout()
{
AvatarService *service = avatarService(MyContact);
if (service)
disconnect(service, SIGNAL(avatarFetched(Contact,bool)),
this, SLOT(avatarFetched(Contact,bool)));
disconnect(service, 0, this, 0);
emit jobFinished(false);
deleteLater();
......
......@@ -57,7 +57,7 @@ AvatarManager::AvatarManager()
AvatarManager::~AvatarManager()
{
triggerAllAccountsUnregistered();
disconnect(ContactManager::instance(), SIGNAL(contactAdded(Contact)), this, SLOT(contactAdded(Contact)));
disconnect(ContactManager::instance(), 0, this, 0);
}
void AvatarManager::init()
......@@ -87,8 +87,7 @@ void AvatarManager::itemAdded(Avatar item)
void AvatarManager::itemAboutToBeRemoved(Avatar item)
{
emit avatarAboutToBeRemoved(item);
disconnect(item, SIGNAL(updated()), this, SLOT(avatarDataUpdated()));
disconnect(item, SIGNAL(pixmapUpdated()), this, SLOT(avatarPixmapUpdated()));
disconnect(item, 0, this, 0);
}
void AvatarManager::itemRemoved(Avatar item)
......@@ -107,7 +106,7 @@ void AvatarManager::accountUnregistered(Account account)
{
QMutexLocker locker(&mutex());
disconnect(account, SIGNAL(connected()), this, SLOT(updateAccountAvatars()));
disconnect(account, 0, this, 0);
}
void AvatarManager::contactAdded(Contact contact)
......
......@@ -140,17 +140,7 @@ void BuddyManager::itemRemoved(Buddy buddy)
{
QMutexLocker locker(&mutex());
disconnect(buddy, SIGNAL(updated()), this, SLOT(buddyDataUpdated()));
disconnect(buddy, SIGNAL(buddySubscriptionChanged()), this, SLOT(buddySubscriptionChanged()));
disconnect(buddy, SIGNAL(contactAboutToBeAdded(Contact)),
this, SLOT(buddyContactAboutToBeAdded(Contact)));
disconnect(buddy, SIGNAL(contactAdded(Contact)),
this, SLOT(buddyContactAdded(Contact)));
disconnect(buddy, SIGNAL(contactAboutToBeRemoved(Contact)),
this, SLOT(buddyContactAboutToBeRemoved(Contact)));
disconnect(buddy, SIGNAL(contactRemoved(Contact)),
this, SLOT(buddyContactRemoved(Contact)));
disconnect(buddy, 0, this, 0);
emit buddyRemoved(buddy);
}
......
......@@ -393,7 +393,7 @@ void BuddyShared::setBuddyAvatar(const Avatar &buddyAvatar)
return;
if (*BuddyAvatar)
disconnect(*BuddyAvatar, SIGNAL(updated()), this, SLOT(avatarUpdated()));
disconnect(*BuddyAvatar, 0, this, 0);
*BuddyAvatar = buddyAvatar;
dataUpdated();
......@@ -471,8 +471,7 @@ bool BuddyShared::doRemoveFromGroup(const Group &group)
if (!Groups.remove(group))
return false;
disconnect(group, SIGNAL(nameChanged()), this, SLOT(markContactsDirty()));
disconnect(group, SIGNAL(groupAboutToBeRemoved()), this, SLOT(groupAboutToBeRemoved()));
disconnect(group, 0, this, 0);
return true;
}
......
......@@ -213,6 +213,6 @@ void GroupManager::itemAboutToBeRemoved(Group item)
void GroupManager::itemRemoved(Group item)
{
disconnect(item, SIGNAL(updated()), this, SLOT(groupDataUpdated()));
disconnect(item, 0, this, 0);
emit groupRemoved(item);
}
......@@ -50,8 +50,7 @@ BuddyListModel::~BuddyListModel()
triggerAllAccountsUnregistered();
disconnect(ContactManager::instance(), SIGNAL(contactUpdated(Contact)),
this, SLOT(contactUpdated(Contact)));
disconnect(ContactManager::instance(), 0, this, 0);
}
Buddy BuddyListModel::buddyFromVariant(const QVariant &variant) const
......@@ -118,15 +117,7 @@ void BuddyListModel::connectBuddy(const Buddy &buddy)
void BuddyListModel::disconnectBuddy(const Buddy &buddy)
{
disconnect(buddy, SIGNAL(updated()), this, SLOT(buddyUpdated()));
disconnect(buddy, SIGNAL(contactAboutToBeRemoved(Contact)),
this, SLOT(contactAboutToBeRemoved(Contact)));
disconnect(buddy, SIGNAL(contactRemoved(Contact)),
this, SLOT(contactRemoved(Contact)));
disconnect(buddy, SIGNAL(contactAboutToBeAdded(Contact)),
this, SLOT(contactAboutToBeAdded(Contact)));
disconnect(buddy, SIGNAL(contactAdded(Contact)),
this, SLOT(contactAdded(Contact)));
disconnect(buddy, 0, this, 0);
}
void BuddyListModel::buddyUpdated()
......@@ -530,5 +521,5 @@ void BuddyListModel::accountRegistered(Account account)
void BuddyListModel::accountUnregistered (Account account)
{
disconnect(account, SIGNAL(buddyStatusChanged(Contact,Status)), this, SLOT(contactStatusChanged(Contact,Status)));
disconnect(account, 0, this, 0);
}
......@@ -38,12 +38,8 @@ BuddyManagerAdapter::BuddyManagerAdapter(BuddyListModel *model) :
BuddyManagerAdapter::~BuddyManagerAdapter()
{
BuddyManager *manager = BuddyManager::instance();
disconnect(manager, SIGNAL(buddyAdded(Buddy)),
this, SLOT(buddyAdded(Buddy)));
disconnect(manager, SIGNAL(buddyAboutToBeRemoved(Buddy)),
this, SLOT(buddyRemoved(Buddy)));
disconnect(manager, 0, this, 0);
}
void BuddyManagerAdapter::buddyAdded(const Buddy &buddy)
......
......@@ -44,14 +44,7 @@ GroupsModel::GroupsModel(QObject *parent)
GroupsModel::~GroupsModel()
{
disconnect(GroupManager::instance(), SIGNAL(groupAboutToBeAdded(Group)),
this, SLOT(groupAboutToBeAdded(Group)));
disconnect(GroupManager::instance(), SIGNAL(groupAdded(Group)),
this, SLOT(groupAdded(Group)));
disconnect(GroupManager::instance(), SIGNAL(groupAboutToBeRemoved(Group)),
this, SLOT(groupAboutToBeRemoved(Group)));
disconnect(GroupManager::instance(), SIGNAL(groupRemoved(Group)),
this, SLOT(groupRemoved(Group)));
disconnect(GroupManager::instance(), 0, this, 0);
}
int GroupsModel::rowCount(const QModelIndex &parent) const
......
......@@ -51,13 +51,8 @@ BuddyChatManager::BuddyChatManager()
BuddyChatManager::~BuddyChatManager()
{
disconnect(BuddyManager::instance(), SIGNAL(buddyContactAdded(Buddy,Contact)),
this, SLOT(buddyContactAdded(Buddy,Contact)));
disconnect(BuddyManager::instance(), SIGNAL(buddyContactRemoved(Buddy,Contact)),
this, SLOT(buddyContactRemoved(Buddy,Contact)));
disconnect(ChatManager::instance(), SIGNAL(chatAdded(Chat)), this, SLOT(chatAdded(Chat)));
disconnect(ChatManager::instance(), SIGNAL(chatRemoved(Chat)), this, SLOT(chatRemoved(Chat)));
disconnect(BuddyManager::instance(), 0, this, 0);
disconnect(ChatManager::instance(), 0, this, 0);
foreach (const Chat &chat, ChatManager::instance()->items())
chatRemoved(chat);
......
......@@ -55,10 +55,7 @@ ChatManager::ChatManager()
ChatManager::~ChatManager()
{
disconnect(MessageManager::instance(), SIGNAL(unreadMessageAdded(Message)),
this, SLOT(unreadMessageAdded(Message)));
disconnect(MessageManager::instance(), SIGNAL(unreadMessageRemoved(Message)),
this, SLOT(unreadMessageRemoved(Message)));
disconnect(MessageManager::instance(), 0, this, 0);
foreach (const Message &message, MessageManager::instance()->allUnreadMessages())
unreadMessageRemoved(message);
......@@ -91,9 +88,7 @@ void ChatManager::itemRegistered(Chat item)
void ChatManager::itemAboutToBeUnregisterd(Chat item)
{
disconnect(item, SIGNAL(updated()), this, SLOT(chatDataUpdated()));
disconnect(item, SIGNAL(opened()), this, SLOT(chatOpened()));
disconnect(item, SIGNAL(closed()), this, SLOT(chatClosed()));
disconnect(item, 0, this, 0);
emit chatAboutToBeRemoved(item);
}
......
......@@ -424,7 +424,7 @@ bool ChatShared::doRemoveFromGroup(const Group &group)
if (!Groups.remove(group))
return false;
disconnect(group, SIGNAL(groupAboutToBeRemoved()), this, SLOT(groupAboutToBeRemoved()));
disconnect(group, 0, this, 0);
return true;
}
......
......@@ -46,11 +46,7 @@ void ChatListModel::connectChat(const Chat &chat)
void ChatListModel::disconnectChat(const Chat &chat)
{
disconnect(chat, SIGNAL(contactAboutToBeAdded(Contact)), this, SLOT(contactAboutToBeAdded(Contact)));
disconnect(chat, SIGNAL(contactAdded(Contact)), this, SLOT(contactAdded(Contact)));
disconnect(chat, SIGNAL(contactAboutToBeRemoved(Contact)), this, SLOT(contactAboutToBeRemoved(Contact)));
disconnect(chat, SIGNAL(contactRemoved(Contact)), this, SLOT(contactRemoved(Contact)));
disconnect(chat, SIGNAL(updated()), this, SLOT(chatUpdated()));
disconnect(chat, 0, this, 0);
}
void ChatListModel::setChats(const QVector<Chat> &chats)
......
......@@ -38,12 +38,8 @@ ChatManagerAdapter::ChatManagerAdapter(ChatListModel *model) :
ChatManagerAdapter::~ChatManagerAdapter()
{
ChatManager *manager = ChatManager::instance();
disconnect(manager, SIGNAL(chatAdded(Chat)),
this, SLOT(chatAdded(Chat)));
disconnect(manager, SIGNAL(chatAboutToBeRemoved(Chat)),
this, SLOT(chatRemoved(Chat)));
disconnect(manager, 0, this, 0);
}
void ChatManagerAdapter::chatAdded(const Chat &chat)
......
......@@ -62,10 +62,7 @@ ContactManager::ContactManager()
ContactManager::~ContactManager()
{
disconnect(MessageManager::instance(), SIGNAL(unreadMessageAdded(Message)),
this, SLOT(unreadMessageAdded(Message)));
disconnect(MessageManager::instance(), SIGNAL(unreadMessageRemoved(Message)),
this, SLOT(unreadMessageRemoved(Message)));
disconnect(MessageManager::instance(), 0, this, 0);
foreach (const Message &message, MessageManager::instance()->allUnreadMessages())
unreadMessageRemoved(message);
......
......@@ -69,10 +69,7 @@ ContactShared::~ContactShared()
{
ref.ref();
disconnect(ProtocolsManager::instance(), SIGNAL(protocolFactoryRegistered(ProtocolFactory*)),
this, SLOT(protocolFactoryRegistered(ProtocolFactory*)));
disconnect(ProtocolsManager::instance(), SIGNAL(protocolFactoryUnregistered(ProtocolFactory*)),
this, SLOT(protocolFactoryUnregistered(ProtocolFactory*)));
disconnect(ProtocolsManager::instance(), 0, this, 0);
protocolFactoryUnregistered(ProtocolsManager::instance()->byName(ContactAccount->protocolName()));
......@@ -318,7 +315,7 @@ void ContactShared::avatarUpdated()
void ContactShared::doSetOwnerBuddy(const Buddy &buddy)
{
if (*OwnerBuddy)
disconnect(*OwnerBuddy, SIGNAL(updated()), this, SIGNAL(buddyUpdated()));
disconnect(*OwnerBuddy, 0, this, 0);
*OwnerBuddy = buddy;
......@@ -329,7 +326,7 @@ void ContactShared::doSetOwnerBuddy(const Buddy &buddy)
void ContactShared::doSetContactAvatar(const Avatar &contactAvatar)
{
if (*ContactAvatar)
disconnect(*ContactAvatar, SIGNAL(updated()), this, SLOT(avatarUpdated()));
disconnect(*ContactAvatar, 0, this, 0);
*ContactAvatar = contactAvatar;
......
......@@ -47,14 +47,7 @@ BuddyContactModel::BuddyContactModel(Buddy buddy, QObject *parent) :
BuddyContactModel::~BuddyContactModel()
{
disconnect(SourceBuddy, SIGNAL(contactAboutToBeAdded(Contact)),
this, SLOT(contactAboutToBeAdded(Contact)));
disconnect(SourceBuddy, SIGNAL(contactAdded(Contact)),
this, SLOT(contactAdded(Contact)));
disconnect(SourceBuddy, SIGNAL(contactAboutToBeRemoved(Contact)),
this, SLOT(contactAboutToBeRemoved(Contact)));
disconnect(SourceBuddy, SIGNAL(contactRemoved(Contact)),
this, SLOT(contactRemoved(Contact)));
disconnect(SourceBuddy, 0, this, 0);
}
int BuddyContactModel::columnCount(const QModelIndex &parent) const
......
......@@ -39,7 +39,7 @@ void ContactListModel::connectContact(const Contact &contact)
void ContactListModel::disconnectContact(const Contact &contact)
{
disconnect(contact, SIGNAL(updated()), this, SLOT(contactUpdated()));
disconnect(contact, 0, this, 0);
}
void ContactListModel::setContactList(const QVector<Contact> &contacts)
......
......@@ -489,11 +489,7 @@ void Core::accountUnregistered(Account account)
Protocol *protocol = account.protocolHandler();
if (protocol)
{
disconnect(protocol, SIGNAL(connecting(Account)), this, SIGNAL(connecting()));
disconnect(protocol, SIGNAL(connected(Account)), this, SIGNAL(connected()));
disconnect(protocol, SIGNAL(disconnected(Account)), this, SIGNAL(disconnected()));
}
disconnect(protocol, 0, this, 0);
}
void Core::configurationUpdated()
......
......@@ -103,8 +103,7 @@ void FileTransferManager::removeFileTransferService(Account account)
if (!service)
return;
disconnect(service, SIGNAL(incomingFileTransfer(FileTransfer)),
this, SLOT(incomingFileTransfer(FileTransfer)));
disconnect(service, 0, this, 0);
}
void FileTransferManager::fileTransferServiceRegistered()
......@@ -131,8 +130,7 @@ void FileTransferManager::accountUnregistered(Account account)
{
QMutexLocker locker(&mutex());
disconnect(account, SIGNAL(fileTransferServiceRegistered()), this, SLOT(fileTransferServiceRegistered()));
disconnect(account, SIGNAL(fileTransferServiceUnregistered()), this, SLOT(fileTransferServiceUnregistered()));
disconnect(account, 0, this, 0);
removeFileTransferService(account);
}
......
......@@ -136,10 +136,11 @@ void FileTransferShared::setHandler(FileTransferHandler *handler)
return;
if (Handler)
disconnect(Handler, SIGNAL(destroyed()), this, SLOT(handlerDestroyed()));
disconnect(Handler, 0, this, 0);
Handler = handler;
connect(Handler, SIGNAL(destroyed()), this, SLOT(handlerDestroyed()));
if (Handler)
connect(Handler, SIGNAL(destroyed()), this, SLOT(handlerDestroyed()));
dataUpdated();
}
......
......@@ -101,10 +101,7 @@ void AccountAvatarWidget::protocolRegistered(ProtocolFactory *protocolFactory)
Q_UNUSED(protocolFactory)
if (Service)
{
disconnect(Service, SIGNAL(destroyed()), this, SLOT(serviceDestroyed()));
disconnect(Service, SIGNAL(avatarUploaded(bool, QImage)), this, SLOT(avatarUploaded(bool, QImage)));
}
disconnect(Service, 0, this, 0);
Protocol *protocol = MyAccount.protocolHandler();
if (!protocol)
......
......@@ -59,7 +59,7 @@ BuddyInfoPanel::BuddyInfoPanel(QWidget *parent) : KaduWebView(parent)
BuddyInfoPanel::~BuddyInfoPanel()
{
disconnect(BuddyPreferredManager::instance(), SIGNAL(buddyUpdated(Buddy)), this, SLOT(buddyUpdated(Buddy)));
disconnect(BuddyPreferredManager::instance(), 0, this, 0);
}
void BuddyInfoPanel::configurationUpdated()
......@@ -175,17 +175,17 @@ void BuddyInfoPanel::disconnectItem()
Buddy buddy = Item.toBuddy();
if (buddy)
{
disconnect(buddy, SIGNAL(updated()), this, SLOT(update()));
disconnect(buddy, 0, this, 0);
if (buddy.buddyAvatar())
disconnect(buddy.buddyAvatar(), SIGNAL(updated()), this, SLOT(update()));
disconnect(buddy.buddyAvatar(), 0, this, 0);
}
Contact contact = Item.toContact();
if (contact)
{
disconnect(contact, SIGNAL(updated()), this, SLOT(update()));
disconnect(contact, 0, this, 0);
if (contact.contactAvatar())
disconnect(contact.contactAvatar(), SIGNAL(updated()), this, SLOT(update()));
disconnect(contact.contactAvatar(), 0, this, 0);
}
}
......
......@@ -114,9 +114,8 @@ ChatEditBox::ChatEditBox(const Chat &chat, QWidget *parent) :
ChatEditBox::~ChatEditBox()
{
// disconnect(ChatWidgetManager::instance()->actions()->colorSelector(), SIGNAL(actionCreated(Action *)),
// this, SLOT(colorSelectorActionCreated(Action *)));
disconnect(InputBox, SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged()));
// disconnect(ChatWidgetManager::instance()->actions()->colorSelector(), 0, this, 0);
disconnect(InputBox, 0, this, 0);
chatEditBoxes.removeAll(this);
}
......
......@@ -133,21 +133,22 @@ void ChatMessagesView::connectChat()
void ChatMessagesView::disconnectChat()
{
if (CurrentChat.isNull() || CurrentChat.chatAccount().isNull() || !CurrentChat.chatAccount().protocolHandler())
if (CurrentChat.isNull())
return;
foreach (const Contact &contact, CurrentChat.contacts())
disconnect(contact, SIGNAL(buddyUpdated()), this, SLOT(repaintMessages()));
disconnect(contact, 0, this, 0);
if (CurrentChat.chatAccount().isNull() || !CurrentChat.chatAccount().protocolHandler())
return;
ChatImageService *chatImageService = CurrentChat.chatAccount().protocolHandler()->chatImageService();
if (chatImageService)
disconnect(chatImageService, SIGNAL(imageReceived(const QString &, const QString &)),
this, SLOT(imageReceived(const QString &, const QString &)));
disconnect(chatImageService, 0, this, 0);
ChatService *chatService = CurrentChat.chatAccount().protocolHandler()->chatService();
if (chatService)
disconnect(chatService, SIGNAL(sentMessageStatusChanged(const Message &)),
this, SLOT(sentMessageStatusChanged(const Message &)));
disconnect(chatService, 0, this, 0);
}
void ChatMessagesView::setChat(const Chat &chat)
......
......@@ -80,8 +80,7 @@ ChatWidgetManager::~ChatWidgetManager()
{
MessageRenderInfo::unregisterParserTags();
disconnect(MessageManager::instance(), SIGNAL(messageReceived(const Message &)),
this, SLOT(messageReceived(const Message &)));
disconnect(MessageManager::instance(), 0, this, 0);
closeAllWindows();
}
......
......@@ -52,8 +52,7 @@ ConfigSpinBox::ConfigSpinBox(ConfigGroupBox *parentConfigGroupBox, Configuration
ConfigSpinBox::~ConfigSpinBox()
{
disconnect(this, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged(int)));
if (label)
delete label;
delete label;
}
void ConfigSpinBox::createWidgets()
......
......@@ -97,8 +97,7 @@ ConfigurationWidget::~ConfigurationWidget()
if (SectionsListWidget->currentItem())
config_file.writeEntry("General", "ConfigurationWindow_" + Name, SectionsListWidget->currentItem()->text());
disconnect(SectionsListWidget, SIGNAL(currentTextChanged(const QString &)),
this, SLOT(changeSection(const QString &)));
disconnect(SectionsListWidget, 0, this, 0);
// qDeleteAll() won't work here because of connection to destroyed() signal
foreach (const ConfigSection *cs, ConfigSections)
......
......@@ -63,7 +63,7 @@ FileTransferWidget::~FileTransferWidget()
{
kdebugf();
disconnect(CurrentTransfer, SIGNAL(updated()), this, SLOT(fileTransferUpdate()));
disconnect(CurrentTransfer, 0, this, 0);
}
void FileTransferWidget::createGui()
......
......@@ -244,14 +244,7 @@ bool PluginListWidgetDelegate::eventFilter(QObject *watched, QEvent *event)
if (model != ItemView->model())
{
if (model)
{
disconnect(model, SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(_k_slotRowsInserted(QModelIndex, int, int)));
disconnect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), this, SLOT(_k_slotRowsAboutToBeRemoved(QModelIndex, int, int)));
disconnect(model, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(_k_slotRowsRemoved(QModelIndex, int, int)));
disconnect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(_k_slotDataChanged(QModelIndex, QModelIndex)));
disconnect(model, SIGNAL(layoutChanged()), this, SLOT(_k_slotLayoutChanged()));
disconnect(model, SIGNAL(modelReset()), this, SLOT(_k_slotModelReset()));
}
disconnect(model, 0, this, 0);
model = ItemView->model();
......
......@@ -49,10 +49,9 @@ TalkableDelegate::TalkableDelegate(TalkableTreeView *parent) :
TalkableDelegate::~TalkableDelegate()
{
disconnect(ContactManager::instance(), SIGNAL(contactUpdated(Contact)), this, SLOT(contactUpdated(Contact)));
disconnect(BuddyPreferredManager::instance(), SIGNAL(buddyUpdated(Buddy)), this, SLOT(buddyUpdated(Buddy)));
disconnect(MessageManager::instance(), SIGNAL(unreadMessageAdded(Message)), this, SLOT(messageStatusChanged(Message)));
disconnect(MessageManager::instance(), SIGNAL(unreadMessageRemoved(Message)), this, SLOT(messageStatusChanged(Message)));
disconnect(ContactManager::instance(), 0, this, 0);
disconnect(BuddyPreferredManager::instance(), 0, this, 0);
disconnect(MessageManager::instance(), 0, this, 0);
}
void TalkableDelegate::setChain(ModelChain *chain)
......
......@@ -92,7 +92,7 @@ TalkableTreeView::TalkableTreeView(QWidget *parent) :
TalkableTreeView::~TalkableTreeView()
{
disconnect(MainConfigurationHolder::instance(), SIGNAL(setStatusModeChanged()), this, SLOT(updateContext()));
disconnect(MainConfigurationHolder::instance(), 0, this, 0);
delete Context;
Context = 0;
......
......@@ -269,10 +269,7 @@ void AddBuddyWindow::accountChanged()
Account account = AccountCombo->currentAccount();
if (LastSelectedAccount && LastSelectedAccount.protocolHandler())
{
disconnect(LastSelectedAccount.protocolHandler(), SIGNAL(connected(Account)), this, SLOT(setAddContactEnabled()));
disconnect(LastSelectedAccount.protocolHandler(), SIGNAL(disconnected(Account)), this, SLOT(setAddContactEnabled()));
}
disconnect(LastSelectedAccount.protocolHandler(), 0, this, 0);
if (!account || !account.protocolHandler() || !account.protocolHandler()->subscriptionService())
{
......
......@@ -64,10 +64,7 @@ FileTransferWindow::~FileTransferWindow()
{
kdebugf();
disconnect(FileTransferManager::instance(), SIGNAL(fileTransferAdded(FileTransfer)),
this, SLOT(fileTransferAdded(FileTransfer)));
disconnect(FileTransferManager::instance(), SIGNAL(fileTransferRemoved(FileTransfer)),
this, SLOT(fileTransferRemoved(FileTransfer)));
disconnect(FileTransferManager::instance(), 0, this, 0);
saveWindowGeometry(this, "General", "TransferWindowGeometry");
......
......@@ -76,12 +76,8 @@ MainWindow::MainWindow(ActionContext *context, const QString &windowName, QWidge
MainWindow::~MainWindow()
{
disconnect(Actions::instance(), SIGNAL(actionUnloaded(ActionDescription*)),
this, SLOT(actionLoadedOrUnloaded(ActionDescription*)));
disconnect(Actions::instance(), SIGNAL(actionLoaded(ActionDescription*)),
this, SLOT(actionLoadedOrUnloaded(ActionDescription*)));
disconnect(ConfigurationManager::instance()->toolbarConfigurationManager(), SIGNAL(configurationUpdated()),
this, SLOT(refreshToolBars()));
disconnect(Actions::instance(), 0, this, 0);
disconnect(ConfigurationManager::instance()->toolbarConfigurationManager(), 0, this, 0);
delete Context;
Context = 0;
......
......@@ -36,7 +36,7 @@ ProxyActionContext::~ProxyActionContext()
void ProxyActionContext::setForwardActionContext(ActionContext *forwardActionContext)
{
if (ForwardActionContext)
disconnect(ForwardActionContext, SIGNAL(changed()), this, SIGNAL(changed()));
disconnect(ForwardActionContext, 0, this, 0);
ForwardActionContext = forwardActionContext;
......
......@@ -128,7 +128,7 @@ void IdentityShared::removeAccount(const Account &account)
if (Accounts.removeAll(account) > 0)
{
disconnect(account.statusContainer(), SIGNAL(statusUpdated()), this, SIGNAL(statusUpdated()));
disconnect(account.statusContainer(), 0, this, 0);
emit statusUpdated();
}
}
......
......@@ -40,14 +40,7 @@ IdentityModel::IdentityModel(QObject *parent) :
IdentityModel::~IdentityModel()
{