Compare commits
10 commits
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 79da9d8074 | ||
Bruno BELANYI | eacb0230dd | ||
Bruno BELANYI | 2c807f6a52 | ||
Bruno BELANYI | 5ff0fb460d | ||
Bruno BELANYI | 74825f34a7 | ||
Bruno BELANYI | f8687ee5bd | ||
Bruno BELANYI | bc54c3a6f6 | ||
Bruno BELANYI | 9d0f311598 | ||
Bruno BELANYI | 5002193c63 | ||
Bruno BELANYI | 66747de1bb |
|
@ -7,4 +7,8 @@ Language: Cpp
|
|||
# Force pointers to the type for C++.
|
||||
DerivePointerAlignment: false
|
||||
PointerAlignment: Left
|
||||
|
||||
# Break after every argument or not at all
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
---
|
||||
|
|
31
.woodpecker/check.yml
Normal file
31
.woodpecker/check.yml
Normal file
|
@ -0,0 +1,31 @@
|
|||
labels:
|
||||
type: exec
|
||||
|
||||
pipeline:
|
||||
- name: flake check
|
||||
image: bash
|
||||
commands:
|
||||
- nix flake check
|
||||
|
||||
- name: package check
|
||||
image: bash
|
||||
commands:
|
||||
- nix build
|
||||
|
||||
- name: notify
|
||||
image: bash
|
||||
secrets:
|
||||
- source: matrix_roomid
|
||||
target: room
|
||||
- source: matrix_username
|
||||
target: user
|
||||
- source: matrix_password
|
||||
target: pass
|
||||
- source: matrix_homeserver
|
||||
target: address
|
||||
commands:
|
||||
- nix run github:ambroisie/matrix-notifier
|
||||
when:
|
||||
status:
|
||||
- failure
|
||||
- success
|
78
flake.lock
78
flake.lock
|
@ -1,28 +1,65 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1673956053,
|
||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1631561581,
|
||||
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
|
||||
"lastModified": 1678901627,
|
||||
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
|
||||
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"ref": "master",
|
||||
"ref": "main",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"pre-commit-hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1660459072,
|
||||
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1633329294,
|
||||
"narHash": "sha256-0LpQLS4KMgxslMgmDHmxG/5twFlXDBW9z4Or1iOrCvU=",
|
||||
"lastModified": 1680273054,
|
||||
"narHash": "sha256-Bs6/5LpvYp379qVqGt9mXxxx9GSE789k3oFc+OAL07M=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ee084c02040e864eeeb4cf4f8538d92f7c675671",
|
||||
"rev": "3364b5b117f65fe1ce65a3cdd5612a078a3b31e3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -32,21 +69,40 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1678872516,
|
||||
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-22.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
],
|
||||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1631170176,
|
||||
"narHash": "sha256-RLN/kur2Kpxt0cJp0Fms8ixuGpT8IHX0OpeQ8u8f0X4=",
|
||||
"lastModified": 1680170909,
|
||||
"narHash": "sha256-FtKU/edv1jFRr/KwUxWTYWXEyj9g8GBrHntC2o8oFI8=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "3ed0e618cebc1ff291c27b749cf7568959cac028",
|
||||
"rev": "29dbe1efaa91c3a415d8b45d62d48325a4748816",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
18
flake.nix
18
flake.nix
|
@ -6,7 +6,7 @@
|
|||
type = "github";
|
||||
owner = "numtide";
|
||||
repo = "flake-utils";
|
||||
ref = "master";
|
||||
ref = "main";
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
|
@ -49,15 +49,12 @@
|
|||
|
||||
checks = {
|
||||
pre-commit = pre-commit-hooks.lib.${system}.run {
|
||||
src = self;
|
||||
src = ./.;
|
||||
|
||||
hooks = {
|
||||
clang-format = {
|
||||
enable = true;
|
||||
name = "clang-format";
|
||||
entry = "${pkgs.clang-tools}/bin/clang-format -style=file -i";
|
||||
types = [ "text" "c++" ];
|
||||
language = "system";
|
||||
types_or = [ "c++" ];
|
||||
};
|
||||
|
||||
nixpkgs-fmt = {
|
||||
|
@ -72,10 +69,9 @@
|
|||
defaultPackage = packages.dragger;
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [ ]
|
||||
++ defaultPackage.nativeBuildInputs
|
||||
++ defaultPackage.buildInputs
|
||||
;
|
||||
inputsFrom = with packages; [
|
||||
dragger
|
||||
];
|
||||
|
||||
inherit (checks.pre-commit) shellHook;
|
||||
};
|
||||
|
@ -104,7 +100,7 @@
|
|||
description = "A CLI drag-and-drop tool";
|
||||
homepage = "https://gitea.belanyi.fr/ambroisie/dragger";
|
||||
license = licenses.mit;
|
||||
maintainers = [ ambroisie ];
|
||||
maintainers = with maintainers; [ ambroisie ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QDebug>
|
||||
#include <QDrag>
|
||||
#include <QFile>
|
||||
|
@ -9,10 +10,23 @@
|
|||
|
||||
int main(int argc, char* argv[]) {
|
||||
QApplication app(argc, argv);
|
||||
QApplication::setApplicationName("dragger");
|
||||
QApplication::setApplicationVersion("0.1.0");
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription("A CLI drag-and-drop tool");
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
parser.addPositionalArgument(
|
||||
"files",
|
||||
QCoreApplication::translate("files", "files to drag-and-drop"),
|
||||
"[FILES...]");
|
||||
|
||||
parser.process(app);
|
||||
|
||||
QList<QUrl> urls;
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
QFileInfo file(QFile(argv[i]));
|
||||
for (auto const& path : parser.positionalArguments()) {
|
||||
QFileInfo file{QFile{path}};
|
||||
if (file.exists()) {
|
||||
urls << QUrl("file:" + file.absoluteFilePath());
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue