Commit b9b37534 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add test application

parent c139cf8f
......@@ -37,6 +37,7 @@ if(BUILD_TESTING)
add_subdirectory(messagepartthemes/default/autotests)
add_subdirectory(viewer/webengine/autotests/)
add_subdirectory(checkphishingurl/autotests/)
add_subdirectory(checkphishingurl/tests/)
endif()
add_subdirectory(pics)
add_subdirectory(kconf_update)
......
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include(ECMAddTests)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
set(checkphishingurlgui_SRCS checkphishingurlgui.cpp)
add_executable(checkphishingurlgui ${checkphishingurlgui_SRCS})
target_link_libraries(checkphishingurlgui
KF5::KIOCore
KF5::MessageViewer
Qt5::WebEngine
Qt5::WebEngineWidgets
KF5::I18n
)
/*
Copyright (C) 2016 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 "checkphishingurlgui.h"
#include <QApplication>
#include <QStandardPaths>
#include <QLineEdit>
#include <QTextEdit>
#include <QLabel>
#include <QVBoxLayout>
CheckPhishingUrlGui::CheckPhishingUrlGui(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
QHBoxLayout *checkUrlLayout = new QHBoxLayout;
layout->addLayout(checkUrlLayout);
QLabel *lab = new QLabel(QStringLiteral("Url to Check:"), this);
checkUrlLayout->addWidget(lab);
mCheckUrlLineEdit = new QLineEdit(this);
checkUrlLayout->addWidget(mCheckUrlLineEdit);
mResult = new QTextEdit(this);
mResult->setReadOnly(true);
mResult->setAcceptRichText(false);
layout->addWidget(mResult);
}
CheckPhishingUrlGui::~CheckPhishingUrlGui()
{
}
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QStandardPaths::setTestModeEnabled(true);
CheckPhishingUrlGui *w = new CheckPhishingUrlGui;
w->show();
app.exec();
delete w;
return 0;
}
/*
Copyright (C) 2016 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 CHECKPHISHINGURLGUI_H
#define CHECKPHISHINGURLGUI_H
#include <QWidget>
class QLineEdit;
class QTextEdit;
class CheckPhishingUrlGui : public QWidget
{
Q_OBJECT
public:
explicit CheckPhishingUrlGui(QWidget *parent = Q_NULLPTR);
~CheckPhishingUrlGui();
private:
QLineEdit *mCheckUrlLineEdit;
QTextEdit *mResult;
};
#endif // CHECKPHISHINGURLGUI_H
Supports Markdown
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