Copilot: Merge copilotoptionspagewidget.{h,cpp} into copilotoptionspage.cpp

Too small to be worth a translation unit. Also drop unnecessary Q_OBJECT.

Change-Id: Ife1bce6498eae81e2979c2798f8d4f19da16a11d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-02-22 14:35:18 +01:00
parent 82194d7e9c
commit e25bf6e59d
5 changed files with 29 additions and 56 deletions

View File

@@ -7,7 +7,6 @@ add_qtc_plugin(Copilot
copilotclient.cpp copilotclient.h copilotclient.cpp copilotclient.h
copilotsettings.cpp copilotsettings.h copilotsettings.cpp copilotsettings.h
copilotoptionspage.cpp copilotoptionspage.h copilotoptionspage.cpp copilotoptionspage.h
copilotoptionspagewidget.cpp copilotoptionspagewidget.h
documentwatcher.cpp documentwatcher.h documentwatcher.cpp documentwatcher.h
requests/getcompletions.h requests/getcompletions.h
requests/checkstatus.h requests/checkstatus.h

View File

@@ -19,8 +19,6 @@ QtcPlugin {
"copilotsettings.h", "copilotsettings.h",
"copilotoptionspage.cpp", "copilotoptionspage.cpp",
"copilotoptionspage.h", "copilotoptionspage.h",
"copilotoptionspagewidget.cpp",
"copilotoptionspagewidget.h",
"documentwatcher.cpp", "documentwatcher.cpp",
"documentwatcher.h", "documentwatcher.h",
"requests/getcompletions.h", "requests/getcompletions.h",

View File

@@ -3,13 +3,41 @@
#include "copilotoptionspage.h" #include "copilotoptionspage.h"
#include "copilotoptionspagewidget.h" #include "authwidget.h"
#include "copilotsettings.h"
#include "copilotsettings.h" #include "copilotsettings.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/layoutbuilder.h>
#include <utils/pathchooser.h>
using namespace Utils;
using namespace LanguageClient;
namespace Copilot { namespace Copilot {
class CopilotOptionsPageWidget : public QWidget
{
public:
CopilotOptionsPageWidget(QWidget *parent = nullptr)
: QWidget(parent)
{
using namespace Layouting;
auto authWidget = new AuthWidget();
// clang-format off
Column {
authWidget, br,
CopilotSettings::instance().nodeJsPath, br,
CopilotSettings::instance().distPath, br,
st
}.attachTo(this);
// clang-format on
}
};
CopilotOptionsPage::CopilotOptionsPage() CopilotOptionsPage::CopilotOptionsPage()
{ {
setId("Copilot.General"); setId("Copilot.General");

View File

@@ -1,36 +0,0 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "copilotoptionspagewidget.h"
#include "authwidget.h"
#include "copilotsettings.h"
#include <utils/layoutbuilder.h>
#include <utils/pathchooser.h>
using namespace Utils;
using namespace LanguageClient;
namespace Copilot {
CopilotOptionsPageWidget::CopilotOptionsPageWidget(QWidget *parent)
: QWidget(parent)
{
using namespace Layouting;
auto authWdgt = new AuthWidget();
// clang-format off
Column {
authWdgt, br,
CopilotSettings::instance().nodeJsPath, br,
CopilotSettings::instance().distPath, br,
st
}.attachTo(this);
// clang-format on
}
CopilotOptionsPageWidget::~CopilotOptionsPageWidget() = default;
} // namespace Copilot

View File

@@ -1,16 +0,0 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include <QWidget>
namespace Copilot {
class CopilotOptionsPageWidget : public QWidget
{
Q_OBJECT
public:
CopilotOptionsPageWidget(QWidget *parent = nullptr);
~CopilotOptionsPageWidget() override;
};
} // namespace Copilot