[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kopete-devel
Subject:    [kopete-devel] Small bug in kopete trunk account list
From:       "=?UTF-8?Q?Rafael_Fern=C3=A1ndez_L=C3=B3pez?=" <ereslibre () gmail ! com>
Date:       2006-10-14 15:16:31
Message-ID: 93f85fee0610140816gb713174n44fd8f343cc15851 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

Hi folks,

I've noticed a new small bug, but that needs some code rewriting. Steps to
reproduce:

1. You need to be disconnected
2. Add a new Jabber account
3. Delete it, when asked about removing it into the Jabber server say
"Remove and unregister". You'll see that the jabber account will have
disappeared.
4. Close the account manager
5. Reopen it and voilà , there's your fresh and pretty Jabber account.

I've tracked some code and I've this:

- kopete/libkopete/kopeteaccountmanager.h

    /**
     * \brief Delete the account and clean the config data
     *
     * This is praticaly called by the account config page when you remove
the account.
     */
    void removeAccount( Account *account );

- kopete/kopete/config/accounts/kopeteaccountconfig.cpp

void KopeteAccountConfig::slotRemoveAccount()
{
    KopeteAccountLVI *lvi = selectedAccount();

    if ( !lvi || !lvi->account() )
        return;

    Kopete::Account *i = lvi->account();
    if ( KMessageBox::warningContinueCancel( this, i18n( "Are you sure you
want to remove the account \"%1\"?", i->accountLabel() ),
        i18n( "Remove Account" ), KGuiItem(i18n( "Remove Account" ),
"editdelete"),
         "askRemoveAccount", KMessageBox::Notify | KMessageBox::Dangerous )
== KMessageBox::Continue )
    {
        Kopete::AccountManager::self()->removeAccount( i );
        delete lvi;
    }
}

Here, "delete lvi;" will think that
Kopete::AccountManager::self()->removeAccount( i ); should have removed the
account, but in Jabber protocol (that deleting it maybe is not as true as we
could think, because you can be disconnected). For that reason I propose
removeAccount( Account *account ); to be bool instead of void, and see if
everything went allright in the server and the account was removed.

Waiting for your comments ;)

Bye,
Rafael Fernández López.

[Attachment #5 (text/html)]

Hi folks,<br><br>I've noticed a new small bug, but that needs some code rewriting. \
Steps to reproduce:<br><br>1. You need to be disconnected<br>2. Add a new Jabber \
account<br>3. Delete it, when asked about removing it into the Jabber server say \
&quot;Remove and unregister&quot;. You'll see that the jabber account will have \
disappeared. <br>4. Close the account manager<br>5. Reopen it and voilà , there's \
your fresh and pretty Jabber account.<br><br>I've tracked some code and I've \
this:<br><br>- kopete/libkopete/kopeteaccountmanager.h<br><br>&nbsp;&nbsp;&nbsp; \
/**<br>&nbsp;&nbsp;&nbsp; &nbsp;* \brief Delete the account and clean the config data \
<br>&nbsp;&nbsp;&nbsp; &nbsp;*<br>&nbsp;&nbsp;&nbsp; &nbsp;* This is praticaly called \
by the account config page when you remove the account.<br>&nbsp;&nbsp;&nbsp; \
&nbsp;*/<br>&nbsp;&nbsp;&nbsp; void removeAccount( Account *account );<br><br>- \
kopete/kopete/config/accounts/kopeteaccountconfig.cpp <br><br>void \
KopeteAccountConfig::slotRemoveAccount()<br>{<br>&nbsp;&nbsp;&nbsp; KopeteAccountLVI \
*lvi = selectedAccount();<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if ( !lvi || \
!lvi-&gt;account() )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
return;<br><br>&nbsp;&nbsp;&nbsp; Kopete::Account *i = lvi-&gt;account(); \
<br>&nbsp;&nbsp;&nbsp; if ( KMessageBox::warningContinueCancel( this, i18n( &quot;Are \
you sure you want to remove the account \&quot;%1\&quot;?&quot;, i-&gt;accountLabel() \
),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; i18n( &quot;Remove Account&quot; ), \
KGuiItem(i18n( &quot;Remove Account&quot; ), &quot;editdelete&quot;), \
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&quot;askRemoveAccount&quot;, \
KMessageBox::Notify | KMessageBox::Dangerous ) == KMessageBox::Continue \
)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
Kopete::AccountManager::self()-&gt;removeAccount( i );<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; delete lvi;<br>&nbsp;&nbsp;&nbsp; } <br>}<br><br>Here, \
&quot;delete lvi;&quot; will think that \
Kopete::AccountManager::self()-&gt;removeAccount( i ); should have removed the \
account, but in Jabber protocol (that deleting it maybe is not as true as we could \
think, because you can be disconnected). For that reason I propose removeAccount( \
Account *account ); to be bool instead of void, and see if everything went allright \
in the server and the account was removed. <br><br>Waiting for your comments \
;)<br><br>Bye,<br>Rafael Fernández López.<br>



_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic