diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index fd37aa9f1e..8bea62a97e 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,156 +1,155 @@ # BEGIN: Analyzers add_subdirectory(compileanalyzercommon) add_subdirectory(clangtidy) add_subdirectory(clazy) add_subdirectory(cppcheck) if(UNIX AND NOT (APPLE OR CYGWIN)) add_subdirectory(heaptrack) endif() # END: Analyzers # BEGIN: Debuggers add_subdirectory(debuggercommon) add_subdirectory(lldb) add_subdirectory(gdb) # END: Debuggers # BEGIN: Documentation find_package(Qt5Help CONFIG) set_package_properties(Qt5Help PROPERTIES PURPOSE "The Help module for the Qt toolkit, needed for the qthelp plugin" URL "https://www.qt.io/" TYPE OPTIONAL) if(Qt5Help_FOUND) ecm_optional_add_subdirectory(qthelp) endif() ecm_optional_add_subdirectory(manpage) # END: Documentation # BEGIN: Formatters add_subdirectory(astyle) add_subdirectory(customscript) # END: Formatters # BEGIN: Languages ecm_optional_add_subdirectory(custom-definesandincludes) ecm_optional_add_subdirectory(qmljs) find_package(Clang 6.0) set(clangSearchHint "") if (NOT CLANG_FOUND) set(clangSearchHint "Please install a package providing libclang. Either pass -DLLVM_ROOT=/path/to/llvm-prefix or install the 'llvm-config' command-line utility for auto-detection.") endif() set_package_properties(Clang PROPERTIES DESCRIPTION "Clang libraries from the LLVM project. ${clangSearchHint}" PURPOSE "Used for KDevelop's C++/C support plugin." TYPE REQUIRED ) if (CLANG_FOUND) if (NOT CLANG_CLANG_LIB) message(FATAL_ERROR "Could not find the Clang C library: libclang") endif() add_library(Clang::clang UNKNOWN IMPORTED) set_property(TARGET Clang::clang PROPERTY IMPORTED_LOCATION ${CLANG_CLANG_LIB}) ecm_optional_add_subdirectory(clang) endif() # END: Languages # BEGIN: Project builders add_subdirectory(makebuilder) add_subdirectory(ninjabuilder) ecm_optional_add_subdirectory(cmakebuilder) if (KDevelop-PG-Qt_FOUND) ecm_optional_add_subdirectory(qmakebuilder) endif() # END: Project builders # BEGIN: Project managers ecm_optional_add_subdirectory(cmake) ecm_optional_add_subdirectory(custommake) ecm_optional_add_subdirectory(custom-buildsystem) add_subdirectory(meson) if (KDevelop-PG-Qt_FOUND) ecm_optional_add_subdirectory(qmakemanager) endif() ecm_optional_add_subdirectory(genericprojectmanager) # END: Project managers # BEGIN: Runtimes add_subdirectory(android) if (UNIX) add_subdirectory(docker) add_subdirectory(flatpak) endif() # END: Runtimes # BEGIN: VCS ecm_optional_add_subdirectory(bazaar) ecm_optional_add_subdirectory(git) ecm_optional_add_subdirectory(perforce) find_package(SubversionLibrary) set_package_properties(SubversionLibrary PROPERTIES PURPOSE "Support for Subversion integration" URL "https://subversion.apache.org/" TYPE OPTIONAL) if(SubversionLibrary_FOUND) ecm_optional_add_subdirectory(subversion) endif() add_subdirectory(vcschangesview) # END: VCS # BEGIN: Others add_subdirectory(appwizard) add_subdirectory(codeutils) add_subdirectory(contextbrowser) add_subdirectory(documentswitcher) add_subdirectory(documentview) add_subdirectory(execute) add_subdirectory(executescript) add_subdirectory(externalscript) add_subdirectory(filemanager) add_subdirectory(filetemplates) add_subdirectory(grepview) add_subdirectory(openwith) add_subdirectory(outlineview) add_subdirectory(patchreview) add_subdirectory(problemreporter) add_subdirectory(projectfilter) add_subdirectory(projectmanagerview) add_subdirectory(quickopen) add_subdirectory(sourceformatter) add_subdirectory(standardoutputview) add_subdirectory(switchtobuddy) add_subdirectory(testview) add_subdirectory(scratchpad) ecm_optional_add_subdirectory(classbrowser) ecm_optional_add_subdirectory(executeplasmoid) ecm_optional_add_subdirectory(ghprovider) -ecm_optional_add_subdirectory(kdeprovider) ecm_optional_add_subdirectory(konsole) if (Qt5QuickWidgets_FOUND) add_subdirectory(welcomepage) endif() find_package(OktetaKastenControllers 0.3.1 CONFIG) set_package_properties(OktetaKastenControllers PROPERTIES PURPOSE "Required for building Okteta KDevelop plugin." URL "https://kde.org/" TYPE OPTIONAL) if (OktetaKastenControllers_FOUND) find_package(KastenControllers CONFIG) set_package_properties(KastenControllers PROPERTIES PURPOSE "Required for building Okteta KDevelop plugin." URL "https://kde.org/" TYPE OPTIONAL) endif() if (OktetaKastenControllers_FOUND AND KastenControllers_FOUND) add_subdirectory(okteta) endif() # END: Others diff --git a/plugins/kdeprovider/CMakeLists.txt b/plugins/kdeprovider/CMakeLists.txt deleted file mode 100644 index edd305804b..0000000000 --- a/plugins/kdeprovider/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"kdevkdeprovider\") -if(BUILD_TESTING) - add_subdirectory(tests) -endif() - -set(kdevkdeprovider_PART_SRCS kdeprojectsmodel.cpp - filterproxysearchline.cpp - kdeproviderwidget.cpp - kdeproviderplugin.cpp - kdeprojectsmodel.cpp - kdeprojectsreader.cpp -) -kconfig_add_kcfg_files(kdevkdeprovider_PART_SRCS kdeconfig.kcfgc) -ki18n_wrap_ui(kdevkdeprovider_PART_SRCS kdeconfig.ui) - -kdevplatform_add_plugin(kdevkdeprovider JSON kdevkdeprovider.json SOURCES ${kdevkdeprovider_PART_SRCS}) -target_link_libraries(kdevkdeprovider - KDev::Interfaces - KDev::Sublime - KDev::Vcs -) diff --git a/plugins/kdeprovider/Messages.sh b/plugins/kdeprovider/Messages.sh deleted file mode 100644 index d23e4f3f87..0000000000 --- a/plugins/kdeprovider/Messages.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -$EXTRACTRC *.ui >> rc.cpp -$XGETTEXT *.cpp -o $podir/kdevkdeprovider.pot -rm -f rc.cpp diff --git a/plugins/kdeprovider/filterproxysearchline.cpp b/plugins/kdeprovider/filterproxysearchline.cpp deleted file mode 100644 index d6ab0e450f..0000000000 --- a/plugins/kdeprovider/filterproxysearchline.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of KDevelop - * - * Copyright 2018 Friedrich W. H. Kossebau - * - * 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. - */ - -#include "filterproxysearchline.h" - -// KF -#include -// Qt -#include -#include - - -FilterProxySearchLine::FilterProxySearchLine(QWidget *parent) - : QLineEdit(parent) - , m_delayTimer(new QTimer(this)) -{ - setClearButtonEnabled(true); - setPlaceholderText(i18n("Search")); - - m_delayTimer->setSingleShot(true); - m_delayTimer->setInterval(300); - connect(m_delayTimer, &QTimer::timeout, - this, &FilterProxySearchLine::updateFilter); - connect(this, &FilterProxySearchLine::textChanged, - m_delayTimer, QOverload<>::of(&QTimer::start)); -} - -void FilterProxySearchLine::setFilterProxyModel(QSortFilterProxyModel* filterProxyModel) -{ - m_filterProxyModel = filterProxyModel; -} - -void FilterProxySearchLine::updateFilter() -{ - if (!m_filterProxyModel) { - return; - } - - m_filterProxyModel->setFilterFixedString(text()); -} diff --git a/plugins/kdeprovider/filterproxysearchline.h b/plugins/kdeprovider/filterproxysearchline.h deleted file mode 100644 index a0507ee4eb..0000000000 --- a/plugins/kdeprovider/filterproxysearchline.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file is part of KDevelop - * - * Copyright 2018 Friedrich W. H. Kossebau - * - * 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 KDEPROVIDER_FILTERPROXYSEARCHLINE_H -#define KDEPROVIDER_FILTERPROXYSEARCHLINE_H - -// Qt -#include - -class QTimer; -class QSortFilterProxyModel; - -class FilterProxySearchLine : public QLineEdit -{ - Q_OBJECT - -public: - explicit FilterProxySearchLine(QWidget* parent = nullptr); - -public: - void setFilterProxyModel(QSortFilterProxyModel* filterProxyModel); - -private: - void updateFilter(); - -private: - QTimer* m_delayTimer; - QSortFilterProxyModel* m_filterProxyModel = nullptr; -}; - -#endif diff --git a/plugins/kdeprovider/kdeconfig.kcfg b/plugins/kdeprovider/kdeconfig.kcfg deleted file mode 100644 index c81fc41ff6..0000000000 --- a/plugins/kdeprovider/kdeconfig.kcfg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - git - - - diff --git a/plugins/kdeprovider/kdeconfig.kcfgc b/plugins/kdeprovider/kdeconfig.kcfgc deleted file mode 100644 index a922c7cfd1..0000000000 --- a/plugins/kdeprovider/kdeconfig.kcfgc +++ /dev/null @@ -1,3 +0,0 @@ -File=kdeconfig.kcfg -ClassName=KDEProviderSettings -Singleton=true diff --git a/plugins/kdeprovider/kdeconfig.ui b/plugins/kdeprovider/kdeconfig.ui deleted file mode 100644 index 2e95ff61af..0000000000 --- a/plugins/kdeprovider/kdeconfig.ui +++ /dev/null @@ -1,68 +0,0 @@ - - - KDEConfig - - - - 0 - 0 - 658 - 300 - - - - - - - - 0 - 0 - - - - git.kde.org protocol: - - - - - - - - git - - - - - http - - - - - ssh - - - - - kde: - - - - - - - - <html><head/><body><p>URL to clone the protocol from, like:<br/>git clone git://anongit.kde.org/kdevelop<br/>git clone kde:kdevelop</p><p>For more information go <a href="https://community.kde.org/Sysadmin/GitKdeOrgManual#Overview_of_repository_URL_schemes"><span style=" text-decoration: underline; color:#0057ae;">here</span></a>.</p></body></html> - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - diff --git a/plugins/kdeprovider/kdeprojectsmodel.cpp b/plugins/kdeprovider/kdeprojectsmodel.cpp deleted file mode 100644 index 8ca2e387c3..0000000000 --- a/plugins/kdeprovider/kdeprojectsmodel.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* This file is part of KDevelop - Copyright 2010 Aleix Pol Gonzalez - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 "kdeprojectsmodel.h" -#include -#include - -using namespace KDevelop; - -SourceItem::SourceItem(const Source& s) - : QStandardItem(QIcon::fromTheme(s.icon), s.name), m_s(s) -{ - Q_ASSERT(!m_s.name.isEmpty()); -} - -QVariant SourceItem::data(int role) const -{ - switch(role) - { - case KDEProjectsModel::IdentifierRole: - return m_s.identifier; - case KDEProjectsModel::VcsLocationRole: - return QVariantMap(m_s.m_urls); - default: - return QStandardItem::data(role); - } -} - -Source::Source(SourceType aType, const QString& anIcon, const QString& aName, const QPair& aUrl) - : type(aType), name(aName), icon(anIcon) -{ - m_urls[aUrl.first] = aUrl.second; -} - -KDEProjectsModel::KDEProjectsModel(QObject* parent): QStandardItemModel(parent) -{} diff --git a/plugins/kdeprovider/kdeprojectsmodel.h b/plugins/kdeprovider/kdeprojectsmodel.h deleted file mode 100644 index 1c9b0e88c4..0000000000 --- a/plugins/kdeprovider/kdeprojectsmodel.h +++ /dev/null @@ -1,68 +0,0 @@ -/* This file is part of KDevelop - Copyright 2010 Aleix Pol Gonzalez - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 KDEPROJECTSMODEL_H -#define KDEPROJECTSMODEL_H - -#include - -namespace KDevelop { - class VcsLocation; -} - -struct Source -{ - enum SourceType - { - Project, - Module - }; - - Source() {} - Source(SourceType aType, const QString& anIcon, const QString& aName, const QPair< QString, QString >& aUrl); - - SourceType type = Project; - QString name; - QString icon; - QString identifier; - - /** urls for protocol */ - QVariantMap m_urls; -}; - -class SourceItem : public QStandardItem -{ - public: - explicit SourceItem(const Source& s); - QVariant data(int role = Qt::UserRole + 1) const override; - - private: - Source m_s; -}; - -class KDEProjectsModel : public QStandardItemModel -{ - Q_OBJECT - public: - - enum Role { VcsLocationRole = Qt::UserRole+1, IdentifierRole }; - - explicit KDEProjectsModel(QObject* parent = nullptr); -}; - -#endif // KDEPROJECTSMODEL_H diff --git a/plugins/kdeprovider/kdeprojectsreader.cpp b/plugins/kdeprovider/kdeprojectsreader.cpp deleted file mode 100644 index f49741cdb5..0000000000 --- a/plugins/kdeprovider/kdeprojectsreader.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* This file is part of KDevelop - Copyright 2010 Aleix Pol Gonzalez - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 "kdeprojectsreader.h" -#include -#include -#include -#include - -static const QUrl kdeProjectsUrl(QStringLiteral("https://projects.kde.org/kde_projects.xml")); - -KDEProjectsReader::KDEProjectsReader(KDEProjectsModel* m, QObject* parent) - : QObject(parent) - , m_m(m) //donuts -{ - auto *manager = new QNetworkAccessManager(this); - - QNetworkReply* reply = manager->get(QNetworkRequest(kdeProjectsUrl)); - connect(reply, QOverload::of(&QNetworkReply::error), - this, &KDEProjectsReader::downloadError); - connect(manager,&QNetworkAccessManager::finished, this, &KDEProjectsReader::downloadFinished); -} - -static QString readText(QXmlStreamReader* xml) -{ - QString ret; - for(int opened=1; opened>0 && !xml->atEnd(); ) { - const auto token=xml->readNext(); - - if(token==QXmlStreamReader::StartElement) - opened++; - else if(token==QXmlStreamReader::EndElement) - opened--; - else if(token==QXmlStreamReader::Characters) - ret += xml->text(); - } - return ret; -} - -void KDEProjectsReader::downloadFinished(QNetworkReply* reply) -{ - if(reply->error()!=QNetworkReply::NoError) { - m_errors += reply->errorString(); - emit downloadDone(); - return; - } - - QByteArray data = reply->readAll(); - QXmlStreamReader xml(data); - - while (!xml.atEnd()) { - QXmlStreamReader::TokenType token = xml.readNext(); - - if(token==QXmlStreamReader::StartElement) { - QStringRef name = xml.name(); - - if (name == QLatin1String("project") || name == QLatin1String("module")) { - m_current.push(Source()); - - if (name == QLatin1String("project")) - m_current.top().type = Source::Project; - else if (name == QLatin1String("module")) - m_current.top().type = Source::Module; - m_current.top().identifier = xml.attributes().value(QStringLiteral("identifier")).toString(); - } - else if(!m_current.isEmpty()) - { - if(name == QLatin1String("name")) - m_current.top().name = readText(&xml); - else if(name == QLatin1String("url")) { - QString protocol = xml.attributes().value(QStringLiteral("protocol")).toString(); - m_current.top().m_urls[protocol] = readText(&xml); - } else if(name == QLatin1String("icon")) - m_current.top().icon = readText(&xml); - } - } else if(token==QXmlStreamReader::EndElement) { - QStringRef name = xml.name(); - if (name == QLatin1String("project") || name == QLatin1String("module")) { - Source p = m_current.pop(); - - if (name == QLatin1String("project")) - Q_ASSERT(p.type == Source::Project); - else if (name == QLatin1String("module")) - Q_ASSERT(p.type == Source::Module); - - if(!p.m_urls.isEmpty()) { - auto* item = new SourceItem(p); - m_m->appendRow(item); - } - } - } - } - if (xml.hasError()) { - m_errors += xml.errorString(); - } - emit downloadDone(); -} - -void KDEProjectsReader::downloadError(QNetworkReply::NetworkError error) -{ - m_errors += QStringLiteral("error: %1").arg(error); -} diff --git a/plugins/kdeprovider/kdeprojectsreader.h b/plugins/kdeprovider/kdeprojectsreader.h deleted file mode 100644 index c918f12bcc..0000000000 --- a/plugins/kdeprovider/kdeprojectsreader.h +++ /dev/null @@ -1,49 +0,0 @@ -/* This file is part of KDevelop - Copyright 2010 Aleix Pol Gonzalez - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 KDEPROJECTSREADER_H -#define KDEPROJECTSREADER_H - -#include "kdeprojectsmodel.h" - -#include - -#include - -class KDEProjectsReader : public QObject -{ - Q_OBJECT - public: - KDEProjectsReader(KDEProjectsModel* m, QObject* parent); - QStringList errors() const { return m_errors; } - bool hasErrors() { return !m_errors.isEmpty(); } - - public Q_SLOTS: - void downloadFinished(QNetworkReply* reply); - void downloadError(QNetworkReply::NetworkError); - - Q_SIGNALS: - void downloadDone(); - - private: - KDevelop::Stack m_current; - QStringList m_errors; - KDEProjectsModel* m_m; -}; - -#endif // KDEPROJECTSREADER_H diff --git a/plugins/kdeprovider/kdeproviderplugin.cpp b/plugins/kdeprovider/kdeproviderplugin.cpp deleted file mode 100644 index f13ece28f8..0000000000 --- a/plugins/kdeprovider/kdeproviderplugin.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of KDevelop - * Copyright 2010 Aleix Pol Gonzalez - * - * 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. - */ - -#include "kdeproviderplugin.h" -#include - -#include -#include -#include "kdeproviderwidget.h" - -using namespace KDevelop; - -K_PLUGIN_FACTORY_WITH_JSON(KDevKDEProviderFactory, "kdevkdeprovider.json", registerPlugin(); ) - -KDEProviderPlugin::KDEProviderPlugin ( QObject* parent, const QVariantList& ) - : IPlugin ( QStringLiteral("kdevkdeprovider"), parent ) -{ -} - -KDEProviderPlugin::~KDEProviderPlugin() -{} - -QString KDEProviderPlugin::name() const -{ - return i18n("KDE"); -} - -KDevelop::IProjectProviderWidget* KDEProviderPlugin::providerWidget(QWidget* parent) -{ - return new KDEProviderWidget(parent); -} - -#include "kdeproviderplugin.moc" diff --git a/plugins/kdeprovider/kdeproviderplugin.h b/plugins/kdeprovider/kdeproviderplugin.h deleted file mode 100644 index 23869b9443..0000000000 --- a/plugins/kdeprovider/kdeproviderplugin.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -* This file is part of KDevelop -* Copyright 2009 Andreas Pakulat -* -* 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 KDEPROVIDERPLUGIN_H -#define KDEPROVIDERPLUGIN_H - -#include -#include - -class KDEProviderPlugin : public KDevelop::IPlugin, KDevelop::IProjectProvider -{ - Q_OBJECT - Q_INTERFACES( KDevelop::IProjectProvider ) - public: - KDEProviderPlugin ( QObject* parent, const QList& args ); - ~KDEProviderPlugin() override; - - QString name() const override; - KDevelop::IProjectProviderWidget* providerWidget(QWidget* parent) override; - -}; - -#endif // KDEPROVIDERPLUGIN_H diff --git a/plugins/kdeprovider/kdeproviderwidget.cpp b/plugins/kdeprovider/kdeproviderwidget.cpp deleted file mode 100644 index a1c20dede7..0000000000 --- a/plugins/kdeprovider/kdeproviderwidget.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * This file is part of KDevelop - * Copyright 2010 Aleix Pol Gonzalez - * - * 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. - */ - -#include "kdeproviderwidget.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ui_kdeconfig.h" -#include "filterproxysearchline.h" -#include "kdeconfig.h" -#include "kdeprojectsmodel.h" -#include "kdeprojectsreader.h" -#include - -#include -#include - -using namespace KDevelop; - -KDEProviderWidget::KDEProviderWidget(QWidget* parent) - : IProjectProviderWidget(parent) -{ - auto* widgetLayout = new QVBoxLayout; - widgetLayout->setContentsMargins(0, 0, 0, 0); - setLayout(widgetLayout); - - m_projects = new QListView(this); - auto* topLayout = new QHBoxLayout; - auto filterLine = new FilterProxySearchLine(this); - auto* model = new KDEProjectsModel(this); - auto* reader = new KDEProjectsReader(model, model); - connect(reader, &KDEProjectsReader::downloadDone, reader, &KDEProjectsReader::deleteLater); - connect(m_projects, &QListView::clicked, this, &KDEProviderWidget::projectIndexChanged); - - topLayout->addWidget(filterLine); - - - auto* settings=new QPushButton(QIcon::fromTheme(QStringLiteral("configure")), i18n("Settings"), this); - settings->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); - connect(settings, &QPushButton::clicked, this, &KDEProviderWidget::showSettings); - - topLayout->addWidget(settings); - - layout()->addItem(topLayout); - layout()->addWidget(m_projects); - - auto* proxyModel = new QSortFilterProxyModel(this); - proxyModel->setSourceModel(model); - proxyModel->setDynamicSortFilter(true); - proxyModel->sort(0); - proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); - proxyModel->setFilterKeyColumn(-1); - proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); - m_projects->setModel(proxyModel); - m_projects->setEditTriggers(QAbstractItemView::NoEditTriggers); - filterLine->setFilterProxyModel(proxyModel); -} - -VcsLocation extractLocation(const QModelIndex& pos) -{ - QString gitUrl=KDEProviderSettings::self()->gitProtocol(); - if(gitUrl==QLatin1String("kde:")) { - return VcsLocation(QUrl(QLatin1String("kde:")+pos.data(KDEProjectsModel::IdentifierRole).toString())); - } else { - QMap urls = pos.data(KDEProjectsModel::VcsLocationRole).toMap(); - return VcsLocation(urls[gitUrl].toUrl()); - } -} - -VcsJob* KDEProviderWidget::createWorkingCopy(const QUrl &destinationDirectory) -{ - QModelIndex pos = m_projects->currentIndex(); - if(!pos.isValid()) - return nullptr; - - IPlugin* plugin = ICore::self()->pluginController()->pluginForExtension(QStringLiteral("org.kdevelop.IBasicVersionControl"), QStringLiteral("kdevgit")); - if (!plugin) { - KMessageBox::error(nullptr, i18n("The Git plugin could not be loaded which is required to download a KDE project."), i18n("KDE Provider Error")); - return nullptr; - } - auto* vcIface = plugin->extension(); - VcsJob* ret = vcIface->createWorkingCopy(extractLocation(pos), destinationDirectory); - - return ret; -} - -bool KDEProviderWidget::isCorrect() const -{ - return m_projects->currentIndex().isValid(); -} - -void KDEProviderWidget::showSettings() -{ - auto* dialog = new KConfigDialog(this, QStringLiteral("settings"), KDEProviderSettings::self()); - dialog->setFaceType(KPageDialog::Auto); - auto* page = new QWidget(dialog); - - Ui::KDEConfig configUi; - configUi.setupUi(page); - configUi.kcfg_gitProtocol->setProperty("kcfg_property", QByteArray("currentText")); - int idx = configUi.kcfg_gitProtocol->findText(KDEProviderSettings::self()->gitProtocol()); - if(idx>=0) { - configUi.kcfg_gitProtocol->setCurrentIndex(idx); - } - -// TODO port to KF5 -// dialog->button(KDialog::Default)->setVisible(false); - dialog->addPage(page, i18n("General") ); - dialog->show(); -} - -void KDEProviderWidget::projectIndexChanged(const QModelIndex& currentIndex) -{ - if (currentIndex.isValid()) { - QString currentProjectName = currentIndex.data(Qt::DisplayRole).toString(); - - emit changed(currentProjectName); - } -} diff --git a/plugins/kdeprovider/kdeproviderwidget.h b/plugins/kdeprovider/kdeproviderwidget.h deleted file mode 100644 index 7b9ed6bee5..0000000000 --- a/plugins/kdeprovider/kdeproviderwidget.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of KDevelop - * Copyright 2010 Aleix Pol Gonzalez - * - * 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 KDEPROVIDERWIDGET_H -#define KDEPROVIDERWIDGET_H - -#include - -class QModelIndex; -class QListView; - -class KDEProviderWidget : public KDevelop::IProjectProviderWidget -{ - Q_OBJECT - public: - explicit KDEProviderWidget(QWidget* parent = nullptr); - - KDevelop::VcsJob* createWorkingCopy(const QUrl &destinationDirectory) override; - bool isCorrect() const override; - - private Q_SLOTS: - void showSettings(); - void projectIndexChanged(const QModelIndex& currentIndex); - - private: - QListView* m_projects; -}; - -#endif // KDEPROVIDERWIDGET_H diff --git a/plugins/kdeprovider/kdevkdeprovider.json b/plugins/kdeprovider/kdevkdeprovider.json deleted file mode 100644 index b9a8850ed7..0000000000 --- a/plugins/kdeprovider/kdevkdeprovider.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "KPlugin": { - "Authors": [ - { - "Name": "Aleix Pol", - "Name[ca@valencia]": "Aleix Pol", - "Name[ca]": "Aleix Pol", - "Name[cs]": "Aleix Pol", - "Name[de]": "Aleix Pol", - "Name[el]": "Aleix Pol", - "Name[en_GB]": "Aleix Pol", - "Name[es]": "Aleix Pol", - "Name[et]": "Aleix Pol", - "Name[fi]": "Aleix Pol", - "Name[fr]": "Aleix Pol", - "Name[gl]": "Aleix Pol", - "Name[it]": "Aleix Pol", - "Name[ko]": "Aleix Pol", - "Name[nl]": "Aleix Pol", - "Name[nn]": "Aleix Pol", - "Name[pl]": "Aleix Pol", - "Name[pt]": "Aleix Pol", - "Name[pt_BR]": "Aleix Pol", - "Name[ru]": "Aleix Pol Gonzalez", - "Name[sk]": "Aleix Pol", - "Name[sl]": "Aleix Pol", - "Name[sv]": "Aleix Pol", - "Name[tr]": "Aleix Pol", - "Name[uk]": "Aleix Pol", - "Name[x-test]": "xxAleix Polxx", - "Name[zh_CN]": "Aleix Pol" - } - ], - "Category": "Utilities", - "Description": "This plugin helps to obtain KDE projects", - "Description[bs]": "Ovaj dodatak omogućava dobijanje KDE projekada", - "Description[ca@valencia]": "Aquest connector ajuda a obtindre els projectes KDE", - "Description[ca]": "Aquest connector ajuda a obtenir els projectes KDE", - "Description[de]": "Dieses Modul hilft dabei KDE-Projekte zu beziehen", - "Description[el]": "Αυτό το πρόσθετο βοηθάει στην ανάκτηση KDE έργων", - "Description[en_GB]": "This plugin helps to obtain KDE projects", - "Description[es]": "Este complemento le ayuda a obtener proyectos de KDE", - "Description[et]": "See plugin aitab hankida KDE projekte", - "Description[fi]": "Tämä liitännäinen auttaa KDE-projektien hakemisessa", - "Description[fr]": "Ce module aide à obtenir des projets KDE", - "Description[gl]": "Este complemento permite obter proxectos de KDE.", - "Description[it]": "Questa estensione consente di ottenere progetti di KDE", - "Description[ko]": "이 플러그인은 KDE 프로젝트를 가져옵니다", - "Description[nl]": "Deze plugin helpt om KDE-projects te verkrijgen", - "Description[pl]": "Pobiera projekty KDE", - "Description[pt]": "Este 'plugin' ajuda a obter projectos do KDE", - "Description[pt_BR]": "Este plugin ajuda a obter projetos do KDE", - "Description[sk]": "Tento modul pomáha získavať KDE projekty", - "Description[sl]": "Ta vstavek pomaga pri pridobivanju KDE-jevih projektov", - "Description[sv]": "Insticksprogrammet hjälper till att erhålla KDE-projekt", - "Description[tr]": "Bu eklenti KDE projelerini edinmeye yardım eder", - "Description[uk]": "За допомогою цього додатка можна отримувати проєкти KDE", - "Description[x-test]": "xxThis plugin helps to obtain KDE projectsxx", - "Description[zh_CN]": "此插件帮助您获取 KDE 工程", - "Icon": "kde", - "Id": "kdevkdeprovider", - "License": "GPL", - "Name": "KDE Provider", - "Name[bs]": "KDE pružalac", - "Name[ca@valencia]": "Proveïdor del KDE", - "Name[ca]": "Proveïdor del KDE", - "Name[cs]": "Poskytovatel KDE", - "Name[de]": "KDE-Provider", - "Name[el]": "Πάροχος KDE", - "Name[en_GB]": "KDE Provider", - "Name[es]": "Proveedor de KDE", - "Name[et]": "KDE pakkuja", - "Name[fi]": "KDE-tarjoaja", - "Name[fr]": "Fournisseur KDE", - "Name[gl]": "Provedor de KDE", - "Name[it]": "Fornitore di KDE", - "Name[ko]": "KDE 공급자", - "Name[nl]": "KDE-leverancier", - "Name[pl]": "Dostawca KDE", - "Name[pt]": "Fornecedor do KDE", - "Name[pt_BR]": "Fornecedor do KDE", - "Name[sk]": "Poskytovateľ KDE", - "Name[sl]": "KDE-jev ponudnik", - "Name[sv]": "KDE-leverantör", - "Name[tr]": "KDE Sağlayıcı", - "Name[uk]": "Надавач даних KDE", - "Name[x-test]": "xxKDE Providerxx", - "Name[zh_CN]": "KDE 提供器", - "ServiceTypes": [ - "KDevelop/Plugin" - ] - }, - "X-KDevelop-Category": "Global", - "X-KDevelop-IRequired": [ - "org.kdevelop.IBasicVersionControl@kdevgit" - ], - "X-KDevelop-Interfaces": [ - "org.kdevelop.IProjectProvider" - ], - "X-KDevelop-Mode": "GUI" -} diff --git a/plugins/kdeprovider/tests/CMakeLists.txt b/plugins/kdeprovider/tests/CMakeLists.txt deleted file mode 100644 index c6de4ff82d..0000000000 --- a/plugins/kdeprovider/tests/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -remove_definitions( - -DQT_NO_CAST_FROM_ASCII - -DQT_NO_CAST_TO_ASCII - -DQT_NO_CAST_FROM_BYTEARRAY -) - -set(test_kdeprojectsreader_SRCS - ../kdeprojectsreader.cpp - ../kdeprojectsmodel.cpp - test_kdeprojectsreader.cpp) -ecm_add_test(${test_kdeprojectsreader_SRCS} - TEST_NAME test_kdeprojectsreader - LINK_LIBRARIES Qt5::Test Qt5::Core Qt5::Gui Qt5::Network KDev::Vcs) diff --git a/plugins/kdeprovider/tests/test_kdeprojectsreader.cpp b/plugins/kdeprovider/tests/test_kdeprojectsreader.cpp deleted file mode 100644 index 5325f9703a..0000000000 --- a/plugins/kdeprovider/tests/test_kdeprojectsreader.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* This file is part of KDevelop - Copyright 2010 Aleix Pol Gonzalez - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 "test_kdeprojectsreader.h" -#include -#include -#include -#include "../kdeprojectsreader.h" - -QTEST_MAIN( TestKDEProjectsReader ) - -void TestKDEProjectsReader::testsProperParse() -{ - KDEProjectsModel m; - KDEProjectsReader reader(&m, nullptr); - - if(reader.hasErrors()) - qDebug() << "errors:" << reader.errors(); - - QVERIFY(!reader.hasErrors()); - - /// FIXME: a unit test should never try to download anything from the website - /// this must be mocked properly - QSignalSpy downloadDoneSpy(&reader, SIGNAL(downloadDone())); - QVERIFY(downloadDoneSpy.wait(30000)); - - for(int i=0; itext() << item->icon() << item->data(KDEProjectsModel::VcsLocationRole); - - QVERIFY(item); - QVERIFY(!item->text().isEmpty()); - - QVariant urls = item->data(KDEProjectsModel::VcsLocationRole); - QVERIFY(urls.isValid()); - QVERIFY(urls.canConvert(QVariant::Map)); - QVariantMap mapurls=urls.toMap(); - for(QVariantMap::const_iterator it=mapurls.constBegin(), itEnd=mapurls.constEnd(); it!=itEnd; ++it) { - QVERIFY(!it.key().isEmpty()); - QVERIFY(!it.value().toString().isEmpty()); - } - - QVERIFY(!item->data(KDEProjectsModel::VcsLocationRole).toMap().isEmpty()); - } -} diff --git a/plugins/kdeprovider/tests/test_kdeprojectsreader.h b/plugins/kdeprovider/tests/test_kdeprojectsreader.h deleted file mode 100644 index f74aa771a6..0000000000 --- a/plugins/kdeprovider/tests/test_kdeprojectsreader.h +++ /dev/null @@ -1,32 +0,0 @@ -/* This file is part of KDevelop - Copyright 2010 Aleix Pol Gonzalez - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 TEST_KDEPROJECTSREADER_H -#define TEST_KDEPROJECTSREADER_H - -#include - - -class TestKDEProjectsReader : public QObject -{ - Q_OBJECT - private Q_SLOTS: - void testsProperParse(); -}; - -#endif // TEST_KDEPROJECTSREADER_H