https://bugs.kde.org/show_bug.cgi?id=503813

--- Comment #12 from ulte...@gmail.com ---
So I went with this code:

void GitPlugin::additionalMenuEntries(QMenu* menu, const QList<QUrl>& urls)
{
        qDebug() << __PRETTY_FUNCTION__;
        QPointer menuGuard (menu);
        qDebug() << "Menu guarded";
        m_urls = urls;

        QDir dir = urlDir (urls);
        qDebug() << "URLs be URL'ed";
        if (!menu)
        {
                qDebug() << "Heehee HAaahaaa !!!";
                return;
        }
        qDebug() << menu << "  Still exists";
        bool hasSt = hasStashes (dir);
        qDebug() << menu << "  stashes hashed";
        menu->addAction (i18nc ("@action:inmenu", "Rebase"), this, SLOT
(ctxRebase()));
        menu->addSeparator()->setText (i18nc ("@title:menu", "Git Stashes"));
        menu->addAction(i18nc("@action:inmenu", "Stash Manager"), this,
SLOT(ctxStashManager()))->setEnabled(hasSt);
    menu->addAction(QIcon::fromTheme(QStringLiteral("vcs-stash")),
i18nc("@action:inmenu", "Push Stash"), this, SLOT(ctxPushStash()));
    menu->addAction(QIcon::fromTheme(QStringLiteral("vcs-stash-pop")),
i18nc("@action:inmenu", "Pop Stash"), this,
SLOT(ctxPopStash()))->setEnabled(hasSt);
}

gitjob.cpp

GitJob::GitJob(const QDir& workingDir, KDevelop::IPlugin* parent,
KDevelop::OutputJob::OutputJobVerbosity verbosity)
    : DVcsJob(workingDir, parent, verbosity)
{
        static QMutex aMutex;
        QMutexLocker lkr (&aMutex);
        qDebug() << __PRETTY_FUNCTION__;
        setType (VcsJob::UserType);
        process()->setEnv (QStringLiteral ("GIT_OPTIONAL_LOCKS"),
QStringLiteral ("0"));
}
___

After the build,
cp    ..../build/kdevgit.so     
/usr/lib/qt6/plugins/kdevplatform/62/kdevgit.so
sync
Because I couldn't reliably manage what you suggested, sorry. I'll try that
again later.

With QT_LOGGING_RULES=default.debug=true

Got the following output:

kdevplatform.shell: populateContextMenu() called while we still handled another
menu.
GitJob::GitJob(const QDir&, KDevelop::IPlugin*,
KDevelop::OutputJob::OutputJobVerbosity)
virtual void GitPlugin::additionalMenuEntries(QMenu*, const QList<QUrl>&)
Menu guarded
URLs be URL'ed
QMenu(0x558d14c30390)   Still exists
GitJob::GitJob(const QDir&, KDevelop::IPlugin*,
KDevelop::OutputJob::OutputJobVerbosity)
QMenu(0x558d14c30390)   stashes hashed
virtual void GitPlugin::additionalMenuEntries(QMenu*, const QList<QUrl>&)
Menu guarded
URLs be URL'ed
QMenu(0x558d14c50360)   Still exists
GitJob::GitJob(const QDir&, KDevelop::IPlugin*,
KDevelop::OutputJob::OutputJobVerbosity)
KCrash: Application 'kdevelop' crashing... crashRecursionCounter = 2
22:19:01: The process crashed.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to