Hello.
I want to just make sure what was the reason, why this patch was not
checked in svn?
Regards Ladislav.
2005/11/21, Kevin Krammer <[EMAIL PROTECTED]>:
Hi,
sorry for not finding this earlier, I have been testing with the anonymous CVS
and didn't see that the userinfodlg.cpp file was different in the release tar
ball.
The tr("KDE Addressbook") gets an automatically assigned shortcut somehow, so
tabList[KABCInfo].label is no more equal to the string passed to updateTab()
Thus the KDE addressbook integration tab gets never updated, the most visible
hint is that the third button (update) does not change to "Browse"
To not rely on the string I suggest changing to the currentChanged(QWidget*)
signal (see attached patch). I checked Trolltech's online documentation and
it is listed from the Qt2.3 docs on.
The patch is agains anonymous CVS at sourceforge and includes the difference
to the release file, i.e. "KDE Addressbook" instead of "&KDE Addressbook"
Cheers,
Kevin
Index: userinfodlg.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/userinfodlg.cpp,v
retrieving revision 1.95
diff -u -3 -p -r1.95 userinfodlg.cpp
--- userinfodlg.cpp 24 Oct 2005 23:07:03 -0000 1.95
+++ userinfodlg.cpp 21 Nov 2005 21:40:50 -0000
@@ -132,7 +132,7 @@ UserInfoDlg::UserInfoDlg(CICQDaemon *s,
tabs->addTab(tabList[KABCInfo].tab, tabList[KABCInfo].label);
#endif
- connect (tabs, SIGNAL(selected(const QString &)), this, SLOT(updateTab(const QString &)));
+ connect (tabs, SIGNAL(currentChanged(QWidget*)), this, SLOT(updateTab(QWidget*)));
connect (sigman, SIGNAL(signal_updatedUser(CICQSignal *)),
this, SLOT(updatedUser(CICQSignal *)));
@@ -1618,7 +1618,7 @@ void UserInfoDlg::SetLastCountersInfo(IC
void UserInfoDlg::CreateKABCInfo()
{
#ifdef USE_KABC
- tabList[KABCInfo].label = tr("&KDE Addressbook");
+ tabList[KABCInfo].label = tr("KDE Addressbook");
tabList[KABCInfo].tab = new QWidget(this, tabList[KABCInfo].label.latin1());
tabList[KABCInfo].loaded = false;
@@ -2127,9 +2127,9 @@ void UserInfoDlg::SaveHistory()
// -----------------------------------------------------------------------------
-void UserInfoDlg::updateTab(const QString& txt)
+void UserInfoDlg::updateTab(QWidget* tab)
{
- if (txt == tabList[GeneralInfo].label)
+ if (tab == tabList[GeneralInfo].tab)
{
currentTab = GeneralInfo;
btnMain1->setText(m_bOwner ? tr("&Save") : tr("&Menu"));
@@ -2141,7 +2141,7 @@ void UserInfoDlg::updateTab(const QStrin
if (!tabList[GeneralInfo].loaded)
SetGeneralInfo(NULL);
}
- else if (txt == tabList[MoreInfo].label)
+ else if (tab == tabList[MoreInfo].tab)
{
btnMain1->setText(m_bOwner ? tr("&Save") : tr("&Menu"));
btnMain2->setText(m_bOwner ? tr("&Retrieve") : tr("&Save"));
@@ -2153,7 +2153,7 @@ void UserInfoDlg::updateTab(const QStrin
if (!tabList[MoreInfo].loaded)
SetMoreInfo(NULL);
}
- else if (txt == tabList[More2Info].label)
+ else if (tab == tabList[More2Info].tab)
{
btnMain1->setText(m_bOwner ? tr("&Save") : tr("&Menu"));
btnMain2->setText(m_bOwner ? tr("&Retrieve") : tr("&Save"));
@@ -2165,7 +2165,7 @@ void UserInfoDlg::updateTab(const QStrin
if (!tabList[More2Info].loaded)
SetMore2Info(NULL);
}
- else if (txt == tabList[WorkInfo].label)
+ else if (tab == tabList[WorkInfo].tab)
{
btnMain1->setText(m_bOwner ? tr("&Save") : tr("&Menu"));
btnMain2->setText(m_bOwner ? tr("&Retrieve") : tr("&Save"));
@@ -2177,7 +2177,7 @@ void UserInfoDlg::updateTab(const QStrin
if (!tabList[WorkInfo].loaded)
SetWorkInfo(NULL);
}
- else if (txt == tabList[AboutInfo].label)
+ else if (tab == tabList[AboutInfo].tab)
{
btnMain1->setText(m_bOwner ? tr("&Save") : tr("&Menu"));
btnMain2->setText(m_bOwner ? tr("&Retrieve") : tr("&Save"));
@@ -2189,7 +2189,7 @@ void UserInfoDlg::updateTab(const QStrin
if (!tabList[AboutInfo].loaded)
SetAbout(NULL);
}
- else if (txt == tabList[PhoneInfo].label)
+ else if (tab == tabList[PhoneInfo].tab)
{
btnMain3->setText(m_bOwner ? tr("&Add") : tr("&Update"));
btnMain2->setText(m_bOwner ? tr("&Clear") : tr("&Save"));
@@ -2201,7 +2201,7 @@ void UserInfoDlg::updateTab(const QStrin
if (!tabList[PhoneInfo].loaded)
SetPhoneBook(NULL);
}
- else if (txt == tabList[PictureInfo].label)
+ else if (tab == tabList[PictureInfo].tab)
{
btnMain3->setText(m_bOwner ? tr("&Browse") : tr("&Update"));
btnMain2->setText(m_bOwner ? tr("&Clear") : tr("&Save"));
@@ -2213,7 +2213,7 @@ void UserInfoDlg::updateTab(const QStrin
if (!tabList[PictureInfo].loaded)
SetPicture(NULL);
}
- else if (txt == tabList[HistoryInfo].label)
+ else if (tab == tabList[HistoryInfo].tab)
{
btnMain3->setText(tr("Nex&t"));
btnMain2->setText(tr("P&rev"));
@@ -2229,7 +2229,7 @@ void UserInfoDlg::updateTab(const QStrin
SetupHistory();
mlvHistory->setFocus();
}
- else if (txt == tabList[LastCountersInfo].label)
+ else if (tab == tabList[LastCountersInfo].tab)
{
currentTab = LastCountersInfo;
btnMain3->setText("");
@@ -2242,7 +2242,7 @@ void UserInfoDlg::updateTab(const QStrin
SetLastCountersInfo(NULL);
}
#ifdef USE_KABC
- else if (txt == tabList[KABCInfo].label)
+ else if (tab == tabList[KABCInfo].tab)
{
currentTab = KABCInfo;
btnMain3->setText(tr("&Browse"));
Index: userinfodlg.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/userinfodlg.h,v
retrieving revision 1.29
diff -u -3 -p -r1.29 userinfodlg.h
--- userinfodlg.h 21 Apr 2005 06:12:49 -0000 1.29
+++ userinfodlg.h 21 Nov 2005 21:40:50 -0000
@@ -200,7 +200,7 @@ protected slots:
void ShowHistoryNext();
void HistoryReverse(bool);
void HistoryReload();
- void updateTab(const QString&);
+ void updateTab(QWidget*);
void updatedUser(CICQSignal*);
void SaveSettings();
void slotUpdate();