Em Tuesday 10 May 2011, The_Akki escreveu:
> Hello @all,
> 
> I'm new on kopete-devel-list.
> 
> Actually i use SIM for Instant Messaging. Now, I want change to kopete, but
> i don't want to loose my chat history. So, i want to try to write
> converter.
> 
> 
> In the first step i don't want to include it to kopete. I want only use
> libkopete.
> 
> 
> Now, i don't sure how i have to start.  I have tried following lines:
> ========
> #include <iostream>
> #include <QObject>
> #include <kopete/kopeteaccountmanager.h>
> #include <kopete/kopeteaccount.h>
> #include <kopete/kopeteidentitymanager.h>
> #include <kopete/kopetecontactlist.h>
> #include <Qt>
> #include <kurl.h>
> 
> using namespace Kopete;
> using namespace std;
> 
> int main()
> {
>     IdentityManager::self()->load();
> 
>     AccountManager* myAccMng = 0;
>     myAccMng = AccountManager::self();
> 
>     std::cout << "HaveAccount: ";
>     if(myAccMng)
>     {
>         std::cout << "YES\n";
>     }else{
>         std::cout << "NO\n";
>         return -1;
>     }
> 
>     //cout << "Any Connected: "  << myAccMng->isAnyAccountConnected() <<
> "\n";
> 
>     myAccMng->load();
>     //Kopete::ContactList::self()->load();
> 
>     QList<Account*> myList = myAccMng->accounts();
>    // QList<Account*>::iterator itAccList = myList.begin();
>     QListIterator<Account*> itAccList( myList );
> 
> 
> 
>     //cout << "Begin: " << myList.begin() << " End: " << myList.end() <<
> "\n"; cout << "Number of Elements: " << myList.count() << "\n";
> 
>     Account* pAcc;
>     int i=0;
> 
>     while( itAccList.hasNext() )
>     {
>         cout << i;
>         pAcc = itAccList.next();
>         std::cout << pAcc->accountLabel().toStdString() << "\n";
>     }
> 
>     return 0;
> }
> ========
> 
> 
> 
> But this  not the right way. I get no Data and after execution i get
> following message.
> ========
> Starte
> /home/theakki/versionsverwaltung/git/Kopete_sim/ConvSimKopete/ConvSimKopete
> ... HaveAccount: YES
> Number of Elements: 0
> unnamed app(8355)/libkopete
> Kopete::PluginManagerPrivate::~PluginManagerPrivate: Destructing plugin
> manager without going through the shutdown process! Backtrace is:
> "[
> 0: /usr/lib/libkdecore.so.5(kRealBacktrace(int)+0x35) [0x7f8f586f2465]
> 1: /usr/lib/libkopete.so.4(+0xd5edf) [0x7f8f5d392edf]
> 2: /lib/x86_64-linux-gnu/libc.so.6(exit+0xe1) [0x7f8f5b476961]
> 3: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x106)
> [0x7f8f5b45bf06] 4:
> /home/theakki/versionsverwaltung/git/Kopete_sim/ConvSimKopete/ConvSimKopete
> () [0x400fa9]
> ]
> "
> ========
> 
> I have tried to understand the source code, but i don't now the problem.
> Can somebody help me?
> 
> Nice regards,
> The_Akki

        I think it is easier for you if you write the log files directly 
without 
using libkopete.

        Kopete's history is stored in ~/.kde/share/apps/kopete/logs, there is 
one 
directory for each protocol you use (JabberProtocol, WlmProtocol, ICQProtocol, 
etc), each of those directories has one sub-directory for each account. Inside 
the account sub-directory there is one XML file for each contact/date pair. 
You should try to figure out the XML format and then create that directory/XML 
files structure for you history. The XML format is not that difficult to 
understand.
-- 
Lamarque V. Souza
http://www.geographicguide.com/brazil.htm
Linux User #57137 - http://counter.li.org/
http://planetkde.org/pt-br
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to