diff --git a/app/qml/components/BranchView.qml b/app/qml/components/BranchView.qml index 40ab736..db78b78 100644 --- a/app/qml/components/BranchView.qml +++ b/app/qml/components/BranchView.qml @@ -1,7 +1,7 @@ import QtQuick 2.9 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 -import RustCode 1.0 +import GitbumrComponents 1.0 import "../base" import "../style" diff --git a/app/qml/components/DiffsView.qml b/app/qml/components/DiffsView.qml index 8dc4794..60c167f 100644 --- a/app/qml/components/DiffsView.qml +++ b/app/qml/components/DiffsView.qml @@ -1,5 +1,5 @@ import QtQuick 2.9 -import RustCode 1.0 +import GitbumrComponents 1.0 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import "../base" diff --git a/app/qml/components/GitView.qml b/app/qml/components/GitView.qml index 53e783e..6c78319 100644 --- a/app/qml/components/GitView.qml +++ b/app/qml/components/GitView.qml @@ -2,7 +2,7 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Controls 1.4 as QQC14 import QtQuick.Layouts 1.3 -import RustCode 1.0 +import GitbumrComponents 1.0 import "../style" import "../base" diff --git a/app/qml/components/RepoView.qml b/app/qml/components/RepoView.qml index 42267ef..e889413 100644 --- a/app/qml/components/RepoView.qml +++ b/app/qml/components/RepoView.qml @@ -2,7 +2,7 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.3 -import RustCode 1.0 +import GitbumrComponents 1.0 import "../base" import "../style" diff --git a/app/qml/main.qml b/app/qml/main.qml index 923c493..dbcd9d2 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -1,7 +1,7 @@ import QtQuick 2.9 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import RustCode 1.0 +import GitbumrComponents 1.0 import "components" import "base" import "style" diff --git a/lib/rustcode_plugin.cpp b/lib/gitbumrcomponents_plugin.cpp similarity index 76% rename from lib/rustcode_plugin.cpp rename to lib/gitbumrcomponents_plugin.cpp index 36ab115..56c3aac 100644 --- a/lib/rustcode_plugin.cpp +++ b/lib/gitbumrcomponents_plugin.cpp @@ -1,7 +1,7 @@ -#include "rustcode_plugin.h" +#include "gitbumrcomponents_plugin.h" #include -void RustCodePlugin::registerTypes(const char *uri) +void GitbumrComponentsPlugin::registerTypes(const char *uri) { qmlRegisterType(uri, 1, 0, "Repositories"); qmlRegisterType(uri, 1, 0, "Git"); diff --git a/lib/rustcode_plugin.h b/lib/gitbumrcomponents_plugin.h similarity index 74% rename from lib/rustcode_plugin.h rename to lib/gitbumrcomponents_plugin.h index 1c0f6f6..0ae00ad 100644 --- a/lib/rustcode_plugin.h +++ b/lib/gitbumrcomponents_plugin.h @@ -1,7 +1,7 @@ #include #include "Bindings.h" -class RustCodePlugin : public QQmlExtensionPlugin +class GitbumrComponentsPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) diff --git a/lib/lib.pro b/lib/lib.pro index 98e0a2a..e6df433 100644 --- a/lib/lib.pro +++ b/lib/lib.pro @@ -5,7 +5,7 @@ #------------------------------------------------- QT += qml quick quickcontrols2 -TARGET = rust +TARGET = gitcomponents TEMPLATE = lib CONFIG += c++14 plugin @@ -22,11 +22,11 @@ DEFINES += QT_DEPRECATED_WARNINGS SOURCES += \ Bindings.cpp \ - rustcode_plugin.cpp + gitbumrcomponents_plugin.cpp HEADERS += \ Bindings.h \ - rustcode_plugin.h + gitbumrcomponents_plugin.h DISTFILES = qmldir @@ -51,11 +51,10 @@ CONFIG(release, release|debug) { win32:CCRS_CFLAGS = cd & set CFLAGS=/MD } -DESTDIR = $$BUILD_MODE/RustCode +DESTDIR = $$BUILD_MODE/GitbumrComponents # Note that this is the rust "blob" itself, # so it's not in placed in the DESTDIR folder. LIBS += -L"$$PWD/target/$$RUST_TARGET/$$BUILD_MODE" -lrust -#message("LIBS => $$PWD/target/$$RUST_TARGET/$$BUILD_MODE") win32 { LIBS += WS2_32.lib Userenv.lib Advapi32.lib Shell32.lib \ winhttp.lib Rpcrt4.lib OLE32.LIB Userenv.lib user32.lib @@ -65,8 +64,8 @@ linux { } # if you are using Shadow build, you need to get the output folder -CONFIG(release, debug|release): DESTDIR = $$OUT_PWD/release/RustCode -CONFIG(debug, debug|release): DESTDIR = $$OUT_PWD/debug/RustCode +CONFIG(release, debug|release): DESTDIR = $$OUT_PWD/release/GitbumrComponents +CONFIG(debug, debug|release): DESTDIR = $$OUT_PWD/debug/GitbumrComponents #CONFIG(release, debug|release): DESTDIR = release #CONFIG(debug, debug|release): DESTDIR = debug @@ -85,8 +84,6 @@ RUST_FILES = \ src/implementation/hunks.rs \ src/implementation/diffs.rs -#copyshit.commands = "copy $$PWD/qmldir $$DESTDIR/qmldir" - rust_cargo.output = "$$PWD/target/$$RUST_TARGET/$$BUILD_MODE/rust.lib" linux:rust_cargo.output = "$$PWD/target/$$RUST_TARGET/$$BUILD_MODE/librust.a" rust_cargo.commands = $$CCRS_CFLAGS & \ @@ -98,9 +95,6 @@ rust_cargo.input = RUST_FILES # allow a clean build. # rust_cargo.clean = this_file_is_not_here & cargo clean --manifest-path="$$PWD/lib/Cargo.toml" QMAKE_EXTRA_COMPILERS += rust_cargo -#QMAKE_POST_LINK = copy qmldir $$DESTDIR/qmldir -# DISTFILES is only used when dist target is run via make. Just do a basic copy instead. -#system($$system_quote(copy $$PWD/qmldir $$DESTDIR/qmldir)) COPY_CMD=copy linux:COPY_CMD=cp diff --git a/lib/qmldir b/lib/qmldir index e2d2dc5..adc1e88 100644 --- a/lib/qmldir +++ b/lib/qmldir @@ -1,3 +1,3 @@ -module RustCode -plugin rust -classname RustCodePlugin +module GitbumrComponents +plugin gitcomponents +classname GitbumrComponentsPlugin diff --git a/readme.md b/readme.md index db58921..440b308 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,8 @@ # Gitbumr [![Build status](https://ci.appveyor.com/api/projects/status/211dlbqs63w61har?svg=true)](https://ci.appveyor.com/project/stofte/gitbumr) -Qt based Git client using a rust backend. This is a hobby-project, wip, eg do not commit important things with this client. +Qt based Git client using a rust backend. WIP. + +![Log view](https://i.imgur.com/NLjuY5R.png "Log view") # Development @@ -8,10 +10,12 @@ Following are requirements to build the repository locally. - [rustc 1.33.0](https://rustup.rs/) - [Qt 5.12.1](https://www.qt.io/offline-installers) - - [rust-qt-binding-generator](https://github.com/KDE/rust-qt-binding-generator) + - [rust-qt-binding-generator](https://github.com/KDE/rust-qt-binding-generator) The project has a QtCreator project, which doubles as a project file and a -makefile for [qmake](http://doc.qt.io/qt-5/qmake-manual.html). +makefile for [qmake](http://doc.qt.io/qt-5/qmake-manual.html). Generated bindings +are checked into sourcecontrol so the rust-qt binding generator is not required +for just building. ## Rust+Qt bindings @@ -45,9 +49,11 @@ Tested on Ubuntu 18.04.2 LTS from Windows, using PuTTY/[VcXsrv](https://sourcefo - Install `./qt-opensource-linux-x64-5.12.1.run` - Ensure *Tools > QtCreator* and *Qt > Desktop gcc 64-bit* are selected -Be sure to run VcXsrv in the [right configuration](https://github.com/Microsoft/WSL/issues/2855#issuecomment-358861903) and remember to set/export `LIBGL_ALWAYS_INDIRECT=1` in the shell. If using PuTTY, also remember to check "Enable X11 forwarding" under *Connection > SSH > X11*, -and instead of setting the `DISPLAY` env variable in the shell (which did not work for me), -enter `:0` for "X display location". +Be sure to run VcXsrv in the [right configuration](https://github.com/Microsoft/WSL/issues/2855#issuecomment-358861903) +and remember to set/export `LIBGL_ALWAYS_INDIRECT=1` in the shell. If using PuTTY, +also remember to check "Enable X11 forwarding" under *Connection > SSH > X11*, +and instead of setting the `DISPLAY` env variable in the shell, enter `:0` in +the "X display location" field. ## Automated Tests diff --git a/test/tst_GitTests.qml b/test/tst_GitTests.qml index a96c1bc..bbc5689 100644 --- a/test/tst_GitTests.qml +++ b/test/tst_GitTests.qml @@ -1,7 +1,7 @@ import QtQuick 2.9 import QtQuick.Window 2.2 import QtTest 1.0 -import RustCode 1.0 +import GitbumrComponents 1.0 TestCase { name: "GitTests"