Commit 0c52dc29 authored by Laurent Montel's avatar Laurent Montel 😁

Fix connect signal/slot. Add autotest

parent 51fb6e9a
......@@ -35,3 +35,4 @@ add_templateparser_unittest(templateparserjobtest.cpp)
add_templateparser_unittest(templateparserextracthtmlinfotest.cpp)
add_templateparser_unittest(templateparseremailaddressrequesterlineedittest.cpp)
add_templateparser_unittest(templateparseremailaddressrequesterinterfacewidgettest.cpp)
add_templateparser_unittest(templatesinsertcommandactiontest.cpp)
/*
Copyright (C) 2018 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "templatesinsertcommandactiontest.h"
#include <QTest>
QTEST_MAIN(TemplatesInsertCommandActionTest)
TemplatesInsertCommandActionTest::TemplatesInsertCommandActionTest(QObject *parent)
: QObject(parent)
{
}
/*
Copyright (C) 2018 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef TEMPLATESINSERTCOMMANDACTIONTEST_H
#define TEMPLATESINSERTCOMMANDACTIONTEST_H
#include <QObject>
class TemplatesInsertCommandActionTest : public QObject
{
Q_OBJECT
public:
explicit TemplatesInsertCommandActionTest(QObject *parent = nullptr);
~TemplatesInsertCommandActionTest() = default;
};
#endif // TEMPLATESINSERTCOMMANDACTIONTEST_H
......@@ -27,7 +27,7 @@ TemplatesInsertCommandAction::TemplatesInsertCommandAction(QObject *parent)
{
mMenuCommand = new TemplatesCommandMenu(this);
mMenuCommand->setObjectName(QStringLiteral("templatescommandmenu"));
//connect(mMenuCommand, &TemplatesCommandMenu::insertCommand, this, &TemplatesInsertCommandAction::slotInsertCommand);
connect(mMenuCommand, QOverload<const QString &, int>::of(&TemplatesCommandMenu::insertCommand), this, &TemplatesInsertCommandAction::insertCommand);
setMenu(mMenuCommand->menu());
}
......@@ -36,8 +36,3 @@ TemplatesInsertCommandAction::~TemplatesInsertCommandAction()
{
}
void TemplatesInsertCommandAction::slotInsertCommand(const QString &cmd, int adjustCursor)
{
//TODO
}
......@@ -33,9 +33,10 @@ class TEMPLATEPARSER_EXPORT TemplatesInsertCommandAction : public QAction
public:
explicit TemplatesInsertCommandAction(QObject *parent = nullptr);
~TemplatesInsertCommandAction();
Q_SIGNALS:
void insertCommand(const QString &cmd, int adjustCursor);
private:
TemplatesCommandMenu *mMenuCommand = nullptr;
void slotInsertCommand(const QString &cmd, int adjustCursor);
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment