Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 0a1fa6ab authored by Vijay Krishnavanshi's avatar Vijay Krishnavanshi Committed by Pali Rohár

Adapted AIM protocol to new Qt5 Slot and Signals

parent 817075f6
......@@ -105,8 +105,7 @@ Kopete::ChatSession* AIMMyselfContact::manager( Kopete::Contact::CanCreateFlags
session = new AIMChatSession( this, chatMembers, account()->protocol(), exchange, room );
session->setEngine( m_acct->engine() );
connect( session, SIGNAL(messageSent(Kopete::Message&,Kopete::ChatSession*)),
this, SLOT(sendMessage(Kopete::Message&,Kopete::ChatSession*)) );
connect(session, &AIMChatSession::messageSent, this, &AIMMyselfContact::sendMessage);
m_chatRoomSessions.append( session );
}
return session;
......@@ -237,13 +236,13 @@ AIMAccount::AIMAccount(Kopete::Protocol *parent, QString accountID)
// Create actions
mJoinChatAction = new QAction( i18n( "Join Chat..." ), this );
QObject::connect( mJoinChatAction, SIGNAL(triggered(bool)), this, SLOT(slotJoinChat()) );
QObject::connect(mJoinChatAction, &QAction::triggered, this, &AIMAccount::slotJoinChat);
mEditInfoAction = new QAction( QIcon::fromTheme("user-properties"), i18n( "Edit User Info..." ), this );
QObject::connect( mEditInfoAction, SIGNAL(triggered(bool)), this, SLOT(slotEditInfo()) );
QObject::connect(mEditInfoAction, &QAction::triggered, this, &AIMAccount::slotEditInfo);
mActionInvisible = new KToggleAction( i18n( "In&visible" ), this );
QObject::connect( mActionInvisible, SIGNAL(triggered(bool)), this, SLOT(slotToggleInvisible()) );
QObject::connect(mActionInvisible, &KToggleAction::triggered, this, &AIMAccount::slotToggleInvisible);
}
AIMAccount::~AIMAccount()
......@@ -420,8 +419,7 @@ void AIMAccount::slotJoinChat()
if ( !m_joinChatDialog )
{
m_joinChatDialog = new AIMJoinChatUI( this, Kopete::UI::Global::mainWidget() );
QObject::connect( m_joinChatDialog, SIGNAL(closing(int)),
this, SLOT(joinChatDialogClosed(int)) );
QObject::connect(m_joinChatDialog, &AIMJoinChatUI::closing, this, &AIMAccount::joinChatDialogClosed);
QList<int> list = engine()->chatExchangeList();
m_joinChatDialog->setExchangeList( list );
m_joinChatDialog->show();
......
......@@ -70,15 +70,15 @@ QList<QAction*> *AIMContact::customContextMenuActions()
{
m_warnUserAction = new QAction( i18n( "&Warn User" ), this );
//, "warnAction" );
QObject::connect( m_warnUserAction, SIGNAL(triggered(bool)), this, SLOT(warnUser()) );
QObject::connect(m_warnUserAction, &QAction::triggered, this, &AIMContact::warnUser);
}
m_actionVisibleTo = new KToggleAction(i18n("Always &Visible To"), this );
//, "actionVisibleTo");
QObject::connect( m_actionVisibleTo, SIGNAL(triggered(bool)), this, SLOT(slotVisibleTo()) );
QObject::connect(m_actionVisibleTo, &KToggleAction::triggered, this, &AIMContact::slotVisibleTo);
m_actionInvisibleTo = new KToggleAction(i18n("Always &Invisible To"), this );
//, "actionInvisibleTo");
QObject::connect( m_actionInvisibleTo, SIGNAL(triggered(bool)), this, SLOT(slotInvisibleTo()) );
QObject::connect(m_actionInvisibleTo, &KToggleAction::triggered, this, &AIMContact::slotInvisibleTo);
bool on = account()->isConnected();
......@@ -129,7 +129,7 @@ void AIMContact::slotUserInfo()
m_infoDialog = new AIMUserInfoDialog( this, static_cast<AIMAccount*>( account() ), Kopete::UI::Global::mainWidget() );
if( !m_infoDialog )
return;
connect( m_infoDialog, SIGNAL(finished()), this, SLOT(closeUserInfoDialog()) );
connect(m_infoDialog, &AIMUserInfoDialog::finished, this, &AIMContact::closeUserInfoDialog);
m_infoDialog->show();
if ( mAccount->isConnected() )
{
......
......@@ -46,8 +46,8 @@ AIMJoinChatUI::AIMJoinChatUI( AIMAccount* account, QWidget* parent )
setMainWidget( w );
QObject::connect( this, SIGNAL(user1Clicked()), this, SLOT(joinChat()) );
QObject::connect( this, SIGNAL(cancelClicked()), this, SLOT(closeClicked()) );
QObject::connect(this, &AIMJoinChatUI::user1Clicked, this, &AIMJoinChatUI::joinChat);
QObject::connect(this, &AIMJoinChatUI::cancelClicked, this, &AIMJoinChatUI::closeClicked);
}
AIMJoinChatUI::~AIMJoinChatUI()
......
......@@ -27,7 +27,7 @@
#include <qpushbutton.h>
#include <QVBoxLayout>
#include <qtimer.h>
#include <QDesktopServices>
#include <KLocalizedString>
#include <qtextbrowser.h>
......@@ -36,7 +36,7 @@
#include <ktextedit.h>
#include <krun.h>
AIMUserInfoDialog::AIMUserInfoDialog( Kopete::Contact *c, AIMAccount *acc, QWidget *parent )
AIMUserInfoDialog::AIMUserInfoDialog(AIMContact *c, AIMAccount *acc, QWidget *parent)
: KDialog( parent )
{
setCaption( i18n( "User Information on %1" ,
......@@ -55,11 +55,11 @@ AIMUserInfoDialog::AIMUserInfoDialog( Kopete::Contact *c, AIMAccount *acc, QWidg
mMainWidget->setupUi( w );
setMainWidget( w );
QObject::connect(this, SIGNAL(okClicked()), this, SLOT(slotSaveClicked()));
QObject::connect(this, SIGNAL(user1Clicked()), this, SLOT(slotUpdateClicked()));
QObject::connect(this, SIGNAL(cancelClicked()), this, SLOT(slotCloseClicked()));
QObject::connect(c, SIGNAL(updatedProfile()), this, SLOT(slotUpdateProfile()));
QObject::connect(c, SIGNAL(statusMessageChanged(Kopete::Contact*)), this, SLOT(slotUpdateProfile()));
QObject::connect(this, &AIMUserInfoDialog::okClicked, this, &AIMUserInfoDialog::slotSaveClicked);
QObject::connect(this, &AIMUserInfoDialog::user1Clicked, this, &AIMUserInfoDialog::slotUpdateClicked);
QObject::connect(this, &AIMUserInfoDialog::cancelClicked, this, &AIMUserInfoDialog::slotCloseClicked);
QObject::connect(c, &AIMContact::updatedProfile, this, &AIMUserInfoDialog::slotUpdateProfile);
QObject::connect(c, &AIMContact::statusMessageChanged, this, &AIMUserInfoDialog::slotUpdatedStatus);
mMainWidget->txtScreenName->setText( c->contactId() );
mMainWidget->txtNickName->setText( c->customName() );
......@@ -99,13 +99,10 @@ AIMUserInfoDialog::AIMUserInfoDialog( Kopete::Contact *c, AIMAccount *acc, QWidg
l->setContentsMargins( 0, 0, 0, 0 );
userInfoView = new QTextBrowser(mMainWidget->userInfoFrame);
userInfoView->setObjectName("userInfoView");
//KF5 PORT ME userInfoView->setNotifyClick(true);
QObject::connect(
userInfoView, SIGNAL(urlClick(QString)),
this, SLOT(slotUrlClicked(QString)));
QObject::connect(
userInfoView, SIGNAL(mailClick(QString,QString)),
this, SLOT(slotMailClicked(QString,QString)));
userInfoView->setOpenLinks(true);
QObject::connect(userInfoView, &QTextBrowser::anchorClicked, this, &AIMUserInfoDialog::slotUrlClicked);
// This is not doing anything at present as in their slots they are unused.
// QObject::connect(userInfoView, SIGNAL(mailClick(QString,QString)), this, SLOT(slotMailClicked(QString,QString)));
showButton(Cancel, false);
setButtonText(Ok, i18n("&Close"));
setEscapeButton(Ok);
......@@ -116,7 +113,7 @@ AIMUserInfoDialog::AIMUserInfoDialog( Kopete::Contact *c, AIMAccount *acc, QWidg
// Update the user view to indicate that we're requesting the user's profile
userInfoView->setPlainText(i18n("Requesting User Profile, please wait..."));
}
QTimer::singleShot(0, this, SLOT(slotUpdateProfile()));
QTimer::singleShot(0, this, &AIMUserInfoDialog::slotUpdateProfile);
}
}
......@@ -133,8 +130,8 @@ void AIMUserInfoDialog::slotUpdateClicked()
QString currentNick = m_contact->displayName();
if ( newNick != currentNick )
{
//m_contact->rename(newNick);
//emit updateNickname(newNick);
m_contact->setNickName(newNick);
emit updateNickname(newNick);
setCaption(i18n("User Information on %1", newNick));
}
......@@ -150,8 +147,8 @@ void AIMUserInfoDialog::slotSaveClicked()
QString currentNick = m_contact->displayName();
if(!newNick.isEmpty() && ( newNick != currentNick ) )
{
//m_contact->rename(newNick);
//emit updateNickname(newNick);
m_contact->setNickName(newNick);
emit updateNickname(newNick);
setCaption(i18n("User Information on %1", newNick));
}
......@@ -186,7 +183,6 @@ void AIMUserInfoDialog::slotUpdateProfile()
}
QString onlineSince = m_contact->property("onlineSince").value().toString();
//QString onlineSince = m_details.onlineSinceTime().toString();
mMainWidget->txtOnlineSince->setText( onlineSince );
AIMContact* c = static_cast<AIMContact*>( m_contact );
......@@ -211,13 +207,18 @@ void AIMUserInfoDialog::slotUpdateProfile()
}
//KRun changed, so comment it so it compiles FIXME
void AIMUserInfoDialog::slotUrlClicked(const QString &url)
void AIMUserInfoDialog::slotUpdatedStatus(const Kopete::Contact* contact)
{
Q_UNUSED(contact);
slotUpdateProfile();
}
void AIMUserInfoDialog::slotUrlClicked(const QUrl &url)
{
Q_UNUSED(url);
//new KRun(KUrl(url));
QDesktopServices::openUrl(url);
}
//KRun changed, so comment it so it compiles FIXME
void AIMUserInfoDialog::slotMailClicked(const QString&, const QString &address)
{
Q_UNUSED(address);
......
......@@ -19,6 +19,7 @@
#define AIMUSERINFO_H
#include <kdialog.h>
#include "aimcontact.h"
namespace Kopete { class Contact; }
namespace Ui { class AIMUserInfoWidget; }
......@@ -30,12 +31,12 @@ class AIMUserInfoDialog : public KDialog
{
Q_OBJECT
public:
AIMUserInfoDialog(Kopete::Contact *c, AIMAccount *acc, QWidget *parent = nullptr);
AIMUserInfoDialog(AIMContact *c, AIMAccount *acc, QWidget *parent = nullptr);
~AIMUserInfoDialog();
private:
AIMAccount *mAccount;
Kopete::Contact* m_contact;
AIMContact* m_contact;
Ui::AIMUserInfoWidget *mMainWidget;
QTextBrowser *userInfoView;
KTextEdit *userInfoEdit;
......@@ -45,11 +46,12 @@ class AIMUserInfoDialog : public KDialog
void slotCloseClicked();
void slotUpdateClicked();
void slotUpdateProfile();
void slotUrlClicked(const QString&);
void slotUpdatedStatus(const Kopete::Contact*);
void slotUrlClicked(const QUrl&);
void slotMailClicked(const QString&, const QString&);
Q_SIGNALS:
// void updateNickname(const QString &);
void updateNickname(const QString &);
void closing();
};
......
......@@ -149,11 +149,11 @@ QList<QAction*> *ICQContact::customContextMenuActions()
m_actionVisibleTo = new KToggleAction(i18n("Always &Visible To"), this );
//, "actionVisibleTo");
QObject::connect( m_actionVisibleTo, SIGNAL(triggered(bool)), this, SLOT(slotVisibleTo()) );
QObject::connect(m_actionVisibleTo, &KToggleAction::triggered, this, &ICQContact::slotVisibleTo);
m_actionInvisibleTo = new KToggleAction(i18n("Always &Invisible To"), this );
//, "actionInvisibleTo");
QObject::connect( m_actionInvisibleTo, SIGNAL(triggered(bool)), this, SLOT(slotInvisibleTo()) );
QObject::connect(m_actionInvisibleTo, &KToggleAction::triggered, this, &ICQContact::slotInvisibleTo);
bool on = account()->isConnected();
......
......@@ -32,8 +32,8 @@ AIMAddContactPage::AIMAddContactPage(bool connected, QWidget *parent)
{
m_gui = new Ui::aimAddContactUI();
m_gui->setupUi(this);
connect( m_gui->icqRadioButton, SIGNAL(toggled(bool)), m_gui->icqEdit, SLOT(setEnabled(bool)) );
connect( m_gui->aimRadioButton, SIGNAL(toggled(bool)), m_gui->aimEdit, SLOT(setEnabled(bool)) );
connect(m_gui->icqRadioButton, &QRadioButton::toggled, m_gui->icqEdit, &QLineEdit::setEnabled);
connect(m_gui->aimRadioButton, &QRadioButton::toggled, m_gui->aimEdit, &QLineEdit::setEnabled);
m_gui->aimEdit->setFocus();
canadd = true;
}
......
......@@ -99,20 +99,20 @@ AIMEditAccountWidget::AIMEditAccountWidget( AIMProtocol *protocol,
m_visibleEngine = new OscarPrivacyEngine( mAccount, OscarPrivacyEngine::Visible );
m_visibleEngine->setAllContactsView( mGui->visibleAllContacts );
m_visibleEngine->setContactsView( mGui->visibleContacts );
QObject::connect( mGui->visibleAdd, SIGNAL(clicked()), m_visibleEngine, SLOT(slotAdd()) );
QObject::connect( mGui->visibleRemove, SIGNAL(clicked()), m_visibleEngine, SLOT(slotRemove()) );
QObject::connect(mGui->visibleAdd, &QPushButton::clicked, m_visibleEngine, &OscarPrivacyEngine::slotAdd);
QObject::connect(mGui->visibleRemove, &QPushButton::clicked, m_visibleEngine, &OscarPrivacyEngine::slotRemove);
m_invisibleEngine = new OscarPrivacyEngine( mAccount, OscarPrivacyEngine::Invisible );
m_invisibleEngine->setAllContactsView( mGui->invisibleAllContacts );
m_invisibleEngine->setContactsView( mGui->invisibleContacts );
QObject::connect( mGui->invisibleAdd, SIGNAL(clicked()), m_invisibleEngine, SLOT(slotAdd()) );
QObject::connect( mGui->invisibleRemove, SIGNAL(clicked()), m_invisibleEngine, SLOT(slotRemove()) );
QObject::connect(mGui->invisibleAdd, &QPushButton::clicked, m_invisibleEngine, &OscarPrivacyEngine::slotAdd);
QObject::connect(mGui->invisibleRemove, &QPushButton::clicked, m_invisibleEngine, &OscarPrivacyEngine::slotRemove);
}
// Hide the register UI if editing an existing account
mGui->registrationGroupBox->hide();
}
QObject::connect( mGui->buttonRegister, SIGNAL(clicked()), this, SLOT(slotOpenRegister()) );
QObject::connect(mGui->buttonRegister, &QPushButton::clicked, this, &AIMEditAccountWidget::slotOpenRegister);
if ( !mAccount || !mAccount->engine()->isActive() )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment