mirror of
https://github.com/QRouland/UTPass.git
synced 2025-06-30 01:02:29 +00:00
Initial Commit
This commit is contained in:
25
plugins/Pass/CMakeLists.txt
Normal file
25
plugins/Pass/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(PLUGIN "Pass")
|
||||
|
||||
set(
|
||||
SRC
|
||||
plugin.cpp
|
||||
pass.cpp
|
||||
)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
add_library(${PLUGIN} MODULE ${SRC})
|
||||
set_target_properties(${PLUGIN} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PLUGIN})
|
||||
qt5_use_modules(${PLUGIN} Qml Quick DBus)
|
||||
|
||||
execute_process(
|
||||
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
|
||||
OUTPUT_VARIABLE ARCH_TRIPLET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}")
|
||||
|
||||
install(TARGETS ${PLUGIN} DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN}/)
|
||||
install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN}/)
|
20
plugins/Pass/pass.cpp
Normal file
20
plugins/Pass/pass.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QString>
|
||||
#include "pass.h"
|
||||
|
||||
Pass::Pass() {
|
||||
|
||||
}
|
||||
|
||||
void Pass::cmd_show(const QString path) {
|
||||
QDir dir = QDir(path);
|
||||
if (!dir.exists()) {
|
||||
qWarning("Path to show not found");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Pass::cmd_version() {
|
||||
|
||||
}
|
17
plugins/Pass/pass.h
Normal file
17
plugins/Pass/pass.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef PASS_H
|
||||
#define PASS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class Pass: public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Pass();
|
||||
~Pass() override = default;
|
||||
|
||||
Q_INVOKABLE void cmd_show(QString path) ;
|
||||
Q_INVOKABLE void cmd_version() ;
|
||||
};
|
||||
|
||||
#endif
|
10
plugins/Pass/plugin.cpp
Normal file
10
plugins/Pass/plugin.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include <QtQml>
|
||||
#include <QtQml/QQmlContext>
|
||||
|
||||
#include "plugin.h"
|
||||
#include "pass.h"
|
||||
|
||||
void PassPlugin::registerTypes(const char *uri) {
|
||||
//@uri Pass
|
||||
qmlRegisterSingletonType<Pass>(uri, 1, 0, "Pass", [](QQmlEngine*, QJSEngine*) -> QObject* { return new Pass; });
|
||||
}
|
14
plugins/Pass/plugin.h
Normal file
14
plugins/Pass/plugin.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef PASSPLUGIN_H
|
||||
#define PASSPLUGIN_H
|
||||
|
||||
#include <QQmlExtensionPlugin>
|
||||
|
||||
class PassPlugin : public QQmlExtensionPlugin {
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
|
||||
|
||||
public:
|
||||
void registerTypes(const char *uri);
|
||||
};
|
||||
|
||||
#endif
|
2
plugins/Pass/qmldir
Normal file
2
plugins/Pass/qmldir
Normal file
@ -0,0 +1,2 @@
|
||||
module Pass
|
||||
plugin Pass
|
Reference in New Issue
Block a user