1. 18 Apr, 2019 1 commit
  2. 11 Mar, 2019 1 commit
  3. 16 Feb, 2019 1 commit
  4. 15 Feb, 2019 10 commits
    • Milian Wolff's avatar
      Introduce QuickOpenEmbeddedWidgetCombiner · d284d5bb
      Milian Wolff authored
      This mouthful of a class is essentially just a QWidget with a
      QVBoxLayout which you can add widgets to. The fun comes from
      implementing the QuickOpenEmbeddedWidgetInterface too, by
      delegating to the child widgets that got added.
      
      Overall, this allows us to navigate via Alt+Arrow keyboard actions
      between combined widgets, as you'd get when you have both, an error
      and a declaration at a given cursor declaration.
      d284d5bb
    • Milian Wolff's avatar
      Add 'back' to QuickOpenEmbeddedWidgetInterface · 35277af9
      Milian Wolff authored
      The AbstractNavigationWidget already supported this, and it was
      picked up by KTextEditor. But our own quickopen embedded widget
      interface didn't allow going 'back' via Alt + Backspace yet. This
      patch fixes this.
      35277af9
    • Milian Wolff's avatar
    • Milian Wolff's avatar
      tie DUContext::createNavigationWidget to AbstractNavigationWidget · d9b4c14c
      Milian Wolff authored
      We always return instances of this type anyways, so enforce it in
      the API and simplify the usage code accordingly.
      d9b4c14c
    • Milian Wolff's avatar
      Fix up/down keyboard navigation for 'Show documentation' links · f633da0d
      Milian Wolff authored
      The navigation widget relies on a crude HTML "parser" which
      counts "lines". Yes. Only '<br/>' is considered a newline, even
      though due to line wrapping we can have obviously more lines. Well,
      without rewriting all of that, also count '</p>' as introducing a
      new line. This allows us to jump to the 'Show documentation' link
      then.
      
      To make this work reliably, we also fixup the generated HTML to be
      valid and not nest '<p>' tags. Furthermore, we prevent the ugly
      line indication marker '<->' being shown when we try to down past
      the last paragraph.
      f633da0d
    • Milian Wolff's avatar
      Lock duchain in AbstractIncludeNavigationContext::html · 38e910ba
      Milian Wolff authored
      Fixes assertion when trying to navigate in project file
      quick open navigation widget:
      
      #9  0x00007fc05e472c28 in qt_assert(char const*, char const*, int) () from /usr/lib/libQt5Core.so.5
      #10 0x00007fc061696c26 in KDevelop::TopDUContext::importedParentContexts (this=0x561284615030) at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/kdevplatform/language/duchain/topducontext.cpp:1015
      #11 0x00007fc0617883cc in KDevelop::pickContextWithData (duchains=..., maxDepth=2, type=@0x561287177ac0: KDevelop::StandardParsingEnvironment, forcePick=true) at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/kdevplatform/language/duchain/navigation/abstractincludenavigationcontext.cpp:60
      #12 0x00007fc061788815 in KDevelop::AbstractIncludeNavigationContext::html (this=0x561287177aa0, shorten=false) at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/kdevplatform/language/duchain/navigation/abstractincludenavigationcontext.cpp:90
      #13 0x00007fc0617752fb in KDevelop::AbstractNavigationContext::down (this=0x561287177aa0) at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/kdevplatform/language/duchain/navigation/abstractnavigationcontext.cpp:282
      38e910ba
    • Milian Wolff's avatar
      cleanup: remove html prefix/suffix feature from navigation widget · 12e3583f
      Milian Wolff authored
      This was *only* being used by the project file quickopen feature,
      and you only saw it when clicking into the quickopen list, or when
      pressing alt. I doubt anyone ever did that. And it was madness
      anyways: we decreased the font size in a hacky non-html compliant
      way which actually made it quite hard to read for me. So the only
      thing we lose is the project name... which is an acceptable
      tradeoff. This feature messed up the whole API considerably, removing
      it makes me very happy.
      
      We can bring back the project name in the future by introducing a
      generic wrapper-widget that supports the
      QuickOpenEmbeddedWidgetInterface.
      12e3583f
    • Milian Wolff's avatar
      Remove dead code: AbstractNavigationContext::fontSize{Prefix,Suffix} · 518e7871
      Milian Wolff authored
      These functions never return any non-null string, so just remove them.
      518e7871
    • Milian Wolff's avatar
      Reinstantiate c3c30113 "fix memleaks in duchain unittests" · 333455ce
      Milian Wolff authored
      We also lost this, thanks to Nicolas for pointing this out!
      333455ce
    • Milian Wolff's avatar
      Reinstantiate code from 3c51faa2 · ba7f235b
      Milian Wolff authored
      Fixes test_duchain-clang's testSameFunctionDefinition. My git foo
      isn't good enough to figure out where this got lost?
      ba7f235b
  5. 13 Feb, 2019 3 commits
    • Milian Wolff's avatar
      Delay handling of KDirWatch signals · c7b8e797
      Milian Wolff authored
      This is a workaround for bug 404184, where KDirWatch only emits
      a 'deleted' signal during a 'git stash' workflow, which never
      gets paired by a 'created' signal, even though the file actually
      exists before and after the 'git stash' operation.
      
      By delaying the handling of the KDirWatch signals, we won't fall
      into the trap of removing a file even though it actually exists.
      Since it doesn't really matter how fast we react on such events,
      it's in my opinion fine to delay it for a full second. Having a
      correct state is much more important than having any state fast.
      
      Without this patch, KDevelop frequently forgets about files from large
      projects I work on after a `git stash`. This then fubars the C++
      support completely, since it cannot find any include paths and
      defines anymore.
      c7b8e797
    • Milian Wolff's avatar
      Don't crash when background listing outlasts file manager list job · a0fd2014
      Milian Wolff authored
      When the QDir listing in the background thread takes a long time,
      e.g. by artificially introducing a sleep statement therein, then
      it can happen that the FileManagerListJob gets destroyed before
      the background task finishes. If that happens, then we used to
      access the dangling this pointer to access m_aborted or to invoke
      the handleResults method, both of which are undefined behavior.
      The latter usually crashes.
      
      Prevent this from happening by introducing a mutex that gets locked
      while we are running a background task and during destruction of
      the list job. This synchronizes the two tasks and prevents the
      crash from happening.
      a0fd2014
    • Milian Wolff's avatar
      Don't crash when project is closed before it was fully opened · 3aed7ac4
      Milian Wolff authored
      When we start loading a project and then directly remove its
      root folder, we would never get a projectOpened signal since
      we never fully populated the project. But we will see a projectClosing
      signal coming in, which would lead to a crash in the
      ProjectChangesModel, as we would not have created an item for that
      project yet. Prevent this crash by handling the scenario gracefully.
      3aed7ac4
  6. 11 Feb, 2019 1 commit
    • Aleix Pol Gonzalez's avatar
      Make sure we use the same compiler settings as the project is by default · 62ae1929
      Aleix Pol Gonzalez authored
      Summary:
      Instead of trusting the user to configure it beforehand, make it
      possible to check which compiler is being used in the build manager and
      uses it to figure out the initial compilation settings.
      This includes a QStringList IBSM::findCompiler(item) method to get the
      path to the used compiler. I wonder if we should be providing the
      sysroot as well.
      
      Test Plan:
      Been playing around with the androidqt branch that uses docker
      to implement the SDK instead of just expecting the user to install it himself.
      
      Reviewers: #kdevelop, mwolff
      
      Reviewed By: #kdevelop, mwolff
      
      Subscribers: mschwarz, aaronpuchert, mwolff, kdevelop-devel
      
      Differential Revision: https://phabricator.kde.org/D11136
      62ae1929
  7. 08 Feb, 2019 1 commit
    • Gleb Popov's avatar
      Workaround the bug found by ASan, which can be seen on FreeBSD CI. · af569639
      Gleb Popov authored
      Summary:
      Currently many tests fail (at least on FreeBSD) with ASan turned on. This is what happening:
      
      - `test_toolviewtoolbar` creates an action, a `ToolDocument` and a `View` in the `init()` function.
      - `ToolViewAction` registers itself as event filter for the created `View`.
      - When `cleanup` is called, the controller gets deleted. This causes removal of its children (`QObject::deleteChildren()`), included the mentioned `View`.
      - Somewhere later during destruction, some `QEvent` arrives and gets passed to `ToolViewAction::eventFilter()`. This function accesses `->widget()` method of `m_dock->view()`, but that `View` is already deleted, which causes ASan error.
      
      Note that adding `removeEventFilter()` to `ToolViewAction::~ToolViewAction()` doesn't solve the problem - the event arrival happens before `ToolViewAction` destruction.
      
      Full ASan report:
      
      ```
      ********* Start testing of TestToolViewToolBar *********
      Config: Using QtTest library 5.12.0, Qt 5.12.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by Clang 6.0.1 (tags/RELEASE_601/final 335540))
      PASS   : TestToolViewToolBar::initTestCase()
      =================================================================
      ==21936==ERROR: AddressSanitizer: heap-use-after-free on address 0x6030000958a0 at pc 0x000800465e5a bp 0x7fffffffd230 sp 0x7fffffffd228
      READ of size 8 at 0x6030000958a0 thread T0
          #0 0x800465e59 in QScopedPointer<Sublime::ViewPrivate, QScopedPointerDeleter<Sublime::ViewPrivate> >::operator->() const /usr/local/include/qt5/QtCore/qscopedpointer.h:118:16
          #1 0x80046352f in Sublime::View::widget(QWidget*) /home/arr/projects/kdevelop/kdevplatform/sublime/view.cpp:76:10
          #2 0x800498c53 in ToolViewAction::eventFilter(QObject*, QEvent*) /home/arr/projects/kdevelop/kdevplatform/sublime/idealbuttonbarwidget.cpp:85:40
          #3 0x802027193 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Core.so.5+0x427193)
          #4 0x80127decb in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Widgets.so.5+0x27decb)
          #5 0x80127f27c in QApplication::notify(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Widgets.so.5+0x27f27c)
          #6 0x802026ef0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Core.so.5+0x426ef0)
          #7 0x802051020 in QObjectPrivate::setParent_helper(QObject*) (/usr/local/lib/qt5/libQt5Core.so.5+0x451020)
          #8 0x802050c11 in QObject::~QObject() (/usr/local/lib/qt5/libQt5Core.so.5+0x450c11)
          #9 0x801e4762e in QAbstractAnimation::~QAbstractAnimation() (/usr/local/lib/qt5/libQt5Core.so.5+0x24762e)
          #10 0x801e4cfa4 in QPropertyAnimation::~QPropertyAnimation() (/usr/local/lib/qt5/libQt5Core.so.5+0x24cfa4)
          #11 0x802051461 in QObject::event(QEvent*) (/usr/local/lib/qt5/libQt5Core.so.5+0x451461)
          #12 0x80127dee0 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Widgets.so.5+0x27dee0)
          #13 0x80127f27c in QApplication::notify(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Widgets.so.5+0x27f27c)
          #14 0x802026ef0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Core.so.5+0x426ef0)
          #15 0x802027db8 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/usr/local/lib/qt5/libQt5Core.so.5+0x427db8)
          #16 0x800323331  (/usr/local/lib/qt5/libQt5Test.so.5+0x1e331)
          #17 0x800323bee  (/usr/local/lib/qt5/libQt5Test.so.5+0x1ebee)
          #18 0x800324988  (/usr/local/lib/qt5/libQt5Test.so.5+0x1f988)
          #19 0x80032517b in QTest::qRun() (/usr/local/lib/qt5/libQt5Test.so.5+0x2017b)
          #20 0x800324ef3 in QTest::qExec(QObject*, int, char**) (/usr/local/lib/qt5/libQt5Test.so.5+0x1fef3)
          #21 0x2b97fb in main /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:144:1
      
      0x6030000958a0 is located 16 bytes inside of 24-byte region [0x603000095890,0x6030000958a8)
      freed by thread T0 here:
          #0 0x2b51f2 in operator delete(void*) /usr/src/contrib/compiler-rt/lib/asan/asan_new_delete.cc:149:3
          #1 0x800463371 in Sublime::View::~View() /home/arr/projects/kdevelop/kdevplatform/sublime/view.cpp:61:1
          #2 0x802050de9 in QObjectPrivate::deleteChildren() (/usr/local/lib/qt5/libQt5Core.so.5+0x450de9)
          #3 0x802050bf0 in QObject::~QObject() (/usr/local/lib/qt5/libQt5Core.so.5+0x450bf0)
          #4 0x80041a3be in Sublime::Document::~Document() /home/arr/projects/kdevelop/kdevplatform/sublime/document.cpp:73:21
          #5 0x8004626de in Sublime::ToolDocument::~ToolDocument() /home/arr/projects/kdevelop/kdevplatform/sublime/tooldocument.cpp:48:29
          #6 0x800462708 in Sublime::ToolDocument::~ToolDocument() /home/arr/projects/kdevelop/kdevplatform/sublime/tooldocument.cpp:48:29
          #7 0x802050de9 in QObjectPrivate::deleteChildren() (/usr/local/lib/qt5/libQt5Core.so.5+0x450de9)
          #8 0x802050bf0 in QObject::~QObject() (/usr/local/lib/qt5/libQt5Core.so.5+0x450bf0)
          #9 0x800405d9a in Sublime::Controller::~Controller() /home/arr/projects/kdevelop/kdevplatform/sublime/controller.cpp:113:1
          #10 0x800405dc8 in Sublime::Controller::~Controller() /home/arr/projects/kdevelop/kdevplatform/sublime/controller.cpp:111:1
          #11 0x2b82af in TestToolViewToolBar::cleanup() /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:88:5
          #12 0x2bef0c in TestToolViewToolBar::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/arr/projects/kdevelop/build/kdevplatform/sublime/tests/test_toolviewtoolbar_autogen/EWIEGA46WW/moc_test_toolviewtoolbar.cpp:85:21
          #13 0x8020320ce in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/usr/local/lib/qt5/libQt5Core.so.5+0x4320ce)
          #14 0x800323318  (/usr/local/lib/qt5/libQt5Test.so.5+0x1e318)
          #15 0x800323bee  (/usr/local/lib/qt5/libQt5Test.so.5+0x1ebee)
          #16 0x800324988  (/usr/local/lib/qt5/libQt5Test.so.5+0x1f988)
          #17 0x80032517b in QTest::qRun() (/usr/local/lib/qt5/libQt5Test.so.5+0x2017b)
          #18 0x800324ef3 in QTest::qExec(QObject*, int, char**) (/usr/local/lib/qt5/libQt5Test.so.5+0x1fef3)
          #19 0x2b97fb in main /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:144:1
      
      previously allocated by thread T0 here:
          #0 0x2b4612 in operator new(unsigned long) /usr/src/contrib/compiler-rt/lib/asan/asan_new_delete.cc:92:3
          #1 0x80041b02e in Sublime::Document::newView(Sublime::Document*) /home/arr/projects/kdevelop/kdevplatform/sublime/document.cpp:117:21
          #2 0x80041a604 in Sublime::Document::createView() /home/arr/projects/kdevelop/kdevplatform/sublime/document.cpp:82:18
          #3 0x2b6eac in TestToolViewToolBar::init() /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:72:22
          #4 0x2beefe in TestToolViewToolBar::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/arr/projects/kdevelop/build/kdevplatform/sublime/tests/test_toolviewtoolbar_autogen/EWIEGA46WW/moc_test_toolviewtoolbar.cpp:84:21
          #5 0x8020320ce in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/usr/local/lib/qt5/libQt5Core.so.5+0x4320ce)
          #6 0x80032302d  (/usr/local/lib/qt5/libQt5Test.so.5+0x1e02d)
          #7 0x800323bee  (/usr/local/lib/qt5/libQt5Test.so.5+0x1ebee)
          #8 0x800324988  (/usr/local/lib/qt5/libQt5Test.so.5+0x1f988)
          #9 0x80032517b in QTest::qRun() (/usr/local/lib/qt5/libQt5Test.so.5+0x2017b)
          #10 0x800324ef3 in QTest::qExec(QObject*, int, char**) (/usr/local/lib/qt5/libQt5Test.so.5+0x1fef3)
          #11 0x2b97fb in main /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:144:1
      
      SUMMARY: AddressSanitizer: heap-use-after-free /usr/local/include/qt5/QtCore/qscopedpointer.h:118:16 in QScopedPointer<Sublime::ViewPrivate, QScopedPointerDeleter<Sublime::ViewPrivate> >::operator->() const
      ==21936==ABORTING
      ```
      
      Subscribers: kdevelop-devel, #kdevelop
      
      Tags: #kdevelop
      
      Differential Revision: https://phabricator.kde.org/D18463
      
      (cherry picked from commit fbb955c7)
      af569639
  8. 06 Feb, 2019 1 commit
  9. 05 Feb, 2019 2 commits
    • Christoph Roick's avatar
      46a105b4
    • Gleb Popov's avatar
      Workaround the bug found by ASan, which can be seen on FreeBSD CI. · fbb955c7
      Gleb Popov authored
      Summary:
      Currently many tests fail (at least on FreeBSD) with ASan turned on. This is what happening:
      
      - `test_toolviewtoolbar` creates an action, a `ToolDocument` and a `View` in the `init()` function.
      - `ToolViewAction` registers itself as event filter for the created `View`.
      - When `cleanup` is called, the controller gets deleted. This causes removal of its children (`QObject::deleteChildren()`), included the mentioned `View`.
      - Somewhere later during destruction, some `QEvent` arrives and gets passed to `ToolViewAction::eventFilter()`. This function accesses `->widget()` method of `m_dock->view()`, but that `View` is already deleted, which causes ASan error.
      
      Note that adding `removeEventFilter()` to `ToolViewAction::~ToolViewAction()` doesn't solve the problem - the event arrival happens before `ToolViewAction` destruction.
      
      Full ASan report:
      
      ```
      ********* Start testing of TestToolViewToolBar *********
      Config: Using QtTest library 5.12.0, Qt 5.12.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by Clang 6.0.1 (tags/RELEASE_601/final 335540))
      PASS   : TestToolViewToolBar::initTestCase()
      =================================================================
      ==21936==ERROR: AddressSanitizer: heap-use-after-free on address 0x6030000958a0 at pc 0x000800465e5a bp 0x7fffffffd230 sp 0x7fffffffd228
      READ of size 8 at 0x6030000958a0 thread T0
          #0 0x800465e59 in QScopedPointer<Sublime::ViewPrivate, QScopedPointerDeleter<Sublime::ViewPrivate> >::operator->() const /usr/local/include/qt5/QtCore/qscopedpointer.h:118:16
          #1 0x80046352f in Sublime::View::widget(QWidget*) /home/arr/projects/kdevelop/kdevplatform/sublime/view.cpp:76:10
          #2 0x800498c53 in ToolViewAction::eventFilter(QObject*, QEvent*) /home/arr/projects/kdevelop/kdevplatform/sublime/idealbuttonbarwidget.cpp:85:40
          #3 0x802027193 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Core.so.5+0x427193)
          #4 0x80127decb in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Widgets.so.5+0x27decb)
          #5 0x80127f27c in QApplication::notify(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Widgets.so.5+0x27f27c)
          #6 0x802026ef0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Core.so.5+0x426ef0)
          #7 0x802051020 in QObjectPrivate::setParent_helper(QObject*) (/usr/local/lib/qt5/libQt5Core.so.5+0x451020)
          #8 0x802050c11 in QObject::~QObject() (/usr/local/lib/qt5/libQt5Core.so.5+0x450c11)
          #9 0x801e4762e in QAbstractAnimation::~QAbstractAnimation() (/usr/local/lib/qt5/libQt5Core.so.5+0x24762e)
          #10 0x801e4cfa4 in QPropertyAnimation::~QPropertyAnimation() (/usr/local/lib/qt5/libQt5Core.so.5+0x24cfa4)
          #11 0x802051461 in QObject::event(QEvent*) (/usr/local/lib/qt5/libQt5Core.so.5+0x451461)
          #12 0x80127dee0 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Widgets.so.5+0x27dee0)
          #13 0x80127f27c in QApplication::notify(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Widgets.so.5+0x27f27c)
          #14 0x802026ef0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/local/lib/qt5/libQt5Core.so.5+0x426ef0)
          #15 0x802027db8 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/usr/local/lib/qt5/libQt5Core.so.5+0x427db8)
          #16 0x800323331  (/usr/local/lib/qt5/libQt5Test.so.5+0x1e331)
          #17 0x800323bee  (/usr/local/lib/qt5/libQt5Test.so.5+0x1ebee)
          #18 0x800324988  (/usr/local/lib/qt5/libQt5Test.so.5+0x1f988)
          #19 0x80032517b in QTest::qRun() (/usr/local/lib/qt5/libQt5Test.so.5+0x2017b)
          #20 0x800324ef3 in QTest::qExec(QObject*, int, char**) (/usr/local/lib/qt5/libQt5Test.so.5+0x1fef3)
          #21 0x2b97fb in main /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:144:1
      
      0x6030000958a0 is located 16 bytes inside of 24-byte region [0x603000095890,0x6030000958a8)
      freed by thread T0 here:
          #0 0x2b51f2 in operator delete(void*) /usr/src/contrib/compiler-rt/lib/asan/asan_new_delete.cc:149:3
          #1 0x800463371 in Sublime::View::~View() /home/arr/projects/kdevelop/kdevplatform/sublime/view.cpp:61:1
          #2 0x802050de9 in QObjectPrivate::deleteChildren() (/usr/local/lib/qt5/libQt5Core.so.5+0x450de9)
          #3 0x802050bf0 in QObject::~QObject() (/usr/local/lib/qt5/libQt5Core.so.5+0x450bf0)
          #4 0x80041a3be in Sublime::Document::~Document() /home/arr/projects/kdevelop/kdevplatform/sublime/document.cpp:73:21
          #5 0x8004626de in Sublime::ToolDocument::~ToolDocument() /home/arr/projects/kdevelop/kdevplatform/sublime/tooldocument.cpp:48:29
          #6 0x800462708 in Sublime::ToolDocument::~ToolDocument() /home/arr/projects/kdevelop/kdevplatform/sublime/tooldocument.cpp:48:29
          #7 0x802050de9 in QObjectPrivate::deleteChildren() (/usr/local/lib/qt5/libQt5Core.so.5+0x450de9)
          #8 0x802050bf0 in QObject::~QObject() (/usr/local/lib/qt5/libQt5Core.so.5+0x450bf0)
          #9 0x800405d9a in Sublime::Controller::~Controller() /home/arr/projects/kdevelop/kdevplatform/sublime/controller.cpp:113:1
          #10 0x800405dc8 in Sublime::Controller::~Controller() /home/arr/projects/kdevelop/kdevplatform/sublime/controller.cpp:111:1
          #11 0x2b82af in TestToolViewToolBar::cleanup() /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:88:5
          #12 0x2bef0c in TestToolViewToolBar::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/arr/projects/kdevelop/build/kdevplatform/sublime/tests/test_toolviewtoolbar_autogen/EWIEGA46WW/moc_test_toolviewtoolbar.cpp:85:21
          #13 0x8020320ce in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/usr/local/lib/qt5/libQt5Core.so.5+0x4320ce)
          #14 0x800323318  (/usr/local/lib/qt5/libQt5Test.so.5+0x1e318)
          #15 0x800323bee  (/usr/local/lib/qt5/libQt5Test.so.5+0x1ebee)
          #16 0x800324988  (/usr/local/lib/qt5/libQt5Test.so.5+0x1f988)
          #17 0x80032517b in QTest::qRun() (/usr/local/lib/qt5/libQt5Test.so.5+0x2017b)
          #18 0x800324ef3 in QTest::qExec(QObject*, int, char**) (/usr/local/lib/qt5/libQt5Test.so.5+0x1fef3)
          #19 0x2b97fb in main /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:144:1
      
      previously allocated by thread T0 here:
          #0 0x2b4612 in operator new(unsigned long) /usr/src/contrib/compiler-rt/lib/asan/asan_new_delete.cc:92:3
          #1 0x80041b02e in Sublime::Document::newView(Sublime::Document*) /home/arr/projects/kdevelop/kdevplatform/sublime/document.cpp:117:21
          #2 0x80041a604 in Sublime::Document::createView() /home/arr/projects/kdevelop/kdevplatform/sublime/document.cpp:82:18
          #3 0x2b6eac in TestToolViewToolBar::init() /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:72:22
          #4 0x2beefe in TestToolViewToolBar::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/arr/projects/kdevelop/build/kdevplatform/sublime/tests/test_toolviewtoolbar_autogen/EWIEGA46WW/moc_test_toolviewtoolbar.cpp:84:21
          #5 0x8020320ce in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/usr/local/lib/qt5/libQt5Core.so.5+0x4320ce)
          #6 0x80032302d  (/usr/local/lib/qt5/libQt5Test.so.5+0x1e02d)
          #7 0x800323bee  (/usr/local/lib/qt5/libQt5Test.so.5+0x1ebee)
          #8 0x800324988  (/usr/local/lib/qt5/libQt5Test.so.5+0x1f988)
          #9 0x80032517b in QTest::qRun() (/usr/local/lib/qt5/libQt5Test.so.5+0x2017b)
          #10 0x800324ef3 in QTest::qExec(QObject*, int, char**) (/usr/local/lib/qt5/libQt5Test.so.5+0x1fef3)
          #11 0x2b97fb in main /home/arr/projects/kdevelop/kdevplatform/sublime/tests/test_toolviewtoolbar.cpp:144:1
      
      SUMMARY: AddressSanitizer: heap-use-after-free /usr/local/include/qt5/QtCore/qscopedpointer.h:118:16 in QScopedPointer<Sublime::ViewPrivate, QScopedPointerDeleter<Sublime::ViewPrivate> >::operator->() const
      ==21936==ABORTING
      ```
      
      Subscribers: kdevelop-devel, #kdevelop
      
      Tags: #kdevelop
      
      Differential Revision: https://phabricator.kde.org/D18463
      fbb955c7
  10. 01 Feb, 2019 1 commit
    • Milian Wolff's avatar
      Properly cleanup FileManagerListJob when folder items are deleted · 06b526e8
      Milian Wolff authored
      This is an alternative approach to fix the issue described in
      https://phabricator.kde.org/D15899
      
      The approach used here is generic and does not require any users
      of the API to know about the potential pitfalls, it actually
      decreases coupling a bit!
      
      The old approach to cleanup the list jobs only worked when we
      called AbstractFileManagerPluginPrivate::removeFolder, but that
      wouldn't work when a folder item gets deleted directly - e.g.
      from the CMakeManager or any other code. Now, we listen to
      the model signal when a row is about to be removed and cleanup
      the item pointers in the list job. While doing so, we must make
      take into account that the pointer may already be partially destroyed,
      since only the ProjectBaseItem dtor will call takeRow, at which point
      the overriden methods in ProjectFolderItem e.g. won't be available
      anymore.
      
      Additionally, it turned out that the fallback for a similar handler
      of partially destroyed classes in
      AbstractFileManagerPluginPrivate::jobFinished only removed the job
      from a copied list, since it was using foreach, and didn't even take
      the list by reference...
      
      Finally, the test is expanded to reliably trigger the crashy behavior
      explained in the review request on phabricator.
      
      BUG: 260741
      06b526e8
  11. 27 Jan, 2019 3 commits
  12. 21 Jan, 2019 1 commit
    • Thomas Schöps's avatar
      Properly display argument names of template functions · 49d503f8
      Thomas Schöps authored
      When hovering over a C++ template function, the function argument names were
      shown incorrectly. For example, for the following function definition:
      
          template <int a>
          void foo(char b, char c) {}
      
      The function would be displayed like this in the tooltip:
      
          void foo(char a, char b)
      
      This is because argument names, different from argument types, are fetched from
      argumentContext->localDeclarations() for display. In case of template functions,
      both the template arguments and the function arguments are in this list, which
      was not accounted for. This diff changes the behavior to count the function
      arguments from the end of the local declarations instead of the start, which
      fixes the bug. (Note: I am not sure whether it is possible that the local
      declarations list also contains other entries. I did not observe this during
      some short testing. Also, not sure what the situation is for other languages
      than C++.)
      
      Test Plan: Some manual testing.
      
      Reviewers: #kdevelop, mwolff
      
      Reviewed By: #kdevelop, mwolff
      
      Subscribers: aacid, mwolff, kdevelop-devel
      
      Tags: #kdevelop
      
      Differential Revision: https://phabricator.kde.org/D18218
      49d503f8
  13. 20 Jan, 2019 1 commit
  14. 10 Jan, 2019 2 commits
    • Milian Wolff's avatar
      Show size and alignment information in tooltips for typedef or alias · be490331
      Milian Wolff authored
      Summary:
      This patch lets us view the size information when inspecting type
      aliases. E.g. for C++ code like the following, we'll now see the
      size (8) and alignment (also 8) when hovering Bar. Previously,
      that was only shown when hovering Foo:
      
          struct Foo { double m; };
          using Bar = Foo;
      
      Sadly, this patch by its own isn't yet enough for the more interesting
      cases, namely aliases of explicit template instantiations, such as
      
          using Ptr = std::shared_ptr<int>;
      
      Here, we still don't show any size information, since we don't track
      that information properly. In the builder, we only encounter std::shared_ptr
      as a template, which doesn't have any size information yet. We would
      need to build a declaration for the template instantiation of
      std::shared_ptr, at which point we could ask libclang for the concrete size...
      
      Still, this patch goes into the right direction already, I believe.
      
      Reviewers: #kdevelop
      
      Subscribers: kdevelop-devel
      
      Tags: #kdevelop
      
      Differential Revision: https://phabricator.kde.org/D18097
      be490331
    • Milian Wolff's avatar
      Actually cleanup the duchain from the background thread · 48e5892f
      Milian Wolff authored
      Turns out that my commit bf183ce7 from May 2017 moved the
      background cleanup task into the foreground thread... Sorry for that!
      
      When we connect to the timer event, we must use a context object
      that lives within the background thread. The thread itself *does not*
      live in itself!
      
      Fix this by passing the timer itself as context and
      add an assertion to verify we don't ever do this again.
      
      BUG: 388743
      48e5892f
  15. 08 Jan, 2019 1 commit
    • Amish Naidu's avatar
      Add assistant to generate header guards · a54c4652
      Amish Naidu authored
      Summary:
      Assistant with two actions allowing you to either add a conventional macro-
      based header guard or pragma-once.
      
      Test Plan: Run `test_assistants testHeaderGuardAssistant`
      
      Reviewers: #kdevelop, arrowd
      
      Reviewed By: arrowd
      
      Subscribers: apol, arrowd, kdevelop-devel
      
      Tags: #kdevelop
      
      Differential Revision: https://phabricator.kde.org/D17370
      a54c4652
  16. 29 Dec, 2018 1 commit
  17. 28 Dec, 2018 1 commit
  18. 23 Dec, 2018 1 commit
  19. 21 Dec, 2018 1 commit
    • Christoph Roick's avatar
      Fix crash in documentation view · 7419d27c
      Christoph Roick authored
      A QWebEngineProfile must exist longer, than a QWebEnginePage using it.
      The page is now explicitly deleted before the profile.
      
      BUG: 402026
      7419d27c
  20. 14 Dec, 2018 1 commit
  21. 11 Dec, 2018 1 commit
  22. 26 Nov, 2018 4 commits