diff --git a/file_templates/classes/qobject/class.cpp b/file_templates/classes/qobject/class.cpp index d400967632..04be01230a 100644 --- a/file_templates/classes/qobject/class.cpp +++ b/file_templates/classes/qobject/class.cpp @@ -1,67 +1,67 @@ {% extends "cpp_implementation.cpp" %} {% load kdev_filters %} -{% block extra_definitons %} +{% block extra_definitions %} {% for method in private_functions %} {% with method.arguments as arguments %} {% include "method_definition_cpp.txt" %} { {% if method.type %} return {{ method.default_return_value }}; {% endif %} } {% endwith %} {% endfor %} -{% endblock extra_definitons %} +{% endblock extra_definitions %} {% block function_definitions %} {% for method in public_functions %} {% with method.arguments as arguments %} {% include "method_definition_cpp.txt" %} { {% if method.type %}return {{ method.default_return_value }}; {% endif %} } {% endwith %} {% endfor %} {% for method in protected_functions %} {% with method.arguments as arguments %} {% include "method_definition_cpp.txt" %} { {% if method.type %}return {{ method.default_return_value }}; {% endif %} } {% endwith %} {% endfor %} {% for property in members %} {{ property.type }} {{ name }}::{{ property.name }}() const { return m_{{ property.name }}; } void {{ name }}::set{{ property.name|upper_first }}({{ property.type|arg_type }} {{ property.name }}) { m_{{ property.name }} = {{ property.name }}; } {% endfor %} {% endblock function_definitions %} {% block bottom %} {% endblock bottom %} diff --git a/languages/clang/codegen/clangclasshelper.h b/languages/clang/codegen/clangclasshelper.h index fd5d8c2220..4e56fd98a9 100644 --- a/languages/clang/codegen/clangclasshelper.h +++ b/languages/clang/codegen/clangclasshelper.h @@ -1,77 +1,77 @@ /* * KDevelop C++ Language Support * * Copyright 2008 Hamish Rodda * Copyright 2012 Miha Čančula * * This program 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CLANGCLASSHELPER_H #define CLANGCLASSHELPER_H #include "clangprivateexport.h" #include #include class KDEVCLANGPRIVATE_EXPORT ClangClassHelper : public KDevelop::ICreateClassHelper { public: ClangClassHelper(); ~ClangClassHelper() override; KDevelop::TemplateClassGenerator* createGenerator(const QUrl& baseUrl) override; QList defaultMethods(const QString& name) const override; }; /** * @brief A C++ specific template class generator * * This class adds additional variables to the template context. * @sa extraVariables() * * Additionally, it attempts to add the class to a target after it is generated. */ class ClangTemplateNewClass : public KDevelop::TemplateClassGenerator { public: - ClangTemplateNewClass(const QUrl& url); + explicit ClangTemplateNewClass(const QUrl& url); ~ClangTemplateNewClass() override; KDevelop::DocumentChangeSet generate() override; private: /** * In addition to the variables provided by the base class, * it groups member variables and functions by access policy. * The variables are of type VariableDescriptionList or FunctionDescriptionList * and are called @c private_members, @c public_functions, etc. * * Signals and slots are not included in the above variables. Instead, they are listed in * @c private_slots, @c protected_slots, @c public_slots and @c signals. * * For convenience, another variable named @c needs_qobject_macro is also provided. * It is set to @c true if the class contains at least one signal or slot, and @c false otherwise. * * It also adds a @c namespaces variable which holds a list of all namespaces * in which the class is nested. For a class identified by Foo::Bar::ExampleClass, * @c namespaces holds two strings: "Foo" and "Bar". */ QVariantHash extraVariables() const; }; #endif // CLANGCLASSHELPER_H diff --git a/languages/clang/duchain/cursorkindtraits.h b/languages/clang/duchain/cursorkindtraits.h index f624b12601..21b2f45657 100644 --- a/languages/clang/duchain/cursorkindtraits.h +++ b/languages/clang/duchain/cursorkindtraits.h @@ -1,269 +1,268 @@ /* * This file is part of KDevelop * * Copyright 2013 Olivier de Gaalon * * 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 CURSORKINDTRAITS_H #define CURSORKINDTRAITS_H #include #include #include #include #include #include #include #include #include #include "templatehelpers.h" namespace CursorKindTraits { using namespace KDevelop; constexpr bool isClassTemplate(CXCursorKind CK) { return CK == CXCursor_ClassTemplate || CK == CXCursor_ClassTemplatePartialSpecialization; } constexpr bool isClass(CXCursorKind CK) { return isClassTemplate(CK) || CK == CXCursor_StructDecl || CK == CXCursor_ClassDecl || CK == CXCursor_UnionDecl || CK == CXCursor_ObjCInterfaceDecl || CK == CXCursor_ObjCCategoryDecl || CK == CXCursor_ObjCImplementationDecl || CK == CXCursor_ObjCCategoryImplDecl; } constexpr bool isFunction(CXCursorKind CK) { return CK == CXCursor_FunctionDecl || CK == CXCursor_CXXMethod || CK == CXCursor_Constructor || CK == CXCursor_Destructor || CK == CXCursor_ConversionFunction || CK == CXCursor_FunctionTemplate || CK == CXCursor_ObjCInstanceMethodDecl || CK == CXCursor_ObjCClassMethodDecl; } constexpr bool isDeclaration(CXCursorKind CK) { return isClass(CK) || isFunction(CK) || CK == CXCursor_UnexposedDecl || CK == CXCursor_FieldDecl || CK == CXCursor_ObjCProtocolDecl || CK == CXCursor_ObjCPropertyDecl || CK == CXCursor_ObjCIvarDecl || CK == CXCursor_EnumConstantDecl || CK == CXCursor_VarDecl || CK == CXCursor_ParmDecl || CK == CXCursor_TypedefDecl || CK == CXCursor_TemplateTypeParameter || CK == CXCursor_NonTypeTemplateParameter || CK == CXCursor_TemplateTemplateParameter || CK == CXCursor_NamespaceAlias || CK == CXCursor_UsingDirective || CK == CXCursor_UsingDeclaration || CK == CXCursor_TypeAliasDecl || CK == CXCursor_LabelStmt; } constexpr Decision isDefinition(CXCursorKind CK) { return CK == CXCursor_Namespace || CK == CXCursor_MacroDefinition ? Decision::True : isClass(CK) || isFunction(CK) || CK == CXCursor_EnumDecl ? Decision::Maybe : Decision::False; } constexpr Decision isInClass(CXCursorKind CK) { return CK == CXCursor_FieldDecl || CK == CXCursor_ObjCPropertyDecl || CK == CXCursor_ObjCIvarDecl || CK == CXCursor_ObjCInstanceMethodDecl || CK == CXCursor_ObjCClassMethodDecl ? Decision::True : CK == CXCursor_Namespace || CK == CXCursor_TemplateTypeParameter || CK == CXCursor_FunctionDecl || CK == CXCursor_TemplateTemplateParameter || CK == CXCursor_NonTypeTemplateParameter || CK == CXCursor_MacroDefinition || CK == CXCursor_MacroExpansion ? Decision::False : Decision::Maybe; } constexpr DUContext::ContextType contextType(CXCursorKind CK) { return CK == CXCursor_StructDecl ? DUContext::Class : CK == CXCursor_UnionDecl ? DUContext::Class : CK == CXCursor_ClassDecl ? DUContext::Class : CK == CXCursor_EnumDecl ? DUContext::Enum : CK == CXCursor_FunctionDecl ? DUContext::Function : CK == CXCursor_CXXMethod ? DUContext::Function : CK == CXCursor_Namespace ? DUContext::Namespace : CK == CXCursor_Constructor ? DUContext::Function : CK == CXCursor_Destructor ? DUContext::Function : CK == CXCursor_ConversionFunction ? DUContext::Function : CK == CXCursor_FunctionTemplate ? DUContext::Function : CK == CXCursor_ClassTemplate ? DUContext::Class : CK == CXCursor_ClassTemplatePartialSpecialization ? DUContext::Class : CK == CXCursor_MacroDefinition ? DUContext::Other : static_cast(-1); } constexpr bool isKDevDeclaration(CXCursorKind CK, bool isClassMember) { return !isClassMember && (CK == CXCursor_UnexposedDecl || CK == CXCursor_FieldDecl || CK == CXCursor_ObjCProtocolDecl || CK == CXCursor_ObjCPropertyDecl || CK == CXCursor_ObjCIvarDecl || CK == CXCursor_EnumConstantDecl || CK == CXCursor_VarDecl || CK == CXCursor_ParmDecl || CK == CXCursor_TypedefDecl || CK == CXCursor_TemplateTypeParameter || CK == CXCursor_NonTypeTemplateParameter || CK == CXCursor_TemplateTemplateParameter || CK == CXCursor_UsingDirective || CK == CXCursor_UsingDeclaration || CK == CXCursor_TypeAliasDecl || CK == CXCursor_Namespace || CK == CXCursor_EnumDecl || CK == CXCursor_LabelStmt); } constexpr bool isKDevClassDeclaration(CXCursorKind CK, bool isDefinition) { return isDefinition && isClass(CK); } constexpr bool isKDevForwardDeclaration(CXCursorKind CK, bool isDefinition) { return !isDefinition && isClass(CK); } constexpr bool isKDevClassFunctionDeclaration(CXCursorKind CK, bool isInClass) { return isInClass && isFunction(CK); } constexpr bool isKDevFunctionDeclaration(CXCursorKind CK, bool isDefinition, bool isInClass) { return !isDefinition && !isInClass && isFunction(CK); } constexpr bool isKDevFunctionDefinition(CXCursorKind CK, bool isDefinition, bool isInClass) { return isDefinition && !isInClass && isFunction(CK); } constexpr bool isKDevNamespaceAliasDeclaration(CXCursorKind CK, bool isDefinition) { return !isDefinition && CK == CXCursor_NamespaceAlias; } constexpr bool isKDevClassMemberDeclaration(CXCursorKind CK, bool isInClass) { return isInClass && isKDevDeclaration(CK, false); } constexpr Declaration::AccessPolicy kdevAccessPolicy(CX_CXXAccessSpecifier access) { return access == CX_CXXPrivate ? Declaration::Private : access == CX_CXXProtected ? Declaration::Protected : access == CX_CXXPublic ? Declaration::Public : Declaration::DefaultAccess; } constexpr IntegralType::CommonIntegralTypes integralType(CXTypeKind TK) { return TK == CXType_Void ? IntegralType::TypeVoid : TK == CXType_Bool ? IntegralType::TypeBoolean : TK == CXType_Float ? IntegralType::TypeFloat : TK == CXType_Char16 ? IntegralType::TypeChar16_t : TK == CXType_Char32 ? IntegralType::TypeChar32_t : TK == CXType_WChar ? IntegralType::TypeWchar_t : ( TK == CXType_LongDouble ||TK == CXType_Double) ? IntegralType::TypeDouble : ( TK == CXType_Short ||TK == CXType_UShort ||TK == CXType_Int ||TK == CXType_UInt ||TK == CXType_Long ||TK == CXType_ULong ||TK == CXType_LongLong ||TK == CXType_ULongLong) ? IntegralType::TypeInt : ( TK == CXType_Char_U ||TK == CXType_Char_S ||TK == CXType_UChar ||TK == CXType_SChar) ? IntegralType::TypeChar : static_cast(-1); } constexpr bool isArrayType(CXTypeKind TK) { return TK == CXType_ConstantArray || TK == CXType_IncompleteArray || TK == CXType_VariableArray || TK == CXType_DependentSizedArray; } constexpr bool isPointerType(CXTypeKind TK) { return TK == CXType_Pointer || TK == CXType_BlockPointer - || TK == CXType_ObjCObjectPointer || TK == CXType_MemberPointer || TK == CXType_ObjCObjectPointer; } constexpr bool isAliasType(CXCursorKind CK) { return CK == CXCursor_TypedefDecl || CK == CXCursor_TypeAliasDecl; } constexpr bool isIdentifiedType(CXCursorKind CK) { return isClass(CK) || isAliasType(CK) || CK == CXCursor_EnumDecl || CK == CXCursor_EnumConstantDecl; } constexpr const char* delayedTypeName(CXTypeKind TK) { return TK == CXType_Int128 ? "__int128" : TK == CXType_UInt128 ? "unsigned __int128" : TK == CXType_ObjCId ? "id" : TK == CXType_ObjCSel ? "SEL" : TK == CXType_NullPtr ? "nullptr_t" : nullptr; } } #endif //CURSORKINDTRAITS_H diff --git a/languages/plugins/custom-definesandincludes/compilerprovider/msvcdefinehelper.cpp b/languages/plugins/custom-definesandincludes/compilerprovider/msvcdefinehelper.cpp index 0017fd1be9..bce8683e2c 100644 --- a/languages/plugins/custom-definesandincludes/compilerprovider/msvcdefinehelper.cpp +++ b/languages/plugins/custom-definesandincludes/compilerprovider/msvcdefinehelper.cpp @@ -1,64 +1,64 @@ /* * This file is part of KDevelop * * Copyright 2010 Patrick Spendrin * * This program 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* * This helper program is needed for the Visual Studio compiler * to find out the standard macros, there is no "gcc -dM -E -". * A trick is used to find out the standard macros. You can * exchange the compiler. The standard macros are written in * a environment variable. This helper program analysis this * variable and prints the output to stdout. */ #include #include #include int main(int argc, char**argv) { char *next, *token, *tmp, *equal; - int i = 0, nextlen, currentlen; + int nextlen, currentlen; next = getenv("MSC_CMD_FLAGS"); while (next != NULL) { token = next; next = strstr(next + 1, " -"); if(strncmp(token, " -D", 3) == 0) { if(next != NULL) nextlen = strlen(next); else nextlen = 0; currentlen = strlen(token); tmp = new char[(currentlen - nextlen + 1)]; strncpy(tmp, token, currentlen - nextlen); tmp[currentlen - nextlen] = '\0'; equal = strchr(tmp, '='); if(equal != NULL) *equal = ' '; printf("#define %s\n", tmp + 3); delete [] tmp; } } // return an error so that the compiler doesn't check for the output return 1; } diff --git a/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.cpp b/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.cpp index 475c504961..92cd6e1b44 100644 --- a/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.cpp +++ b/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.cpp @@ -1,249 +1,238 @@ /* * This file is part of KDevelop * * Copyright 2014 Sergey Kalinichev * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "compilerswidget.h" #include #include -#include #include #include #include #include "ui_compilerswidget.h" #include "compilersmodel.h" #include "../../debugarea.h" #include "../compilerprovider/settingsmanager.h" #include "../compilerprovider/compilerprovider.h" using namespace KDevelop; CompilersWidget::CompilersWidget(QWidget* parent) : ConfigPage(nullptr, nullptr, parent) , m_ui(new Ui::CompilersWidget) , m_compilersModel(new CompilersModel(this)) { m_ui->setupUi(this); m_ui->compilers->setModel(m_compilersModel); m_ui->compilers->header()->setSectionResizeMode(QHeaderView::Stretch); m_ui->addButton->setIcon(QIcon::fromTheme(QStringLiteral("list-add"))); m_ui->removeButton->setIcon(QIcon::fromTheme(QStringLiteral("list-remove"))); m_addMenu = new QMenu(m_ui->addButton); m_mapper = new QSignalMapper(m_addMenu); connect(m_mapper, static_cast(&QSignalMapper::mapped), this, &CompilersWidget::addCompiler); m_addMenu->clear(); auto settings = SettingsManager::globalInstance(); auto provider = settings->provider(); foreach (const auto& factory, provider->compilerFactories()) { QAction* action = new QAction(m_addMenu); action->setText(factory->name()); connect(action, &QAction::triggered, m_mapper, static_cast(&QSignalMapper::map)); m_mapper->setMapping(action, factory->name()); m_addMenu->addAction(action); } m_ui->addButton->setMenu(m_addMenu); connect(m_ui->removeButton, &QPushButton::clicked, this, &CompilersWidget::deleteCompiler); auto delAction = new QAction( i18n("Delete compiler"), this ); delAction->setShortcut( QKeySequence( "Del" ) ); delAction->setShortcutContext( Qt::WidgetWithChildrenShortcut ); m_ui->compilers->addAction( delAction ); connect( delAction, &QAction::triggered, this, &CompilersWidget::deleteCompiler ); connect(m_ui->compilers->selectionModel(), &QItemSelectionModel::currentChanged, this, &CompilersWidget::compilerSelected); - connect(m_ui->compilerName, &QLineEdit::editingFinished, this, &CompilersWidget::compilerEdited); - connect(m_ui->compilerPath, &QLineEdit::editingFinished, this, &CompilersWidget::compilerEdited); - - connect(m_ui->compilerSelector, &QPushButton::clicked, this, &CompilersWidget::selectCompilerPathDialog); + connect(m_ui->compilerName, &QLineEdit::textEdited, this, &CompilersWidget::compilerEdited); + connect(m_ui->compilerPath, &KUrlRequester::textEdited, this, &CompilersWidget::compilerEdited); connect(m_compilersModel, &CompilersModel::compilerChanged, this, &CompilersWidget::compilerChanged); enableItems(false); } CompilersWidget::~CompilersWidget() { } void CompilersWidget::setCompilers(const QVector< CompilerPointer >& compilers) { m_compilersModel->setCompilers(compilers); + m_ui->compilers->expandAll(); } void CompilersWidget::clear() { m_compilersModel->setCompilers({}); } void CompilersWidget::deleteCompiler() { definesAndIncludesDebug() << "Deleting compiler"; auto selectionModel = m_ui->compilers->selectionModel(); foreach (const QModelIndex& row, selectionModel->selectedIndexes()) { if (row.column() == 1) { //Don't remove the same compiler twice continue; } if(m_compilersModel->removeRows(row.row(), 1, row.parent())) { auto selectedCompiler = selectionModel->selectedIndexes(); compilerSelected(selectedCompiler.isEmpty() ? QModelIndex() : selectedCompiler.first()); } } emit changed(); } void CompilersWidget::addCompiler(const QString& factoryName) { auto settings = SettingsManager::globalInstance(); auto provider = settings->provider(); foreach (const auto& factory, provider->compilerFactories()) { if (factoryName == factory->name()) { //add compiler without any information, the user will fill the data in later auto compilerIndex = m_compilersModel->addCompiler(factory->createCompiler(QString(), QString())); m_ui->compilers->selectionModel()->select(compilerIndex, QItemSelectionModel::Clear | QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); compilerSelected(compilerIndex); + m_ui->compilers->scrollTo(compilerIndex); + m_ui->compilerName->setFocus(Qt::OtherFocusReason); break; } } emit changed(); } QVector< CompilerPointer > CompilersWidget::compilers() const { return m_compilersModel->compilers(); } void CompilersWidget::compilerSelected(const QModelIndex& index) { auto compiler = index.data(CompilersModel::CompilerDataRole); if (compiler.value()) { m_ui->compilerName->setText(compiler.value()->name()); m_ui->compilerPath->setText(compiler.value()->path()); enableItems(true); } else { enableItems(false); } } void CompilersWidget::compilerEdited() { auto indexes = m_ui->compilers->selectionModel()->selectedIndexes(); Q_ASSERT(!indexes.isEmpty()); auto compiler = indexes.first().data(CompilersModel::CompilerDataRole); if (!compiler.value()) { return; } compiler.value()->setName(m_ui->compilerName->text()); compiler.value()->setPath(m_ui->compilerPath->text()); m_compilersModel->updateCompiler(m_ui->compilers->selectionModel()->selection()); emit changed(); } -void CompilersWidget::selectCompilerPathDialog() -{ - const QString compilerPath = QFileDialog::getOpenFileName(this, tr("Select path to compiler")); - if (compilerPath.isEmpty()) - return; - - m_ui->compilerPath->setText(compilerPath); - compilerEdited(); -} - void CompilersWidget::enableItems(bool enable) { m_ui->compilerName->setEnabled(enable); m_ui->compilerPath->setEnabled(enable); - m_ui->compilerSelector->setEnabled(enable); if(!enable) { m_ui->compilerName->clear(); m_ui->compilerPath->clear(); } } void CompilersWidget::reset() { auto settings = SettingsManager::globalInstance(); setCompilers(settings->provider()->compilers()); } void CompilersWidget::apply() { auto settings = SettingsManager::globalInstance(); auto provider = settings->provider(); settings->writeUserDefinedCompilers(compilers()); const auto& providerCompilers = provider->compilers(); const auto& widgetCompilers = compilers(); for (auto compiler: providerCompilers) { if (!widgetCompilers.contains(compiler)) { provider->unregisterCompiler(compiler); } } for (auto compiler: widgetCompilers) { if (!providerCompilers.contains(compiler)) { provider->registerCompiler(compiler); } } } void CompilersWidget::defaults() { } QString CompilersWidget::name() const { return i18n("C/C++ Compilers"); } QString CompilersWidget::fullName() const { return i18n("Configure C/C++ Compilers"); } QIcon CompilersWidget::icon() const { return QIcon::fromTheme(QStringLiteral("kdevelop")); } KDevelop::ConfigPage::ConfigPageType CompilersWidget::configPageType() const { return ConfigPage::LanguageConfigPage; } diff --git a/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.h b/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.h index 7cddfab899..15513ad6d2 100644 --- a/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.h +++ b/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.h @@ -1,85 +1,84 @@ /* * This file is part of KDevelop * * Copyright 2014 Sergey Kalinichev * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef COMPILERWIDGET_H #define COMPILERWIDGET_H #include #include #include #include #include "../compilerprovider/icompiler.h" namespace Ui { class CompilersWidget; } class CompilersModel; class QMenu; class QSignalMapper; class CompilersWidget : public KDevelop::ConfigPage { Q_OBJECT public: explicit CompilersWidget(QWidget* parent = nullptr); ~CompilersWidget() override; void setCompilers(const QVector& compilers); QVector compilers() const; void clear(); QString name() const override; QString fullName() const override; QIcon icon() const override; KDevelop::ConfigPage::ConfigPageType configPageType() const override; void apply() override; void reset() override; void defaults() override; private slots: void deleteCompiler(); void addCompiler(const QString& factoryName); void compilerSelected(const QModelIndex& index); void compilerEdited(); - void selectCompilerPathDialog(); signals: void compilerChanged(); private: void enableItems(bool enable); QScopedPointer m_ui; CompilersModel* m_compilersModel; QMenu *m_addMenu; QSignalMapper *m_mapper; }; #endif diff --git a/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.ui b/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.ui index f5c6662a97..2421f0fecf 100644 --- a/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.ui +++ b/languages/plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.ui @@ -1,101 +1,91 @@ CompilersWidget 0 0 547 410 0 &Add &Remove Qt::Vertical 20 40 Name: Compiler path: - - - - - - - - - 30 - 16777215 - - - - ... - - - - + + + + KUrlRequester + QWidget +
kurlrequester.h
+
+
diff --git a/languages/qmljs/kdevqmljs.json b/languages/qmljs/kdevqmljs.json index ca61a7000f..648255b90a 100644 --- a/languages/qmljs/kdevqmljs.json +++ b/languages/qmljs/kdevqmljs.json @@ -1,45 +1,46 @@ { "KPlugin": { "Category": "Language Support", "Icon": "text-x-qml", "Id": "kdevqmljs", "License": "GPL", "Name": "QML Support", "Name[ca@valencia]": "Implementació del QML", "Name[ca]": "Implementació del QML", "Name[cs]": "Podpora QML", "Name[de]": "Unterstützung für QML", "Name[es]": "Implementación de QML", "Name[fi]": "QML-tuki", "Name[fr]": "Prise en charge de QML", "Name[gl]": "Compatibilidade con QML", "Name[hu]": "QML támogatás", "Name[it]": "Supporto per QML", "Name[nl]": "Ondersteuning voor QML", "Name[pl]": "Obsługa QML", "Name[pt]": "Suporte para QML", "Name[pt_BR]": "Suporte à QML", "Name[ru]": "Поддержка QML", "Name[sk]": "Podpora QML", "Name[sl]": "Podpora za QML", "Name[sv]": "QML-stöd", "Name[tr]": "QML Desteği", "Name[uk]": "Підтримка QML", "Name[x-test]": "xxQML Supportxx", "Name[zh_CN]": "QML 支持", "ServiceTypes": [ "KDevelop/Plugin" ] }, "X-KDevelop-Interfaces": [ "ILanguageSupport" ], "X-KDevelop-Languages": [ - "QML/JS" + "QML/JS", + "JavaScript" ], "X-KDevelop-Mode": "NoGUI", "X-KDevelop-SupportedMimeTypes": [ "text/x-qml", "application/javascript" ] }