From 80c97ff9ed34fb2b2a4a53f8f0ed3d26334ab5a1 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Mon, 18 Jan 2016 21:26:46 -0600 Subject: [PATCH] Depend on the new Papyros.Core QML module instead of registering it ourselves --- src/CMakeLists.txt | 3 +-- src/clipboard.cpp | 31 ------------------------------- src/clipboard.h | 38 -------------------------------------- src/main.cpp | 8 -------- src/qml/Settings.qml | 2 +- src/qml/main.qml | 2 +- 6 files changed, 3 insertions(+), 81 deletions(-) delete mode 100644 src/clipboard.cpp delete mode 100644 src/clipboard.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 221ef4a..318d7c5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,8 +5,7 @@ target_link_libraries(papyros-terminal Qt5::Core Qt5::Qml Qt5::Quick - Qt5::Widgets - Papyros::Papyros) + Qt5::Widgets) install(TARGETS papyros-terminal DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/clipboard.cpp b/src/clipboard.cpp deleted file mode 100644 index 8fe79ea..0000000 --- a/src/clipboard.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Papyros Terminal - The terminal app for Papyros following Material Design - * Copyright (C) 2016 Michael Spencer - * - * 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 3 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, see . - */ - -#include "clipboard.h" - -#include - -Clipboard::Clipboard(QObject *parent) : QObject(parent), m_clipboard(QApplication::clipboard()) -{ - // Nothing needed here -} - -QString Clipboard::text() const -{ - return m_clipboard->text(); -} diff --git a/src/clipboard.h b/src/clipboard.h deleted file mode 100644 index 241c053..0000000 --- a/src/clipboard.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Papyros Terminal - The terminal app for Papyros following Material Design - * Copyright (C) 2016 Michael Spencer - * - * 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 3 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, see . - */ - -#ifndef CLIPBOARD_H -#define CLIPBOARD_H - -#include -#include - -class Clipboard : public QObject -{ - Q_OBJECT - -public: - explicit Clipboard(QObject *parent = 0); - - Q_INVOKABLE QString text() const; - -private: - QClipboard *m_clipboard = nullptr; -}; - -#endif // ACTION_HANDLER_H diff --git a/src/main.cpp b/src/main.cpp index f855e5d..9c39a9c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,10 +20,8 @@ #include #include #include -#include #include "ActionHandler.h" -#include "clipboard.h" int main(int argc, char *argv[]) { @@ -40,12 +38,6 @@ int main(int argc, char *argv[]) // Set the X11 WML_CLASS so X11 desktops can find the desktop file qputenv("RESOURCE_NAME", "io.papyros.Terminal"); - // TODO: Remove after we add a QML module directly to Papyros.Core - qmlRegisterType("Papyros.Core", 0, 1, "KQuickConfig"); - - // TODO: Move this to Papyros.Core - qmlRegisterType("Papyros.Core", 0, 1, "Clipboard"); - QQmlApplicationEngine engine; ActionHandler actionHandler(argv[0]); diff --git a/src/qml/Settings.qml b/src/qml/Settings.qml index 8b8b049..0eff7e4 100644 --- a/src/qml/Settings.qml +++ b/src/qml/Settings.qml @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import Papyros.Core 0.1 +import Papyros.Core 0.2 KQuickConfig { id: settings diff --git a/src/qml/main.qml b/src/qml/main.qml index 272e6eb..d366a54 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -22,7 +22,7 @@ import QtQuick.Window 2.2 import QMLTermWidget 1.0 import Material 0.2 import QtQuick.Layouts 1.1 -import Papyros.Core 0.1 +import Papyros.Core 0.2 ApplicationWindow { id: mainWindow