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

List:       kde-finance-apps
Subject:    Re: GSoC '21 KMyMoney : I am stuck.
From:       Suraj Kumar Mahto <suraj.mahto49 () gmail ! com>
Date:       2021-06-24 22:12:33
Message-ID: CAEDvbQCm9Vp0gW-DdMXUNBD+fvq5gmA14c9qH=aU2MA1nQVOpA () mail ! gmail ! com
[Download RAW message or body]

Hello,
I think I have fixed the crash bug. Thank you very much for the help. I did
the changes in kmymoney repo only and I have pushed those changes to
https://invent.kde.org/surajsloth/kmymoney/-/tree/gsoc21 . I have pushed
the changes. Although the new quote button is disabled. That is needed to
be figured out.

My forked changes(gsoc21 branch) can be merged into gsoc21 branch of the
upstream repo. This way I am dealing with a forked repo also and my entire
work is there is a separate branch of upstream repo. What do you think
about this?

Regards
Suraj Kumar Mahto

On Thu, Jun 24, 2021 at 1:44 AM Thomas Baumgart <thb@net-bembel.de> wrote:

> On Mittwoch, 23. Juni 2021 21:59:29 CEST Suraj Kumar Mahto wrote:
>
> > > Yes, the problem is, that the profile argument to the
> AlkOnlineQuoteSource
> > > ctor is a nullptr. This is then used and the crash happens. The cause
> to
> > > this is, that in AlkOnlineQuotesWidget::Private::slotNewEntry() the
> > > m_profile member is not initialized (nullptr). An assignment happens in
> > > AlkOnlineQuotesWidget::Private::loadProfiles() and
> > > AlkOnlineQuotesWidget::Private::slotLoadProfile() but the list of
> profiles
> > > in your case seems to be empty, and thus no profile is assigned.
> >
> > > See MainWindow::MainWindow in onlinequoteseditor.cpp which is part of
> > alkimia
> > > how to load an initial profile which you should do if the list is
> empty.
> >
> > In alkonlinequoteswidget.cpp (loadProfile() and slotLoadProfile())- I
> added
> > such in case for an empty list, taken from
> > tools/onlinequoteseditor/mainwindow.cpp (I guess you were referring that
> > instead of onlinequoteseditor.cpp)
> >     if (list.isEmpty()){
> >         AlkOnlineQuotesProfileManager &manager =
> > AlkOnlineQuotesProfileManager::instance();
> >
> >         manager.addProfile(new AlkOnlineQuotesProfile("no-config-file",
> > AlkOnlineQuotesProfile::Type::None));
> >         #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
> >             manager.addProfile(new AlkOnlineQuotesProfile("alkimia4",
> > AlkOnlineQuotesProfile::Type::Alkimia4, "alkimia-quotes.knsrc"));
> >             manager.addProfile(new AlkOnlineQuotesProfile("skrooge4",
> > AlkOnlineQuotesProfile::Type::Skrooge4, "skrooge-quotes.knsrc"));
> >             manager.addProfile(new AlkOnlineQuotesProfile("kmymoney4",
> > AlkOnlineQuotesProfile::Type::KMyMoney4, "kmymoney-quotes.knsrc"));
> >         #else
> >             manager.addProfile(new AlkOnlineQuotesProfile("alkimia5",
> > AlkOnlineQuotesProfile::Type::Alkimia5, "alkimia-quotes.knsrc"));
> >             manager.addProfile(new AlkOnlineQuotesProfile("skrooge5",
> > AlkOnlineQuotesProfile::Type::Skrooge5, "skrooge-quotes.knsrc"));
> >             manager.addProfile(new AlkOnlineQuotesProfile("kmymoney5",
> > AlkOnlineQuotesProfile::Type::KMyMoney5, "kmymoney-quotes.knsrc"));
> >         #endif
> >         #ifdef ENABLE_FINANCEQUOTE
> >             manager.addProfile(new
> AlkOnlineQuotesProfile("Finance::Quote",
> > AlkOnlineQuotesProfile::Type::Script));
> >         #endif
> >
> >         m_profile->manager();
> >         return;
> >     }
>
> Yes, this is what you need to do. I think, you could also do it in
> the KMyMoney code before the widget is created. I think that does
> it too because AlkOnlineQuotesProfileManager is a singleton.
>
> > Also in order to use my local cloned version of libalkimia in kmymoney
> > rather than the installed one in /usr/ . I just imported that in
> > ksettingskmymoney.cpp as
> > #include </path/to/local/cloned/libalkimia/alkonlinequoteswidget.h> Am I
> > doing this right? Because I am still getting the crash :(
>
> Yes, because you only use your header but link against the library
> installed
> in the system. You can verify that with the following commands:
>
>  $ cd your-build-directory
>  $ cd bin
>  $ ldd kmymoney | grep alkimia
>
> Here this shows
>
>         libalkimia5.so.8 => /usr/lib64/libalkimia5.so.8
> (0x00007f5858419000)
>
> If you want to use a new version of the shared lib, it need to be in
> your-build-directory/lib or your-build-directory/bin. You can use a symlink
> in one of those to point to the new version in your alkimia build
> directory.
>
> Use the ldd command to verify which library is used.
>
> Hope that helps.
>
>
>
> --
>
> Regards
>
> Thomas Baumgart
>
> https://www.signal.org/       Signal, the better WhatsApp
> -------------------------------------------------------------
> Testing can only prove the presence of bugs, not their absence.
>  -- Edsger W. Dijkstra, 1969
> -------------------------------------------------------------
>

[Attachment #3 (text/html)]

<div dir="ltr"><div><div>Hello,<br></div>I think I have fixed the crash bug. Thank \
you very much for the help. I did the changes in kmymoney repo only and I have pushed \
those changes to <a href="https://invent.kde.org/surajsloth/kmymoney/-/tree/gsoc21">https://invent.kde.org/surajsloth/kmymoney/-/tree/gsoc21</a> \
. I have pushed the changes. Although the new quote button is disabled. That is \
needed to be figured out.<br><br></div>My forked changes(gsoc21 branch) can be merged \
into gsoc21 branch of the upstream repo. This way I am dealing with a forked repo \
also and my entire work is there is a separate branch of upstream repo. What do you \
think about this?<br><br><div><span>Regards<font \
color="#888888"><br></font></span></div><font color="#888888"><div><span>Suraj Kumar \
Mahto</span></div></font></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Thu, Jun 24, 2021 at 1:44 AM Thomas Baumgart &lt;<a \
href="mailto:thb@net-bembel.de">thb@net-bembel.de</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">On Mittwoch, 23. Juni 2021 21:59:29 CEST Suraj \
Kumar Mahto wrote:<br> <br>
&gt; &gt; Yes, the problem is, that the profile argument to the \
AlkOnlineQuoteSource<br> &gt; &gt; ctor is a nullptr. This is then used and the crash \
happens. The cause to<br> &gt; &gt; this is, that in \
AlkOnlineQuotesWidget::Private::slotNewEntry() the<br> &gt; &gt; m_profile member is \
not initialized (nullptr). An assignment happens in<br> &gt; &gt; \
AlkOnlineQuotesWidget::Private::loadProfiles() and<br> &gt; &gt; \
AlkOnlineQuotesWidget::Private::slotLoadProfile() but the list of profiles<br> &gt; \
&gt; in your case seems to be empty, and thus no profile is assigned.<br> &gt; <br>
&gt; &gt; See MainWindow::MainWindow in onlinequoteseditor.cpp which is part of<br>
&gt; alkimia<br>
&gt; &gt; how to load an initial profile which you should do if the list is \
empty.<br> &gt; <br>
&gt; In alkonlinequoteswidget.cpp (loadProfile() and slotLoadProfile())- I added<br>
&gt; such in case for an empty list, taken from<br>
&gt; tools/onlinequoteseditor/mainwindow.cpp (I guess you were referring that<br>
&gt; instead of onlinequoteseditor.cpp)<br>
&gt;        if (list.isEmpty()){<br>
&gt;              AlkOnlineQuotesProfileManager &amp;manager =<br>
&gt; AlkOnlineQuotesProfileManager::instance();<br>
&gt; <br>
&gt;              manager.addProfile(new \
AlkOnlineQuotesProfile(&quot;no-config-file&quot;,<br> &gt; \
AlkOnlineQuotesProfile::Type::None));<br> &gt;              #if QT_VERSION &lt; \
QT_VERSION_CHECK(5,0,0)<br> &gt;                    manager.addProfile(new \
AlkOnlineQuotesProfile(&quot;alkimia4&quot;,<br> &gt; \
AlkOnlineQuotesProfile::Type::Alkimia4, &quot;alkimia-quotes.knsrc&quot;));<br> &gt;  \
manager.addProfile(new AlkOnlineQuotesProfile(&quot;skrooge4&quot;,<br> &gt; \
AlkOnlineQuotesProfile::Type::Skrooge4, &quot;skrooge-quotes.knsrc&quot;));<br> &gt;  \
manager.addProfile(new AlkOnlineQuotesProfile(&quot;kmymoney4&quot;,<br> &gt; \
AlkOnlineQuotesProfile::Type::KMyMoney4, &quot;kmymoney-quotes.knsrc&quot;));<br> \
&gt;              #else<br> &gt;                    manager.addProfile(new \
AlkOnlineQuotesProfile(&quot;alkimia5&quot;,<br> &gt; \
AlkOnlineQuotesProfile::Type::Alkimia5, &quot;alkimia-quotes.knsrc&quot;));<br> &gt;  \
manager.addProfile(new AlkOnlineQuotesProfile(&quot;skrooge5&quot;,<br> &gt; \
AlkOnlineQuotesProfile::Type::Skrooge5, &quot;skrooge-quotes.knsrc&quot;));<br> &gt;  \
manager.addProfile(new AlkOnlineQuotesProfile(&quot;kmymoney5&quot;,<br> &gt; \
AlkOnlineQuotesProfile::Type::KMyMoney5, &quot;kmymoney-quotes.knsrc&quot;));<br> \
&gt;              #endif<br> &gt;              #ifdef ENABLE_FINANCEQUOTE<br>
&gt;                    manager.addProfile(new \
AlkOnlineQuotesProfile(&quot;Finance::Quote&quot;,<br> &gt; \
AlkOnlineQuotesProfile::Type::Script));<br> &gt;              #endif<br>
&gt; <br>
&gt;              m_profile-&gt;manager();<br>
&gt;              return;<br>
&gt;        }<br>
<br>
Yes, this is what you need to do. I think, you could also do it in<br>
the KMyMoney code before the widget is created. I think that does<br>
it too because AlkOnlineQuotesProfileManager is a singleton.<br>
<br>
&gt; Also in order to use my local cloned version of libalkimia in kmymoney<br>
&gt; rather than the installed one in /usr/ . I just imported that in<br>
&gt; ksettingskmymoney.cpp as<br>
&gt; #include &lt;/path/to/local/cloned/libalkimia/alkonlinequoteswidget.h&gt; Am \
I<br> &gt; doing this right? Because I am still getting the crash :(<br>
<br>
Yes, because you only use your header but link against the library installed<br>
in the system. You can verify that with the following commands:<br>
<br>
  $ cd your-build-directory<br>
  $ cd bin<br>
  $ ldd kmymoney | grep alkimia<br>
<br>
Here this shows<br>
<br>
            libalkimia5.so.8 =&gt; /usr/lib64/libalkimia5.so.8 \
(0x00007f5858419000)<br> <br>
If you want to use a new version of the shared lib, it need to be in<br>
your-build-directory/lib or your-build-directory/bin. You can use a symlink<br>
in one of those to point to the new version in your alkimia build directory.<br>
<br>
Use the ldd command to verify which library is used.<br>
<br>
Hope that helps.<br>
<br>
<br>
<br>
-- <br>
<br>
Regards<br>
<br>
Thomas Baumgart<br>
<br>
<a href="https://www.signal.org/" rel="noreferrer" \
                target="_blank">https://www.signal.org/</a>           Signal, the \
                better WhatsApp<br>
-------------------------------------------------------------<br>
Testing can only prove the presence of bugs, not their absence.<br>
  -- Edsger W. Dijkstra, 1969<br>
-------------------------------------------------------------<br>
</blockquote></div>



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

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