[Differential] [Commented On] D4232: Bring back memory view

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Sat Jan 21 15:01:02 UTC 2017


kossebau added a comment.


  Now some more detailed look at the code. Code not tested so far.

INLINE COMMENTS

> CMakeLists.txt:3
> +
> +find_package( OktetaCore )
> +set_package_properties(KastenControllers PROPERTIES

Only needed for expliciteness, OktetaGui pulls this in as required dep, so would fail itself if OktetaCore is not present.

> CMakeLists.txt:71
> +if(OktetaGui_FOUND AND OktetaCore_FOUND)
> +    target_link_libraries(kdevgdb okteta2core okteta2gui)
> +    list(APPEND kdevtest_gdb_LINK_LIBS

Here use the imported target names `OktetaCore` and `OktetaGui`.
Again OktetaCore is only needed for expliciteness, will be pulled in by OktetaGui.

> memviewdlg.cpp:99-100
>      // so don't set s_appNotStarted here.
> -    khexedit2_widget(0),
> -    amount_(0), data_(0),
> -    debuggerState_(0)
> +    m_memViewView(0),
> +    m_memAmount(0), m_memData(0),
> +    m_debuggerState(0)

While touching the lines, nullptr for all pointers

> memviewdlg.cpp:243-251
> +    Okteta::ByteArrayModel*  OldModel = m_memViewModel;
> +    m_memViewModel = new Okteta::ByteArrayModel( reinterpret_cast<Okteta::Byte*>(this->m_memData), m_memAmount );
> +
> +    // get attributes
> +    m_memViewModel->setReadOnly( OldModel->isReadOnly() );
> +    m_memViewModel->setAutoDelete( OldModel->autoDelete() );
> +

This should be doable by simply resetting the data of the existing model, using ByteArrayModel::setData(), like (untested):

  m_memViewModel->setData(reinterpret_cast<Okteta::Byte*>(m_memData), m_memAmount);

https://api.kde.org/4.x-api/kdesdk-apidocs/okteta/html/classOkteta_1_1ByteArrayModel.html#a44f6d09a054f80603978f7ce387085dc

Or did you try and meet a flaw with that?

REVISION DETAIL
  https://phabricator.kde.org/D4232

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: volden, #kdevelop
Cc: kossebau, kdevelop-devel, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170121/dcfaf28c/attachment.html>


More information about the KDevelop-devel mailing list