[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdevplatform/5.0] plugins/welcomepage: Delete dead code.
From: Milian Wolff <mail () milianw ! de>
Date: 2016-01-31 22:51:58
Message-ID: E1aQ0qc-0003JH-Qy () scm ! kde ! org
[Download RAW message or body]
Git commit 309a956c0932d138d566ee5cda1062dd0da75f86 by Milian Wolff.
Committed on 31/01/2016 at 22:51.
Pushed by mwolff into branch '5.0'.
Delete dead code.
M +3 -1 plugins/welcomepage/CMakeLists.txt
D +0 -109 plugins/welcomepage/welcomepagedocument.cpp
D +0 -51 plugins/welcomepage/welcomepagedocument.h
M +1 -38 plugins/welcomepage/welcomepageplugin.cpp
M +0 -3 plugins/welcomepage/welcomepageplugin.h
M +0 -11 plugins/welcomepage/welcomepageview.cpp
M +4 -16 plugins/welcomepage/welcomepageview.h
http://commits.kde.org/kdevplatform/309a956c0932d138d566ee5cda1062dd0da75f86
diff --git a/plugins/welcomepage/CMakeLists.txt b/plugins/welcomepage/CMakeLists.txt
index dbb651a..caa4185 100644
--- a/plugins/welcomepage/CMakeLists.txt
+++ b/plugins/welcomepage/CMakeLists.txt
@@ -2,7 +2,9 @@ add_subdirectory(declarative)
set(welcomepage_SRCS
welcomepageplugin.cpp
- welcomepagedocument.cpp sessionsmodel.cpp welcomepageview.cpp uihelper.cpp)
+ sessionsmodel.cpp
+ welcomepageview.cpp
+ uihelper.cpp)
qt5_add_resources(welcomepage_SRCS welcomepage.qrc)
diff --git a/plugins/welcomepage/welcomepagedocument.cpp \
b/plugins/welcomepage/welcomepagedocument.cpp deleted file mode 100644
index 476f563..0000000
--- a/plugins/welcomepage/welcomepagedocument.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/* This file is part of KDevelop
- * Copyright 2010 Aleix Pol Gonzalez <aleixpol@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 "welcomepagedocument.h"
-
-#include <QMimeDatabase>
-
-#include <KLocalizedString>
-#include <KTextEditor/Cursor>
-
-#include <interfaces/icore.h>
-#include <interfaces/iproject.h>
-#include <interfaces/iuicontroller.h>
-#include <interfaces/isession.h>
-#include "welcomepageview.h"
-
-using namespace KDevelop;
-
-inline QString awesome() { return QStringLiteral("kdev:///awesome.kdevinternal"); }
-Q_GLOBAL_STATIC_WITH_ARGS(QUrl, s_welcomePageUrl, (QUrl(awesome())));
-
-WelcomePageDocument::WelcomePageDocument()
- : Sublime::UrlDocument(ICore::self()->uiController()->controller(), \
*s_welcomePageUrl), IDocument(ICore::self())
-{
- setTitle(i18n("Dashboard"));
-}
-
-void WelcomePageDocument::activate(Sublime::View* /*activeView*/, \
KParts::MainWindow* /*mainWindow*/)
-{}
-
-void WelcomePageDocument::setTextSelection(const KTextEditor::Range& /*range*/) {}
-void WelcomePageDocument::setCursorPosition(const KTextEditor::Cursor& /*cursor*/) \
{}
-
-KTextEditor::Cursor WelcomePageDocument::cursorPosition() const
-{
- return KTextEditor::Cursor();
-}
-
-IDocument::DocumentState WelcomePageDocument::state() const
-{
- return IDocument::Clean;
-}
-
-bool WelcomePageDocument::isActive() const
-{
- return true;
-}
-
-bool WelcomePageDocument::close(KDevelop::IDocument::DocumentSaveMode /*mode*/)
-{
- return true;
-}
-
-void WelcomePageDocument::reload()
-{}
-
-bool WelcomePageDocument::save(KDevelop::IDocument::DocumentSaveMode /*mode*/)
-{
- return true;
-}
-
-KTextEditor::Document* WelcomePageDocument::textDocument() const
-{
- return 0;
-}
-
-KParts::Part* WelcomePageDocument::partForView(QWidget* /*view*/) const
-{
- return 0;
-}
-
-QMimeType WelcomePageDocument::mimeType() const
-{
- return QMimeDatabase().mimeTypeForName(QStringLiteral("text/x-kdevelopinternal"));
-}
-
-Sublime::View* WelcomePageDocument::newView(Sublime::Document* doc)
-{
- if( dynamic_cast<WelcomePageDocument*>( doc ) )
- return new WelcomePageView(doc, Sublime::View::TakeOwnership);
-
- return 0;
-}
-
-QUrl WelcomePageDocument::url() const
-{
- return *s_welcomePageUrl;
-}
-
-QUrl WelcomePageDocument::welcomePageUrl()
-{
- return *s_welcomePageUrl;
-}
diff --git a/plugins/welcomepage/welcomepagedocument.h \
b/plugins/welcomepage/welcomepagedocument.h deleted file mode 100644
index 6eac95e..0000000
--- a/plugins/welcomepage/welcomepagedocument.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This file is part of KDevelop
- * Copyright 2010 Aleix Pol Gonzalez <aleixpol@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 KDEVPLATFORM_PLUGIN_DASHBOARDDOCUMENT_H
-#define KDEVPLATFORM_PLUGIN_DASHBOARDDOCUMENT_H
-
-#include <interfaces/idocument.h>
-#include <sublime/urldocument.h>
-
-class WelcomePageDocument : public Sublime::UrlDocument, public KDevelop::IDocument
-{
- Q_OBJECT
-public:
- WelcomePageDocument();
-
- void activate(Sublime::View* activeView, KParts::MainWindow* mainWindow) \
override;
- void setTextSelection(const KTextEditor::Range& range) override;
- void setCursorPosition(const KTextEditor::Cursor& cursor) override;
- KTextEditor::Cursor cursorPosition() const override;
- KDevelop::IDocument::DocumentState state() const override;
- bool isActive() const override;
- bool close(KDevelop::IDocument::DocumentSaveMode mode = Default) override;
- void reload() override;
- bool save(KDevelop::IDocument::DocumentSaveMode mode = Default) override;
- KTextEditor::Document* textDocument() const override;
- KParts::Part* partForView(QWidget* view) const override;
- QMimeType mimeType() const override;
- QUrl url() const override;
-
- static QUrl welcomePageUrl();
-protected:
- Sublime::View* newView(Document* doc) override;
-};
-
-#endif // KDEVPLATFORM_PLUGIN_DASHBOARDDOCUMENT_H
diff --git a/plugins/welcomepage/welcomepageplugin.cpp \
b/plugins/welcomepage/welcomepageplugin.cpp index e8554d6..189bf24 100644
--- a/plugins/welcomepage/welcomepageplugin.cpp
+++ b/plugins/welcomepage/welcomepageplugin.cpp
@@ -18,60 +18,23 @@
*/
#include "welcomepageplugin.h"
-#include <qlabel.h>
#include "welcomepageview.h"
-#include <QAction>
-
#include <KPluginFactory>
-#include <KPluginLoader>
-#include <KAboutData>
-#include <KActionCollection>
-#include <interfaces/iuicontroller.h>
#include <interfaces/icore.h>
-#include <interfaces/idocumentcontroller.h>
-#include <interfaces/context.h>
-#include <interfaces/contextmenuextension.h>
-#include <interfaces/iprojectcontroller.h>
-#include <interfaces/iproject.h>
-#include <project/projectmodel.h>
+#include <interfaces/iuicontroller.h>
#include <sublime/mainwindow.h>
-#include <QTimer>
-#include "welcomepagedocument.h"
K_PLUGIN_FACTORY_WITH_JSON(KDevWelcomePagePluginFactory, "kdevwelcomepage.json", \
registerPlugin<KDevWelcomePagePlugin>();)
using namespace KDevelop;
-class WelcomePageFactory : public KDevelop::IDocumentFactory
-{
-public:
- IDocument* create(const QUrl& /*url*/, ICore*) override
- {
- return new WelcomePageDocument();
- }
-};
-
KDevWelcomePagePlugin::KDevWelcomePagePlugin( QObject* parent, const QVariantList& )
: IPlugin(QStringLiteral("kdevwelcomepage"), parent )
{
-// ICore::self()->documentController()->registerDocumentForMimetype("text/x-kdevelop-internal", \
new WelcomePageFactory);
-//
-// //FIXME: When and where to open the welcome page?
-// //QTimer::singleShot(500, this, SLOT(openWelcomePage()));
-//
-// QAction* action = actionCollection()->addAction("show-welcomepage");
-// action->setText("Show Welcome Page");
-// action->setIcon(QIcon::fromTheme("meeting-organizer"));
-
Sublime::MainWindow* mw = \
qobject_cast<Sublime::MainWindow*>(ICore::self()->uiController()->activeMainWindow());
mw->setBackgroundCentralWidget(new WelcomePageWidget(QList<IProject*>(), mw));
}
-void KDevWelcomePagePlugin::openWelcomePage()
-{
- ICore::self()->documentController()->openDocument(WelcomePageDocument::welcomePageUrl());
-}
-
#include "welcomepageplugin.moc"
diff --git a/plugins/welcomepage/welcomepageplugin.h \
b/plugins/welcomepage/welcomepageplugin.h index 1960724..dd27d94 100644
--- a/plugins/welcomepage/welcomepageplugin.h
+++ b/plugins/welcomepage/welcomepageplugin.h
@@ -27,9 +27,6 @@ class KDevWelcomePagePlugin : public KDevelop::IPlugin
Q_OBJECT
public:
KDevWelcomePagePlugin( QObject* parent, const QList<QVariant>& );
-
-public slots:
- void openWelcomePage();
};
#endif
diff --git a/plugins/welcomepage/welcomepageview.cpp \
b/plugins/welcomepage/welcomepageview.cpp index dd6ad5d..1948e46 100644
--- a/plugins/welcomepage/welcomepageview.cpp
+++ b/plugins/welcomepage/welcomepageview.cpp
@@ -20,7 +20,6 @@
#include "uihelper.h"
#include "sessionsmodel.h"
-#include "welcomepagedocument.h"
#include <QQmlContext>
#include <QQmlComponent>
@@ -72,13 +71,3 @@ void WelcomePageWidget::areaChanged(Sublime::Area* area)
{
rootContext()->setContextProperty(QStringLiteral("area"), area->objectName());
}
-
-WelcomePageView::WelcomePageView(Sublime::Document* doc, \
Sublime::View::WidgetOwnership ws)
- : View(doc, ws)
-{
-}
-
-QWidget* WelcomePageView::createWidget(QWidget* parent)
-{
- return new WelcomePageWidget(QList<IProject*>(), parent);
-}
diff --git a/plugins/welcomepage/welcomepageview.h \
b/plugins/welcomepage/welcomepageview.h index ecf51c1..2810a52 100644
--- a/plugins/welcomepage/welcomepageview.h
+++ b/plugins/welcomepage/welcomepageview.h
@@ -20,24 +20,14 @@
#define WELCOMEPAGEVIEW_H
#include <QQuickWidget>
-#include <sublime/view.h>
-namespace Sublime
-{
+namespace Sublime {
class Area;
}
-namespace KDevelop { class IProject; }
-
-class WelcomePageView : public Sublime::View
-{
- Q_OBJECT
- public:
- explicit WelcomePageView(Sublime::Document* doc, WidgetOwnership ws = \
DoNotTakeOwnerShip);
-
- QWidget* createWidget(QWidget* parent) override;
-};
-
+namespace KDevelop {
+class IProject;
+}
class WelcomePageWidget : public QQuickWidget
{
@@ -49,6 +39,4 @@ public slots:
void areaChanged(Sublime::Area* a);
};
-void trySetupWelcomePageView();
-
#endif // WELCOMEPAGEVIEW_H
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic