Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • fix_opensuse_package_build
  • develop
  • release-1.0.0
  • release-1.0.1
  • release-2.0.0
  • release-2.0.1
  • release-2.0.2
  • release-2.0.3
  • release-3.0.0
  • release-3.0.1
  • release-3.0.2
  • release-3.0.3
  • release-3.1.0
14 results

Target

Select target project
  • akiraohgaki / ocs-url
  • ab3875o / ocs-url
  • dembego3 / ocs-url
  • arakun / ocs-url
  • longviauroy / ocs-url
  • rolfen / ocs-url
  • hemm / ocs-url
  • simonsvw0000 / ocs-url
  • DFN2 / ocs-url
  • rws77 / ocs-url
  • bitwalk / ocs-url
  • visdom / ocs-url
  • ricatfarker / ocs-url
  • mussah / ocs-url
  • tigefa / ocs-url
  • cobalt2727 / ocs-url
  • ammark226 / ocs-url
  • violethaze74 / ocs-url
  • armedssault / ocs-url
  • billflick / ocs-url
20 results
Select Git revision
  • master
  • fix_opensuse_package_build
  • develop
  • release-1.0.0
  • release-1.0.1
  • release-2.0.0
  • release-2.0.1
  • release-2.0.2
  • release-2.0.3
  • release-3.0.0
  • release-3.0.1
  • release-3.0.2
  • release-3.0.3
  • release-3.1.0
14 results
Show changes
88 files
+ 2515
2435
Compare changes
  • Side-by-side
  • Inline

Files

+2 −1
Original line number Diff line number Diff line
*.pro.user
pkg/build/
build_*/
lib/qtil/

.gitlab-ci.yml

0 → 100644
+54 −0
Original line number Diff line number Diff line
stages:
  - build

ubuntu_deb:
  stage: build
  image: ubuntu:14.04
  only:
    - master
    - /^release\-.+/
  script:
    - ./scripts/package ubuntu_deb
  artifacts:
    paths:
    - build_*/ocs-url*.deb
    expire_in: 2 days

fedora_rpm:
  stage: build
  image: fedora:20
  only:
    - master
    - /^release\-.+/
  script:
    - ./scripts/package fedora_rpm
  artifacts:
    paths:
    - build_*/RPMS/x86_64/ocs-url*.rpm
    expire_in: 2 days

opensuse_rpm:
  stage: build
  image: opensuse/leap:42.3
  only:
    - master
    - /^release\-.+/
  script:
    - ./scripts/package opensuse_rpm
  artifacts:
    paths:
    - build_*/RPMS/x86_64/ocs-url*.rpm
    expire_in: 2 days

archlinux_pkg:
  stage: build
  image: archlinux/base:latest
  only:
    - master
    - /^release\-.+/
  script:
    - ./scripts/package archlinux_pkg
  artifacts:
    paths:
    - build_*/ocs-url*.pkg.tar.xz
    expire_in: 2 days

.travis.yml

deleted100644 → 0
+0 −26
Original line number Diff line number Diff line
language: cpp
sudo: required
dist: trusty

before_install:
  - sudo add-apt-repository -y ppa:beineri/opt-qt57-trusty
  - sudo apt-get update -qq

install:
  - sudo apt-get -y install build-essential fuse zsync desktop-file-utils
  - sudo apt-get -y install qt57base qt57svg qt57declarative qt57quickcontrols
  # Replace linuxdeployqt download URL to official download URL when the stable version released
  - curl -L -o linuxdeployqt https://dl.dropboxusercontent.com/u/150776/temp/linuxdeployqt-799f704-x86-64.appimage
  - sudo install -m 755 -p linuxdeployqt /usr/local/bin/linuxdeployqt
  - rm linuxdeployqt

before_script:
  - sudo modprobe fuse
  - source /opt/qt57/bin/qt57-env.sh

script:
  - sh ./pkg/build.sh appimage

after_script:
  - appimage_file="$(ls ./pkg/build/*.AppImage)"
  - [ -f "${appimage_file}" ] && curl -T "${appimage_file}" "https://transfer.sh/${appimage_file}"
+7 −7
Original line number Diff line number Diff line
# xdgurl
# ocs-url

An install helper program for desktop stuff.
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

Copyright: 2016-2017, Akira Ohgaki
An install helper program for items served via OpenCollaborationServices (ocs://).

Copyright: 2016-2019, Opendesktop.org

License: GPL-3+

Download Linux package from:

https://www.linux-apps.com/p/1136805/

And please check the xdgurl wiki for more information.
https://www.opendesktop.org/p/1136805/

https://github.com/xdgurl/xdgurl/wiki
And please see docs/* for more information.
Original line number Diff line number Diff line
CONFIG += c++11

QT += \
    core \
    gui \
    widgets \
    qml \
    quick \
    svg

HEADERS += \
    $${PWD}/handlers/xdgurlhandler.h
    $${PWD}/src/handlers/confighandler.h \
    $${PWD}/src/handlers/ocsurlhandler.h

SOURCES += \
    $${PWD}/main.cpp \
    $${PWD}/handlers/xdgurlhandler.cpp
    $${PWD}/src/main.cpp \
    $${PWD}/src/handlers/confighandler.cpp \
    $${PWD}/src/handlers/ocsurlhandler.cpp

RESOURCES += \
    $${PWD}/configs/configs.qrc \
    $${PWD}/images/images.qrc \
    $${PWD}/qml/qml.qrc

INCLUDEPATH += $${PWD}/src
+13 −0
Original line number Diff line number Diff line
{
    "id": "ocs-url",
    "name": "ocs-url",
    "version": "3.1.0",
    "organization": "Opendesktop.org",
    "domain": "org.opendesktop.ocs-url",
    "icon": ":/desktop/ocs-url.svg",
    "description": "An install helper program for items served via OpenCollaborationServices (ocs://).",
    "license": "GPL-3+",
    "author": "Opendesktop.org",
    "contact": "contact@opendesktop.org",
    "homepage": "https://git.opendesktop.org/akiraohgaki/ocs-url"
}
Original line number Diff line number Diff line
<RCC>
    <qresource prefix="/configs">
        <file>application.json</file>
        <file>destinations.json</file>
        <file>destinations_alias.json</file>
        <file>install_types.json</file>
        <file>install_types_alias.json</file>
    </qresource>
</RCC>
+192 −0
Original line number Diff line number Diff line
{
    "bin": {
        "name": "Software",
        "destination": "$HOME/.local/bin",
        "generic_destination": "$APP_DATA/bin"
    },
    "downloads": {
        "name": "Downloads",
        "destination": "$XDG_DOWNLOAD_DIR",
        "generic_destination": "$APP_DATA/downloads"
    },
    "documents": {
        "name": "Documents",
        "destination": "$XDG_DOCUMENTS_DIR",
        "generic_destination": "$APP_DATA/documents"
    },
    "pictures": {
        "name": "Pictures",
        "destination": "$XDG_PICTURES_DIR",
        "generic_destination": "$APP_DATA/pictures"
    },
    "music": {
        "name": "Music",
        "destination": "$XDG_MUSIC_DIR",
        "generic_destination": "$APP_DATA/music"
    },
    "videos": {
        "name": "Videos",
        "destination": "$XDG_VIDEOS_DIR",
        "generic_destination": "$APP_DATA/videos"
    },
    "wallpapers": {
        "name": "Wallpapers",
        "destination": "$XDG_DATA_HOME/wallpapers",
        "generic_destination": "$APP_DATA/wallpapers"
    },
    "fonts": {
        "name": "Fonts",
        "destination": "$HOME/.fonts",
        "generic_destination": "$APP_DATA/fonts"
    },
    "cursors": {
        "name": "Cursors",
        "destination": "$HOME/.icons",
        "generic_destination": "$APP_DATA/cursors"
    },
    "icons": {
        "name": "Icons",
        "destination": "$XDG_DATA_HOME/icons",
        "generic_destination": "$APP_DATA/icons"
    },
    "emoticons": {
        "name": "Emoticons",
        "destination": "$XDG_DATA_HOME/emoticons",
        "generic_destination": "$APP_DATA/emoticons"
    },
    "themes": {
        "name": "Desktop Themes",
        "destination": "$HOME/.themes",
        "generic_destination": "$APP_DATA/themes"
    },
    "emerald_themes": {
        "name": "Emerald Themes",
        "destination": "$HOME/.emerald/themes",
        "generic_destination": "$APP_DATA/emerald_themes"
    },
    "enlightenment_themes": {
        "name": "Enlightenment Themes",
        "destination": "$HOME/.e/e/themes",
        "generic_destination": "$APP_DATA/enlightenment_themes"
    },
    "enlightenment_backgrounds": {
        "name": "Enlightenment Backgrounds",
        "destination": "$HOME/.e/e/backgrounds",
        "generic_destination": "$APP_DATA/enlightenment_backgrounds"
    },
    "fluxbox_styles": {
        "name": "Fluxbox Styles",
        "destination": "$HOME/.fluxbox/styles",
        "generic_destination": "$APP_DATA/fluxbox_styles"
    },
    "pekwm_themes": {
        "name": "PekWM Themes",
        "destination": "$HOME/.pekwm/themes",
        "generic_destination": "$APP_DATA/pekwm_themes"
    },
    "icewm_themes": {
        "name": "IceWM Themes",
        "destination": "$HOME/.icewm/themes",
        "generic_destination": "$APP_DATA/icewm_themes"
    },
    "plasma_plasmoids": {
        "name": "Plasma Plasmoids",
        "destination": "$XDG_DATA_HOME/plasma/plasmoids",
        "generic_destination": "$APP_DATA/plasma_plasmoids"
    },
    "plasma_look_and_feel": {
        "name": "Plasma Look and Feel",
        "destination": "$XDG_DATA_HOME/plasma/look-and-feel",
        "generic_destination": "$APP_DATA/plasma_look_and_feel"
    },
    "plasma_desktopthemes": {
        "name": "Plasma Desktop Themes",
        "destination": "$XDG_DATA_HOME/plasma/desktoptheme",
        "generic_destination": "$APP_DATA/plasma_desktopthemes"
    },
    "kwin_effects": {
        "name": "KWin Effects",
        "destination": "$XDG_DATA_HOME/kwin/effects",
        "generic_destination": "$APP_DATA/kwin_effects"
    },
    "kwin_scripts": {
        "name": "KWin Scripts",
        "destination": "$XDG_DATA_HOME/kwin/scripts",
        "generic_destination": "$APP_DATA/kwin_scripts"
    },
    "kwin_tabbox": {
        "name": "KWin Window Switcher",
        "destination": "$XDG_DATA_HOME/kwin/tabbox",
        "generic_destination": "$APP_DATA/kwin_tabbox"
    },
    "aurorae_themes": {
        "name": "Aurorae Themes",
        "destination": "$XDG_DATA_HOME/aurorae/themes",
        "generic_destination": "$APP_DATA/aurorae_themes"
    },
    "dekorator_themes": {
        "name": "deKorator Themes",
        "destination": "$XDG_DATA_HOME/deKorator/themes",
        "generic_destination": "$APP_DATA/dekorator_themes"
    },
    "qtcurve": {
        "name": "QtCurve Themes",
        "destination": "$XDG_DATA_HOME/QtCurve",
        "generic_destination": "$APP_DATA/qtcurve"
    },
    "color_schemes": {
        "name": "KDE Color Schemes",
        "destination": "$XDG_DATA_HOME/color-schemes",
        "generic_destination": "$APP_DATA/color_schemes"
    },
    "gnome_shell_extensions": {
        "name": "Gnome Shell Extensions",
        "destination": "$XDG_DATA_HOME/gnome-shell/extensions",
        "generic_destination": "$APP_DATA/gnome_shell_extensions"
    },
    "cinnamon_applets": {
        "name": "Cinnamon Applets",
        "destination": "$XDG_DATA_HOME/cinnamon/applets",
        "generic_destination": "$APP_DATA/cinnamon_applets"
    },
    "cinnamon_desklets": {
        "name": "Cinnamon Desklets",
        "destination": "$XDG_DATA_HOME/cinnamon/desklets",
        "generic_destination": "$APP_DATA/cinnamon_desklets"
    },
    "cinnamon_extensions": {
        "name": "Cinnamon Extensions",
        "destination": "$XDG_DATA_HOME/cinnamon/extensions",
        "generic_destination": "$APP_DATA/cinnamon_extensions"
    },
    "nautilus_scripts": {
        "name": "Nautilus Scripts",
        "destination": "$XDG_DATA_HOME/nautilus/scripts",
        "generic_destination": "$APP_DATA/nautilus_scripts"
    },
    "amarok_scripts": {
        "name": "Amarok Scripts",
        "destination": "$KDEHOME/share/apps/amarok/scripts",
        "generic_destination": "$APP_DATA/amarok_scripts"
    },
    "yakuake_skins": {
        "name": "Yakuake Skins",
        "destination": "$KDEHOME/share/apps/yakuake/skins",
        "generic_destination": "$APP_DATA/yakuake_skins"
    },
    "cairo_clock_themes": {
        "name": "Cairo-Clock Themes",
        "destination": "$HOME/.cairo-clock/themes",
        "generic_destination": "$APP_DATA/cairo_clock_themes"
    },
    "books": {
        "name": "Books",
        "destination": "$APP_DATA/books",
        "generic_destination": "$APP_DATA/books"
    },
    "comics": {
        "name": "Comics",
        "destination": "$APP_DATA/comics",
        "generic_destination": "$APP_DATA/comics"
    }
}
+62 −0
Original line number Diff line number Diff line
{
    "gnome_shell_themes": {
        "base": "themes",
        "name": "Gnome Shell Themes"
    },
    "cinnamon_themes": {
        "base": "themes",
        "name": "Cinnamon Themes"
    },
    "gtk2_themes": {
        "base": "themes",
        "name": "GTK2 Themes"
    },
    "gtk3_themes": {
        "base": "themes",
        "name": "GTK3 Themes"
    },
    "metacity_themes": {
        "base": "themes",
        "name": "Metacity Themes"
    },
    "xfwm4_themes": {
        "base": "themes",
        "name": "XFWM4 Themes"
    },
    "openbox_themes": {
        "base": "themes",
        "name": "Openbox Themes"
    },
    "kvantum_themes": {
        "base": "themes",
        "name": "Kvantum Themes"
    },
    "compiz_themes": {
        "base": "emerald_themes",
        "name": "Compiz Themes"
    },
    "beryl_themes": {
        "base": "emerald_themes",
        "name": "Beryl Themes"
    },
    "plasma4_plasmoids": {
        "base": "plasma_plasmoids",
        "name": "Plasma4 Plasmoids"
    },
    "plasma5_plasmoids": {
        "base": "plasma_plasmoids",
        "name": "Plasma5 Plasmoids"
    },
    "plasma5_look_and_feel": {
        "base": "plasma_look_and_feel",
        "name": "Plasma5 Look and Feel"
    },
    "plasma5_desktopthemes": {
        "base": "plasma_desktopthemes",
        "name": "Plasma5 Desktop Themes"
    },
    "plasma_color_schemes": {
        "base": "color_schemes",
        "name": "Plasma Color Schemes"
    }
}
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="128" height="128" viewBox="0, 0, 128, 128">
  <g id="icon">
    <path d="M64,8 C33.072,8 8,33.072 8,64 C8,94.928 33.072,120 64,120 C94.928,120 120,94.928 120,64 C120,33.072 94.928,8 64,8 z M64,24 C68.418,24 72,27.582 72,32 C72,36.418 68.418,40 64,40 C59.582,40 56,36.418 56,32 C56,27.582 59.582,24 64,24 z M48,48 L72,48 L72,96 L80,96 L80,104 L48,104 L48,96 L56,96 L56,56 L48,56 L48,48 z" fill="#000000" id="dialog-information"/>
  </g>
</svg>
+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="128" height="128" viewBox="0, 0, 128, 128">
  <g id="icon">
    <path d="M64,16 L8,112 L120,112 L64,16 z M56,48 L72,48 L72,80 L56,80 L56,48 z M64,88 C68.418,88 72,91.582 72,96 C72,100.418 68.418,104 64,104 C59.582,104 56,100.418 56,96 C56,91.582 59.582,88 64,88 z" fill="#000000" id="dialog-warning"/>
  </g>
</svg>
+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="128" height="128" viewBox="0, 0, 128, 128">
  <g id="icon">
    <path d="M64,8 C33.072,8 8,33.072 8,64 C8,94.928 33.072,120 64,120 C94.928,120 120,94.928 120,64 C120,33.072 94.928,8 64,8 z M80,32 L104,32 L56,104 L32,80 L32,56 L56,80 L80,32 z" fill="#000000" id="emblem-default"/>
  </g>
</svg>
+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="128" height="128" viewBox="0, 0, 128, 128">
  <g id="icon">
    <path d="M40,8 L40,48 L16,48 L64,96 L112,48 L88,48 L88,8 L40,8 z M8,72 L8,120 L120,120 L120,72 L104,72 L104,104 L24,104 L24,72 L8,72 z" fill="#000000" id="emblem-downloads"/>
  </g>
</svg>

app/images/images.qrc

0 → 100644
+8 −0
Original line number Diff line number Diff line
<RCC>
    <qresource prefix="/images">
        <file>icons/dialog-information.svg</file>
        <file>icons/dialog-warning.svg</file>
        <file>icons/emblem-default.svg</file>
        <file>icons/emblem-downloads.svg</file>
    </qresource>
</RCC>

app/qml/main.qml

0 → 100644
+169 −0
Original line number Diff line number Diff line
import QtQuick 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0

import "ui" as Ui

import "scripts/Utility.js" as Utility

ApplicationWindow {
    id: app

    title: configHandler.getAppConfigApplication().name

    visible: true
    width: 400
    minimumWidth: width
    maximumWidth: width
    height: 200
    minimumHeight: height
    maximumHeight: height

    function init() {
        var metadata = ocsUrlHandler.metadata();

        var primaryMessages = {
            "success_download": qsTr("Download successful"),
            "success_install": qsTr("Installation successful"),
            "error_validation": qsTr("Validation error"),
            "error_network": qsTr("Network error"),
            "error_save": qsTr("Saving file failed"),
            "error_install": qsTr("Installation failed")
        };

        ocsUrlHandler.started.connect(function() {
            confirmDialog.close();
            progressDialog.open();
        });

        ocsUrlHandler.finishedWithSuccess.connect(function(result) {
            progressDialog.close();
            infoDialog.primaryText = primaryMessages[result.status];
            infoDialog.informativeText = metadata.filename;
            infoDialog.detailedText = result.message;
            infoDialog.open();
        });

        ocsUrlHandler.finishedWithError.connect(function(result) {
            progressDialog.close();
            errorDialog.primaryText = primaryMessages[result.status];
            errorDialog.informativeText = metadata.filename;
            errorDialog.detailedText = result.message;
            errorDialog.open();
        });

        ocsUrlHandler.downloadProgress.connect(function(id, bytesReceived, bytesTotal) {
            progressDialog.primaryText = qsTr("Downloading");
            progressDialog.informativeText = metadata.filename;
            progressDialog.detailedContentLoader.item.progressBar = bytesReceived / bytesTotal;
            progressDialog.detailedContentLoader.item.progressText
                    = Utility.convertByteToHumanReadable(bytesReceived)
                    + " / " + Utility.convertByteToHumanReadable(bytesTotal);
        });

        if (ocsUrlHandler.isValid()) {
            if (metadata.command === "download") {
                confirmDialog.primaryText = qsTr("Do you want to download?");
            }
            else if (metadata.command === "install") {
                confirmDialog.primaryText = qsTr("Do you want to install?");
            }
            confirmDialog.informativeText = metadata.filename;
            confirmDialog.detailedText
                    = qsTr("URL") + ": " + metadata.url + "\n"
                    + qsTr("File") + ": " + metadata.filename + "\n"
                    + qsTr("Type") + ": " + configHandler.getAppConfigInstallTypes()[metadata.type].name;
            confirmDialog.open();
        }
        else {
            errorDialog.primaryText = primaryMessages["error_validation"];
            errorDialog.detailedText = qsTr("Invalid OCS-URL");
            errorDialog.open();
        }
    }

    function fixWindowSize(dialog) {
        if (dialog.visible) {
            app.height = dialog.implicitHeight + (dialog.anchors.margins * 2);
            app.minimumHeight = app.height;
            app.maximumHeight = app.height;
        }
    }

    Ui.Dialog {
        id: confirmDialog
        icon: "qrc:/images/icons/dialog-information.svg"
        actionButton.text: qsTr("Details")
        actionButton.onClicked: toggleDetails()
        acceptButton.text: qsTr("OK")
        acceptButton.onClicked: ocsUrlHandler.process()
        rejectButton.text: qsTr("Cancel")
        rejectButton.onClicked: Qt.quit()
        onVisibleChanged: app.fixWindowSize(confirmDialog)
        onImplicitHeightChanged: app.fixWindowSize(confirmDialog)
    }

    Ui.Dialog {
        id: infoDialog
        icon: "qrc:/images/icons/emblem-default.svg"
        actionButton.text: qsTr("Details")
        actionButton.onClicked: toggleDetails()
        acceptButton.text: qsTr("Open")
        acceptButton.onClicked: {
            ocsUrlHandler.openDestination();
            Qt.quit();
        }
        rejectButton.text: qsTr("Close")
        rejectButton.onClicked: Qt.quit()
        onVisibleChanged: app.fixWindowSize(infoDialog)
        onImplicitHeightChanged: app.fixWindowSize(infoDialog)
    }

    Ui.Dialog {
        id: errorDialog
        icon: "qrc:/images/icons/dialog-warning.svg"
        actionButton.text: qsTr("Details")
        actionButton.onClicked: toggleDetails()
        rejectButton.text: qsTr("Close")
        rejectButton.onClicked: Qt.quit()
        onVisibleChanged: app.fixWindowSize(errorDialog)
        onImplicitHeightChanged: app.fixWindowSize(errorDialog)
    }

    Component {
        id: progressComponent
        ColumnLayout {
            property alias progressBar: progressBar.value
            property alias progressText: progressText.text
            anchors.fill: parent
            spacing: 4
            ProgressBar {
                id: progressBar
                minimumValue: 0
                maximumValue: 1
                value: 0
                Layout.fillWidth: true
            }
            Label {
                id: progressText
                text: ""
                Layout.alignment: Qt.AlignRight
            }
        }
    }

    Ui.Dialog {
        id: progressDialog
        icon: "qrc:/images/icons/emblem-downloads.svg"
        detailsVisible: true
        detailedContentLoader.sourceComponent: progressComponent
        rejectButton.text: qsTr("Cancel")
        rejectButton.onClicked: Qt.quit()
        onVisibleChanged: app.fixWindowSize(progressDialog)
        onImplicitHeightChanged: app.fixWindowSize(progressDialog)
    }

    Component.onCompleted: {
        app.init();
    }
}
Original line number Diff line number Diff line
<RCC>
    <qresource prefix="/qml">
        <file>main.qml</file>
        <file>ui/Dialog.qml</file>
        <file>scripts/Utility.js</file>
    </qresource>
</RCC>

app/qml/ui/Dialog.qml

0 → 100644
+113 −0
Original line number Diff line number Diff line
import QtQuick 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0

ColumnLayout {
    id: dialog

    visible: false
    anchors.fill: parent
    anchors.margins: 12
    spacing: 12

    property alias icon: icon.source
    property alias primaryText: primaryText.text
    property alias informativeText: informativeText.text

    property alias detailsVisible: details.visible
    property alias detailedText: detailedText.text
    property alias detailedContentLoader: detailedContentLoader

    property alias actionButton: actionButton
    property alias acceptButton: acceptButton
    property alias rejectButton: rejectButton

    function open() {
        dialog.visible = true;
    }

    function close() {
        dialog.visible = false;
    }

    function toggleDetails() {
        details.visible = details.visible ? false : true;
    }

    RowLayout {
        Layout.fillWidth: true
        spacing: 12
        Image {
            id: icon
            source: ""
            visible: source.toString() ? true : false
            Layout.preferredWidth: 48
            Layout.preferredHeight: 48
            sourceSize.width: 128
            sourceSize.height: 128
        }
        ColumnLayout {
            Layout.fillWidth: true
            spacing: 4
            Label {
                id: primaryText
                text: ""
                visible: text ? true : false
                Layout.fillWidth: true
                wrapMode: Text.WrapAnywhere
                font.bold: true
                font.pixelSize: 14
            }
            Label {
                id: informativeText
                text: ""
                visible: text ? true : false
                Layout.fillWidth: true
                wrapMode: Text.WrapAnywhere
            }
        }
    }

    ColumnLayout {
        id: details
        visible: false
        Layout.fillWidth: true
        Layout.fillHeight: true
        spacing: 12
        Label {
            id: detailedText
            text: ""
            visible: text ? true : false
            Layout.fillWidth: true
            wrapMode: Text.WrapAnywhere
        }
        Loader {
            id: detailedContentLoader
            visible: (source.toString() || sourceComponent) ? true : false
            Layout.fillWidth: true
        }
    }

    RowLayout {
        Layout.fillWidth: true
        spacing: 4
        Button {
            id: actionButton
            text: ""
            visible: text ? true : false
        }
        Item {
            Layout.fillWidth: true
        }
        Button {
            id: acceptButton
            text: ""
            visible: text ? true : false
        }
        Button {
            id: rejectButton
            text: ""
            visible: text ? true : false
        }
    }
}
+85 −0
Original line number Diff line number Diff line
#include "confighandler.h"

#include <QStringList>
#include <QStandardPaths>

#include "qtil_dir.h"

ConfigHandler::ConfigHandler(QObject *parent)
    : QObject(parent)
{
    appConfig_ = Qtil::Config(":/configs");
    importAppConfigApplication();
    importAppConfigInstallTypes();
}

QJsonObject ConfigHandler::getAppConfigApplication() const
{
    return appConfigApplication_;
}

QJsonObject ConfigHandler::getAppConfigInstallTypes() const
{
    return appConfigInstallTypes_;
}

void ConfigHandler::importAppConfigApplication()
{
    appConfigApplication_ = appConfig_.get("application");
}

void ConfigHandler::importAppConfigInstallTypes()
{
    auto installTypes = appConfig_.get("install_types");
    for (const auto &key : installTypes.keys()) {
        auto installtype = installTypes[key].toObject();
        installtype["destination"] = convertPathString(installtype["destination"].toString());
        installtype["generic_destination"] = convertPathString(installtype["generic_destination"].toString());
        installTypes[key] = installtype;
    }
    auto installTypesAlias = appConfig_.get("install_types_alias");
    for (const auto &key : installTypesAlias.keys()) {
        auto installTypeAlias = installTypesAlias[key].toObject();
        auto baseKey = installTypeAlias["base"].toString();
        if (installTypes.contains(baseKey)) {
            auto installType = installTypes[baseKey].toObject();
            installType["base"] = baseKey;
            installType["name"] = installTypeAlias["name"].toString();
            installTypes[key] = installType;
        }
    }
    appConfigInstallTypes_ = installTypes;
}

QString ConfigHandler::convertPathString(const QString &path) const
{
    auto newPath = path;
    if (newPath.contains("$HOME")) {
        newPath.replace("$HOME", Qtil::Dir::homePath());
    }
    else if (newPath.contains("$XDG_DOCUMENTS_DIR")) {
        newPath.replace("$XDG_DOCUMENTS_DIR", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
    }
    else if (newPath.contains("$XDG_DOWNLOAD_DIR")) {
        newPath.replace("$XDG_DOWNLOAD_DIR", QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
    }
    else if (newPath.contains("$XDG_PICTURES_DIR")) {
        newPath.replace("$XDG_PICTURES_DIR", QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
    }
    else if (newPath.contains("$XDG_MUSIC_DIR")) {
        newPath.replace("$XDG_MUSIC_DIR", QStandardPaths::writableLocation(QStandardPaths::MusicLocation));
    }
    else if (newPath.contains("$XDG_VIDEOS_DIR")) {
        newPath.replace("$XDG_VIDEOS_DIR", QStandardPaths::writableLocation(QStandardPaths::MoviesLocation));
    }
    else if (newPath.contains("$XDG_DATA_HOME")) {
        newPath.replace("$XDG_DATA_HOME", Qtil::Dir::genericDataPath());
    }
    else if (newPath.contains("$KDEHOME")) {
        newPath.replace("$KDEHOME", Qtil::Dir::kdehomePath());
    }
    else if (newPath.contains("$APP_DATA")) {
        newPath.replace("$APP_DATA", Qtil::Dir::genericDataPath() + "/" + getAppConfigApplication()["id"].toString());
    }
    return newPath;
}
+27 −0
Original line number Diff line number Diff line
#pragma once

#include <QObject>
#include <QJsonObject>

#include "qtil_config.h"

class ConfigHandler : public QObject
{
    Q_OBJECT

public:
    explicit ConfigHandler(QObject *parent = nullptr);

public slots:
    QJsonObject getAppConfigApplication() const;
    QJsonObject getAppConfigInstallTypes() const;

private:
    void importAppConfigApplication();
    void importAppConfigInstallTypes();
    QString convertPathString(const QString &path) const;

    Qtil::Config appConfig_;
    QJsonObject appConfigApplication_;
    QJsonObject appConfigInstallTypes_;
};
Original line number Diff line number Diff line
#include "xdgurlhandler.h"
#include "ocsurlhandler.h"

#include <QUrlQuery>
#include <QDesktopServices>

#include "qtlib_file.h"
#include "qtlib_dir.h"
#include "qtlib_networkresource.h"
#include "qtlib_package.h"
#include "qtil_file.h"
#include "qtil_dir.h"
#include "qtil_networkresource.h"
#include "qtil_package.h"

XdgUrlHandler::XdgUrlHandler(const QString &xdgUrl, const qtlib::Config &config, QObject *parent)
    : QObject(parent), xdgUrl_(xdgUrl), config_(config)
#include "handlers/confighandler.h"

OcsUrlHandler::OcsUrlHandler(const QString &ocsUrl, ConfigHandler *configHandler, QObject *parent)
    : QObject(parent), ocsUrl_(ocsUrl), configHandler_(configHandler)
{
    parse();
    loadDestinations();
}

QString XdgUrlHandler::xdgUrl() const
QString OcsUrlHandler::ocsUrl() const
{
    return xdgUrl_;
    return ocsUrl_;
}

QJsonObject XdgUrlHandler::metadata() const
QJsonObject OcsUrlHandler::metadata() const
{
    return metadata_;
}

void XdgUrlHandler::process()
void OcsUrlHandler::process()
{
    // xdgs scheme is a reserved name, so the process of xdgs
    // is the same process of the xdg scheme currently.
    // ocss scheme is a reserved name, so the process of ocss
    // is the same process of the ocs scheme currently.

    if (!isValid()) {
        QJsonObject result;
        result["status"] = QString("error_validation");
        result["message"] = QString("Invalid XDG-URL " + xdgUrl_);
        result["message"] = tr("Invalid OCS-URL");
        emit finishedWithError(result);
        return;
    }

    QString url = metadata_["url"].toString();
    qtlib::NetworkResource *resource = new qtlib::NetworkResource(url, QUrl(url), true, this);
    connect(resource, &qtlib::NetworkResource::downloadProgress, this, &XdgUrlHandler::downloadProgress);
    connect(resource, &qtlib::NetworkResource::finished, this, &XdgUrlHandler::networkResourceFinished);
    auto url = metadata_["url"].toString();
    auto *resource = new Qtil::NetworkResource(url, QUrl(url), true, this);
    connect(resource, &Qtil::NetworkResource::downloadProgress, this, &OcsUrlHandler::downloadProgress);
    connect(resource, &Qtil::NetworkResource::finished, this, &OcsUrlHandler::networkResourceFinished);
    resource->get();
    emit started();
}

bool XdgUrlHandler::isValid()
bool OcsUrlHandler::isValid() const
{
    QString scheme = metadata_["scheme"].toString();
    QString command = metadata_["command"].toString();
@@ -54,23 +55,23 @@ bool XdgUrlHandler::isValid()
    QString type = metadata_["type"].toString();
    QString filename = metadata_["filename"].toString();

    if ((scheme == "xdg" || scheme == "xdgs")
    if ((scheme == "ocs" || scheme == "ocss")
            && (command == "download" || command == "install")
            && QUrl(url).isValid()
            && destinations_.contains(type)
            && configHandler_->getAppConfigInstallTypes().contains(type)
            && !filename.isEmpty()) {
        return true;
    }
    return false;
}

void XdgUrlHandler::openDestination()
void OcsUrlHandler::openDestination() const
{
    QString type = metadata_["type"].toString();
    QDesktopServices::openUrl(QUrl("file://" + destinations_[type].toString()));
    auto type = metadata_["type"].toString();
    QDesktopServices::openUrl(QUrl("file://" + configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString()));
}

void XdgUrlHandler::networkResourceFinished(qtlib::NetworkResource *resource)
void OcsUrlHandler::networkResourceFinished(Qtil::NetworkResource *resource)
{
    if (!resource->isFinishedWithNoError()) {
        QJsonObject result;
@@ -89,12 +90,12 @@ void XdgUrlHandler::networkResourceFinished(qtlib::NetworkResource *resource)
    }
}

void XdgUrlHandler::parse()
void OcsUrlHandler::parse()
{
    QUrl url(xdgUrl_);
    QUrl url(ocsUrl_);
    QUrlQuery query(url);

    metadata_["scheme"] = QString("xdg");
    metadata_["scheme"] = QString("ocs");
    metadata_["command"] = QString("download");
    metadata_["url"] = QString("");
    metadata_["type"] = QString("downloads");
@@ -125,121 +126,87 @@ void XdgUrlHandler::parse()
    }
}

void XdgUrlHandler::loadDestinations()
{
    QJsonObject configDestinations = config_.get("destinations");
    QJsonObject configDestinationsAlias = config_.get("destinations_alias");

    foreach (const QString &key, configDestinations.keys()) {
        destinations_[key] = convertPathString(configDestinations[key].toString());
    }

    foreach (const QString &key, configDestinationsAlias.keys()) {
        QString value = configDestinationsAlias[key].toString();
        if (destinations_.contains(value)) {
            destinations_[key] = destinations_.value(value);
        }
    }
}

QString XdgUrlHandler::convertPathString(const QString &path)
{
    QString newPath = path;

    if (newPath.contains("$HOME")) {
        newPath.replace("$HOME", qtlib::Dir::homePath());
    }
    else if (newPath.contains("$XDG_DATA_HOME")) {
        newPath.replace("$XDG_DATA_HOME", qtlib::Dir::genericDataPath());
    }
    else if (newPath.contains("$KDEHOME")) {
        newPath.replace("$KDEHOME", qtlib::Dir::kdehomePath());
    }

    return newPath;
}

void XdgUrlHandler::saveDownloadedFile(qtlib::NetworkResource *resource)
void OcsUrlHandler::saveDownloadedFile(Qtil::NetworkResource *resource)
{
    QJsonObject result;

    QString type = metadata_["type"].toString();
    qtlib::Dir destDir(destinations_[type].toString());
    auto type = metadata_["type"].toString();
    Qtil::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
    destDir.make();
    qtlib::File destFile(destDir.path() + "/" + metadata_["filename"].toString());
    Qtil::File destFile(destDir.path() + "/" + metadata_["filename"].toString());

    if (!resource->saveData(destFile.path())) {
        result["status"] = QString("error_save");
        result["message"] = QString("Failed to save data as " + destFile.path());
        result["message"] = tr("Failed to save data");
        emit finishedWithError(result);
        resource->deleteLater();
        return;
    }

    result["status"] = QString("success_download");
    result["message"] = QString("The file has been stored into " + destDir.path());
    result["message"] = tr("The file has been downloaded");
    emit finishedWithSuccess(result);

    resource->deleteLater();
}

void XdgUrlHandler::installDownloadedFile(qtlib::NetworkResource *resource)
void OcsUrlHandler::installDownloadedFile(Qtil::NetworkResource *resource)
{
    QJsonObject result;

    qtlib::File tempFile(qtlib::Dir::tempPath() + "/" + metadata_["filename"].toString());
    Qtil::File tempFile(Qtil::Dir::tempPath() + "/" + metadata_["filename"].toString());

    if (!resource->saveData(tempFile.path())) {
        result["status"] = QString("error_save");
        result["message"] = QString("Failed to save data as " + tempFile.path());
        result["message"] = tr("Failed to save data");
        emit finishedWithError(result);
        resource->deleteLater();
        return;
    }

    qtlib::Package package(tempFile.path());
    QString type = metadata_["type"].toString();
    qtlib::Dir destDir(destinations_[type].toString());
    Qtil::Package package(tempFile.path());
    auto type = metadata_["type"].toString();
    Qtil::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
    destDir.make();
    qtlib::File destFile(destDir.path() + "/" + metadata_["filename"].toString());
    Qtil::File destFile(destDir.path() + "/" + metadata_["filename"].toString());

    if (type == "bin"
            && package.installAsProgram(destFile.path())) {
        result["message"] = QString("The file has been installed into " + destDir.path());
        result["message"] = tr("The file has been installed as program");
    }
    else if ((type == "plasma_plasmoids" || type == "plasma4_plasmoids" || type == "plasma5_plasmoids")
             && package.installAsPlasmapkg("plasmoid")) {
        result["message"] = QString("The plasmoid has been installed");
        result["message"] = tr("The plasmoid has been installed");
    }
    else if ((type == "plasma_look_and_feel" || type == "plasma5_look_and_feel")
             && package.installAsPlasmapkg("lookandfeel")) {
        result["message"] = QString("The plasma look and feel has been installed");
        result["message"] = tr("The plasma look and feel has been installed");
    }
    else if ((type == "plasma_desktopthemes" || type == "plasma5_desktopthemes")
             && package.installAsPlasmapkg("theme")) {
        result["message"] = QString("The plasma desktop theme has been installed");
        result["message"] = tr("The plasma desktop theme has been installed");
    }
    else if (type == "kwin_effects"
             && package.installAsPlasmapkg("kwineffect")) {
        result["message"] = QString("The KWin effect has been installed");
        result["message"] = tr("The KWin effect has been installed");
    }
    else if (type == "kwin_scripts"
             && package.installAsPlasmapkg("kwinscript")) {
        result["message"] = QString("The KWin script has been installed");
        result["message"] = tr("The KWin script has been installed");
    }
    else if (type == "kwin_tabbox"
             && package.installAsPlasmapkg("windowswitcher")) {
        result["message"] = QString("The KWin window switcher has been installed");
        result["message"] = tr("The KWin window switcher has been installed");
    }
    else if (package.installAsArchive(destDir.path())) {
        result["message"] = QString("The archive file has been extracted into " + destDir.path());
        result["message"] = tr("The archive file has been extracted");
    }
    else if (package.installAsFile(destFile.path())) {
        result["message"] = QString("The file has been installed into " + destDir.path());
        result["message"] = tr("The file has been installed");
    }
    else {
        result["status"] = QString("error_install");
        result["message"] = QString("Failed to installation");
        result["message"] = tr("Failed to installation");
        emit finishedWithError(result);
        tempFile.remove();
        return;
Original line number Diff line number Diff line
@@ -3,18 +3,18 @@
#include <QObject>
#include <QJsonObject>

#include "qtlib_config.h"

namespace qtlib {
namespace Qtil {
class NetworkResource;
}

class XdgUrlHandler : public QObject
class ConfigHandler;

class OcsUrlHandler : public QObject
{
    Q_OBJECT

public:
    explicit XdgUrlHandler(const QString &xdgUrl, const qtlib::Config &config, QObject *parent = 0);
    explicit OcsUrlHandler(const QString &ocsUrl, ConfigHandler *configHandler, QObject *parent = nullptr);

signals:
    void started();
@@ -23,25 +23,22 @@ signals:
    void downloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal);

public slots:
    QString xdgUrl() const;
    QString ocsUrl() const;
    QJsonObject metadata() const;

    void process();
    bool isValid();
    void openDestination();
    bool isValid() const;
    void openDestination() const;

private slots:
    void networkResourceFinished(qtlib::NetworkResource *resource);
    void networkResourceFinished(Qtil::NetworkResource *resource);

private:
    void parse();
    void loadDestinations();
    QString convertPathString(const QString &path);
    void saveDownloadedFile(qtlib::NetworkResource *resource);
    void installDownloadedFile(qtlib::NetworkResource *resource);
    void saveDownloadedFile(Qtil::NetworkResource *resource);
    void installDownloadedFile(Qtil::NetworkResource *resource);

    QString xdgUrl_;
    qtlib::Config config_;
    QString ocsUrl_;
    ConfigHandler *configHandler_;
    QJsonObject metadata_;
    QJsonObject destinations_;
};

app/src/main.cpp

0 → 100644
+61 −0
Original line number Diff line number Diff line
#include <QString>
#include <QStringList>
#include <QUrl>
#include <QJsonObject>
#include <QTranslator>
#include <QLocale>
#include <QCommandLineParser>
#include <QApplication>
#include <QIcon>
#include <QQmlApplicationEngine>
#include <QQmlContext>

#include "handlers/confighandler.h"
#include "handlers/ocsurlhandler.h"

int main(int argc, char *argv[])
{
    // Init
    QApplication app(argc, argv);

    auto *configHandler = new ConfigHandler();
    auto appConfigApplication = configHandler->getAppConfigApplication();

    app.setApplicationName(appConfigApplication["name"].toString());
    app.setApplicationVersion(appConfigApplication["version"].toString());
    app.setOrganizationName(appConfigApplication["organization"].toString());
    app.setOrganizationDomain(appConfigApplication["domain"].toString());
    app.setWindowIcon(QIcon::fromTheme(appConfigApplication["id"].toString(), QIcon(appConfigApplication["icon"].toString())));

    // Setup translator
    QTranslator translator;
    if (translator.load(QLocale(), "messages", ".", ":/i18n")) {
        app.installTranslator(&translator);
    }

    // Setup CLI
    QCommandLineParser clParser;
    clParser.setApplicationDescription(appConfigApplication["description"].toString());
    clParser.addHelpOption();
    clParser.addVersionOption();
    clParser.addPositionalArgument("OCS-URL", "OCS-URL that starts with ocs://");
    clParser.process(app);

    auto args = clParser.positionalArguments();

    if (args.size() != 1) {
        clParser.showHelp(1);
    }

    auto ocsUrl = QString(args.at(0));

    // Setup QML
    QQmlApplicationEngine qmlAppEngine;
    auto *qmlContext = qmlAppEngine.rootContext();
    configHandler->setParent(&qmlAppEngine);
    qmlContext->setContextProperty("configHandler", configHandler);
    qmlContext->setContextProperty("ocsUrlHandler", new OcsUrlHandler(ocsUrl, configHandler, &qmlAppEngine));
    qmlAppEngine.load(QUrl("qrc:/qml/main.qml"));

    return app.exec();
}
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ unix:!ios:!android {
        PREFIX = /usr/local
    }

    SRCDIR = $${PWD}/src
    SRCDIR = $${PWD}
    BINDIR = $${PREFIX}/bin
    DATADIR = $${PREFIX}/share

desktop/desktop.pri

0 → 100644
+3 −0
Original line number Diff line number Diff line
RESOURCES += $${PWD}/desktop.qrc

DISTFILES += $${PWD}/ocs-url.desktop
Original line number Diff line number Diff line
[Desktop Entry]
Name=xdgurl
Exec=xdgurl %u
Icon=xdgurl
Name=ocs-url
Exec=ocs-url %u
Icon=ocs-url
Type=Application
Terminal=false
NoDisplay=true
Categories=Network;Utility;
MimeType=x-scheme-handler/xdg;x-scheme-handler/xdgs;
MimeType=x-scheme-handler/ocs;x-scheme-handler/ocss;

desktop/ocs-url.svg

0 → 100644
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="1000" height="1000" viewBox="0, 0, 1000, 1000">
  <g id="icon">
    <g id="background">
      <path d="M975,500 C975,762.335 762.335,975 500,975 C237.665,975 25,762.335 25,500 C25,237.665 237.665,25 500,25 C762.335,25 975,237.665 975,500 z" fill="#19A2FF" id="background-2"/>
      <path d="M950,500 C950,748.528 748.528,950 500,950 C251.472,950 50,748.528 50,500 C50,251.472 251.472,50 500,50 C748.528,50 950,251.472 950,500 z" fill="#53B2FF" id="background-1"/>
    </g>
    <g id="ocs-url">
      <path d="M902.992,380.107 L924.992,380.107 L830.653,670.28 L808.653,670.28 z" fill="#FFFFFF" id="slash-2"/>
      <path d="M852.992,380.107 L874.992,380.107 L780.653,670.28 L758.653,670.28 z" fill="#FFFFFF" id="slash-1"/>
      <path d="M739.533,556.848 L775.533,556.848 L775.533,592.848 L739.533,592.848 z" fill="#FFFFFF" id="colon-2"/>
      <path d="M739.505,457.85 L775.505,457.85 L775.505,493.85 L739.505,493.85 z" fill="#FFFFFF" id="colon-1"/>
      <path d="M619.548,389.93 Q581.46,389.931 559.59,399.494 Q537.719,409.057 526.825,425.772 Q515.931,442.487 515.931,461.281 Q515.931,489.888 537.22,508.349 Q558.342,526.811 607.906,537.954 Q638.175,544.607 646.491,552.091 Q654.807,559.576 654.807,569.055 Q654.807,579.035 646.076,586.602 Q637.343,594.17 621.211,594.169 Q599.589,594.17 587.947,579.367 Q580.795,570.22 578.467,552.756 L506.784,557.247 Q509.943,594.17 533.893,618.12 Q557.843,642.07 620.047,642.069 Q655.472,642.07 678.757,631.84 Q702.041,621.612 715.014,601.82 Q727.987,582.029 727.987,558.577 Q727.987,538.619 718.258,522.486 Q708.528,506.354 687.156,495.459 Q665.784,484.566 616.388,473.921 Q596.429,469.764 591.108,464.94 Q585.618,460.283 585.619,454.462 Q585.618,446.479 592.272,440.907 Q598.924,435.336 612.063,435.335 Q628.03,435.336 637.094,442.819 Q646.158,450.304 648.986,466.77 L720.005,462.611 Q715.347,424.691 690.815,407.31 Q666.283,389.931 619.548,389.93 z" fill="#FFFFFF" id="s"/>
      <path d="M449.767,389.931 Q424.743,389.931 401.937,399.275 Q379.13,408.62 361.867,425.249 Q344.604,441.879 334.31,464.844 Q324.015,487.809 324.015,515.366 Q324.015,542.925 334.468,566.206 Q344.921,589.488 362.184,606.434 Q379.447,623.381 402.095,632.724 Q424.743,642.069 449.451,642.069 Q461.487,642.069 473.841,639.693 Q486.194,637.318 500.448,632.249 L506.784,630.032 L506.784,556.544 Q483.027,581.886 453.252,581.885 Q439.631,581.886 427.911,576.817 Q416.191,571.75 407.48,562.88 Q398.769,554.011 393.86,541.974 Q388.95,529.938 388.95,515.683 Q388.95,501.746 393.86,489.709 Q398.769,477.673 407.322,468.961 Q415.874,460.251 427.753,455.182 Q439.631,450.115 453.568,450.114 Q485.244,450.115 506.784,476.405 L506.784,402.284 Q491.579,395.95 477.8,392.94 Q464.021,389.931 449.767,389.931 z" fill="#FFFFFF" id="c"/>
      <path d="M223.997,389.93 Q252.822,389.932 277.212,399.591 Q301.602,409.254 319.183,426.357 Q336.762,443.463 346.582,466.427 Q356.401,489.393 356.402,515.999 Q356.401,542.608 346.582,565.572 Q336.762,588.538 319.183,605.641 Q301.602,622.748 277.212,632.407 Q252.822,642.07 223.997,642.068 Q194.855,642.07 170.624,632.407 Q146.392,622.748 128.97,605.641 Q111.548,588.538 101.729,565.572 Q91.91,542.608 91.91,515.999 Q91.91,489.393 101.729,466.427 Q111.548,443.463 128.97,426.357 Q146.392,409.254 170.624,399.591 Q194.855,389.932 223.997,389.93 z M223.997,450.114 Q210.377,450.115 198.182,455.024 Q185.986,459.935 176.801,468.803 Q167.614,477.673 162.23,489.709 Q156.845,501.747 156.845,515.999 Q156.845,530.255 162.23,542.29 Q167.614,554.328 176.801,563.196 Q185.986,572.067 198.182,576.975 Q210.377,581.886 223.997,581.885 Q237.618,581.886 249.813,576.975 Q262.008,572.067 271.352,563.196 Q280.697,554.328 286.082,542.29 Q291.466,530.255 291.466,515.999 Q291.466,501.747 286.082,489.709 Q280.697,477.673 271.352,468.803 Q262.008,459.935 249.813,455.024 Q237.618,450.115 223.997,450.114 z" fill="#FFFFFF" id="o"/>
    </g>
  </g>
</svg>

docs/How-to-install.md

0 → 100644
+57 −0
Original line number Diff line number Diff line
# How to install


## Install from package

Download Linux package from: https://www.opendesktop.org/p/1136805/

Then click the downloaded package and continue to installation with package manager.

Or install the downloaded package using terminal:

Ubuntu 14.04

    $ sudo apt install libqt5svg5 qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin qtdeclarative5-controls-plugin
    $ sudo dpkg -i /path/to/ocs-url*.deb

Ubuntu 16.04

    $ sudo apt install libqt5svg5 qml-module-qtquick-controls
    $ sudo dpkg -i /path/to/ocs-url*.deb

Fedora 20

    # yum insall qt5-qtbase qt5-qtbase-gui qt5-qtsvg qt5-qtdeclarative qt5-qtquickcontrols
    # rpm -i /path/to/ocs-url*.rpm

Fedora 22

    # dnf insall qt5-qtbase qt5-qtbase-gui qt5-qtsvg qt5-qtdeclarative qt5-qtquickcontrols
    # rpm -i /path/to/ocs-url*.rpm

openSUSE 42.1

    # zypper install libQt5Svg5 libqt5-qtquickcontrols
    # rpm -i /path/to/ocs-url*.rpm

Arch Linux

    # pacman -S qt5-base qt5-svg qt5-declarative qt5-quickcontrols
    # pacman -U /path/to/ocs-url*.pkg.tar.xz


## Install from source

Make git clone, or download the source archive and extract it.

Build and install

    $ cd /path/to/ocs-url
    $ ./scripts/prepare
    $ qmake PREFIX=/usr
    $ make
    $ sudo make install

Uninstall

    $ sudo make uninstall

docs/How-to-use.md

0 → 100644
+19 −0
Original line number Diff line number Diff line
# How to use


## Web browser

Just click a OCS-URL (ocs://) links, or type OCS-URL in browser's address bar.

If you use Firefox, a program selection window opens the first time you open OCS-URL,
and you can choose "ocs-url" as custom URL handler.

If you don't get the program selection window or you are using another browser,
please set the ocs-url program as custom URL handler for ocs:// scheme in the browser's settings.


## Command-line

Execute ocs-url program with argument OCS-URL.

    $ ocs-url "ocs://install?url=http%3A%2F%2Fexample.com%2Ficons.tar.gz&type=icons"
+28 −0
Original line number Diff line number Diff line
# Internationalization

ocs-url/i18n/ is sub project for program internationalization.


## Localization for program

Using two tools lupdate and lrelease to make translation.

Text is gathered from program source files and included in QM files for translation along with other resource files.

### Creating TS (Translation Source) files

To generate TS files, sets TS file name to definition TRANSLATIONS in i18n.pro and run lupdate with i18n.pro.

    $ cd /path/to/ocs-url/i18n/
    $ lupdate i18n.pro

Then adds translations to the generated TS files using Qt Linguist or text editor.

### Creating QM (Qt Message) files

To generate QM files, run lrelease with i18n.pro.

    $ cd /path/to/ocs-url/i18n/
    $ lrelease i18n.pro

Then adds the path of the generated QM files to i18n.qrc.
+113 −0
Original line number Diff line number Diff line
# OCS-URL specification

OCS-URL is a custom URL that represent the installation method of items served on OpenCollaborationServices (OCS).


## URL structure

    [scheme]://[command]?[query string]

For example:

    ocs://install?url=http%3A%2F%2Fexample.com%2Ficons.tar.gz&type=icons


## Scheme

Scheme | Description
-------|------------
ocs | ocs scheme
ocss | ocs scheme for secure protocol

"ocss" scheme is the same of the ocs scheme for now,
it's a reserved name for secure protocol in the future.


## Command

Command | Description
--------|------------
download | Download the file from specified URL to the installation destination of specified install-type.
install | Make file downloading and trigger installation process.


## Query string

OCS-URL's query string is an option of command.

*All query string values should be urlencoded.*

Parameter | Required | Default | Description
----------|----------|---------|------------
url | Yes | - | File URL
type | - | downloads | Install-type
filename | - | File name from URL | Alternative file name

"filename" option is useful if the file URL does not represent a file name.

### Install-type

Available install-type:

Install-type | Installation destination
-------------|------------------
bin | $HOME/.local/bin
downloads | $HOME/Downloads
documents | $HOME/Documents
pictures | $HOME/Pictures
music | $HOME/Music
videos | $HOME/Videos
wallpapers | $XDG_DATA_HOME/wallpapers
fonts | $HOME/.fonts
cursors | $HOME/.icons
icons | $XDG_DATA_HOME/icons
emoticons | $XDG_DATA_HOME/emoticons
themes | $HOME/.themes
emerald_themes | $HOME/.emerald/themes
enlightenment_themes | $HOME/.e/e/themes
enlightenment_backgrounds | $HOME/.e/e/backgrounds
fluxbox_styles | $HOME/.fluxbox/styles
pekwm_themes | $HOME/.pekwm/themes
icewm_themes | $HOME/.icewm/themes
plasma_plasmoids | $XDG_DATA_HOME/plasma/plasmoids
plasma_look_and_feel | $XDG_DATA_HOME/plasma/look-and-feel
plasma_desktopthemes | $XDG_DATA_HOME/plasma/desktoptheme
kwin_effects | $XDG_DATA_HOME/kwin/effects
kwin_scripts | $XDG_DATA_HOME/kwin/scripts
kwin_tabbox | $XDG_DATA_HOME/kwin/tabbox
aurorae_themes | $XDG_DATA_HOME/aurorae/themes
dekorator_themes | $XDG_DATA_HOME/deKorator/themes
qtcurve | $XDG_DATA_HOME/QtCurve
color_schemes | $XDG_DATA_HOME/color-schemes
gnome_shell_extensions | $XDG_DATA_HOME/gnome-shell/extensions
cinnamon_applets | $XDG_DATA_HOME/cinnamon/applets
cinnamon_desklets | $XDG_DATA_HOME/cinnamon/desklets
cinnamon_extensions | $XDG_DATA_HOME/cinnamon/extensions
nautilus_scripts | $XDG_DATA_HOME/nautilus/scripts
amarok_scripts | $KDEHOME/share/apps/amarok/scripts
yakuake_skins | $KDEHOME/share/apps/yakuake/skins
cairo_clock_themes | $HOME/.cairo-clock/themes
books | $APP_DATA/books
comics | $APP_DATA/comics

$APP_DATA is not environment variable, it's internal variable in the program and expressed to $XDG_DATA_HOME/{application ID or name}.

Available alias name of the install-type:

Alias | Install-type
------|-------------
gnome_shell_themes | themes
cinnamon_themes | themes
gtk2_themes | themes
gtk3_themes | themes
metacity_themes | themes
xfwm4_themes | themes
openbox_themes | themes
kvantum_themes | themes
compiz_themes | emerald_themes
beryl_themes | emerald_themes
plasma4_plasmoids | plasma_plasmoids
plasma5_plasmoids | plasma_plasmoids
plasma5_look_and_feel | plasma_look_and_feel
plasma5_desktopthemes | plasma_desktopthemes
plasma_color_schemes | color_schemes

i18n/i18n.pri

0 → 100644
+1 −0
Original line number Diff line number Diff line
RESOURCES += $${PWD}/i18n.qrc

i18n/i18n.pro

0 → 100644
+10 −0
Original line number Diff line number Diff line
SOURCES += $$system(find $${PWD}/../app -type f -name "*.cpp" -or -name "*.qml" -or -name "*.js")

TRANSLATIONS += \
    $${PWD}/messages.ts \
    $${PWD}/messages.en_US.ts \
    $${PWD}/messages.ja_JP.ts \
    $${PWD}/messages.tr_TR.ts \
    $${PWD}/messages.zh_TW.ts

include($${PWD}/i18n.pri)

i18n/i18n.qrc

0 → 100644
+9 −0
Original line number Diff line number Diff line
<RCC>
    <qresource prefix="/i18n">
        <file>messages.qm</file>
        <file>messages.en_US.qm</file>
        <file>messages.ja_JP.qm</file>
        <file>messages.tr_TR.qm</file>
        <file>messages.zh_TW.qm</file>
    </qresource>
</RCC>

i18n/messages.en_US.ts

0 → 100644
+170 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
    <name>OcsUrlHandler</name>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
        <source>Invalid OCS-URL</source>
        <translation>Invalid OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
        <source>Failed to save data</source>
        <translation>Failed to save data</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
        <source>The file has been downloaded</source>
        <translation>The file has been downloaded</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
        <source>The file has been installed as program</source>
        <translation>The file has been installed as program</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
        <source>The plasmoid has been installed</source>
        <translation>The plasmoid has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
        <source>The plasma look and feel has been installed</source>
        <translation>The plasma look and feel has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
        <source>The plasma desktop theme has been installed</source>
        <translation>The plasma desktop theme has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
        <source>The KWin effect has been installed</source>
        <translation>The KWin effect has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
        <source>The KWin script has been installed</source>
        <translation>The KWin script has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
        <source>The KWin window switcher has been installed</source>
        <translation>The KWin window switcher has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
        <source>The archive file has been extracted</source>
        <translation>The archive file has been extracted</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
        <source>The file has been installed</source>
        <translation>The file has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
        <source>Failed to installation</source>
        <translation>Failed to installation</translation>
    </message>
</context>
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation>Download successful</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation>Installation successful</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation>Validation error</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation>Network error</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation>Saving file failed</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation>Installation failed</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation>Downloading</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation>Do you want to download?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation>Do you want to install?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation>URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation>File</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation>Type</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation>Invalid OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation>Details</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation>OK</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation>Cancel</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation>Open</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation>Close</translation>
    </message>
</context>
</TS>

i18n/messages.ja_JP.ts

0 → 100644
+170 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ja_JP">
<context>
    <name>OcsUrlHandler</name>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
        <source>Invalid OCS-URL</source>
        <translation>無効なOCS-URL</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
        <source>Failed to save data</source>
        <translation>ファイルの保存に失敗</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
        <source>The file has been downloaded</source>
        <translation>ファイルがダウンロードされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
        <source>The file has been installed as program</source>
        <translation>ファイルがプログラムとしてインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
        <source>The plasmoid has been installed</source>
        <translation>plasmoidがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
        <source>The plasma look and feel has been installed</source>
        <translation>plasma look and feelがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
        <source>The plasma desktop theme has been installed</source>
        <translation>plasma desktop themeがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
        <source>The KWin effect has been installed</source>
        <translation>KWin effectがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
        <source>The KWin script has been installed</source>
        <translation>KWin scriptがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
        <source>The KWin window switcher has been installed</source>
        <translation>KWin window switcherがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
        <source>The archive file has been extracted</source>
        <translation>圧縮ファイルが展開されました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
        <source>The file has been installed</source>
        <translation>ファイルがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
        <source>Failed to installation</source>
        <translation>インストールに失敗</translation>
    </message>
</context>
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation>ダウンロード成功</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation>インストール成功</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation>検証エラー</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation>通信エラー</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation>ファイル保存失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation>インストール失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation>ダウンロード中</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation>ダウンロードしますか?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation>インストールしますか?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation>URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation>ファイル</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation>タイプ</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation>無効なOCS-URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation>詳細</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation>OK</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation>キャンセル</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation>開く</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation>閉じる</translation>
    </message>
</context>
</TS>

i18n/messages.qm

0 → 100644
+1 −0
Original line number Diff line number Diff line
<d!`
 No newline at end of file

i18n/messages.tr_TR.ts

0 → 100644
+170 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="tr_TR">
<context>
    <name>OcsUrlHandler</name>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
        <source>Invalid OCS-URL</source>
        <translation>Geçersiz OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
        <source>Failed to save data</source>
        <translation>Veri kaydedilemedi</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
        <source>The file has been downloaded</source>
        <translation>Dosya indirildi</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
        <source>The file has been installed as program</source>
        <translation>Dosya program olarak kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
        <source>The plasmoid has been installed</source>
        <translation>Plasmoid kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
        <source>The plasma look and feel has been installed</source>
        <translation>Plasma görünüş ve işleyişi kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
        <source>The plasma desktop theme has been installed</source>
        <translation>Plasma masaüstü teması kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
        <source>The KWin effect has been installed</source>
        <translation>KWin efekti kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
        <source>The KWin script has been installed</source>
        <translation>KWin betiği kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
        <source>The KWin window switcher has been installed</source>
        <translation>KWin pencere seçicisi kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
        <source>The archive file has been extracted</source>
        <translation>Arşiv açıldı</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
        <source>The file has been installed</source>
        <translation>Dosya kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
        <source>Failed to installation</source>
        <translation>Kurulum başarısız oldu</translation>
    </message>
</context>
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation>Başarıyla indirildi</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation>Başarıyla kuruldu</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation>Doğrulama hatası</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation> hatası</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation>Dosya kaydedilemedi</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation>Kurulum başarısız oldu</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation>İndiriliyor</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation>İndirmek istiyor musunuz?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation>Kurmak istiyor musunuz?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation>Bağlantı Adresi</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation>Dosya</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation>Tür</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation>Geçersiz OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation>Ayrıntılar</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation>Tamam</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation>İptal</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation>Kapat</translation>
    </message>
</context>
</TS>

i18n/messages.ts

0 → 100644
+170 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
    <name>OcsUrlHandler</name>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
        <source>Invalid OCS-URL</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
        <source>Failed to save data</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
        <source>The file has been downloaded</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
        <source>The file has been installed as program</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
        <source>The plasmoid has been installed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
        <source>The plasma look and feel has been installed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
        <source>The plasma desktop theme has been installed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
        <source>The KWin effect has been installed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
        <source>The KWin script has been installed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
        <source>The KWin window switcher has been installed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
        <source>The archive file has been extracted</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
        <source>The file has been installed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
        <source>Failed to installation</source>
        <translation type="unfinished"></translation>
    </message>
</context>
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation type="unfinished"></translation>
    </message>
</context>
</TS>

i18n/messages.zh_TW.ts

0 → 100644
+170 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_TW">
<context>
    <name>OcsUrlHandler</name>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
        <source>Invalid OCS-URL</source>
        <translation>無效的 OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
        <source>Failed to save data</source>
        <translation>儲存資料失敗</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
        <source>The file has been downloaded</source>
        <translation>檔案已被下載</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
        <source>The file has been installed as program</source>
        <translation>檔案已被安裝為程式</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
        <source>The plasmoid has been installed</source>
        <translation>Plasmoid 已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
        <source>The plasma look and feel has been installed</source>
        <translation>Plasma 外觀與感覺已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
        <source>The plasma desktop theme has been installed</source>
        <translation>Plasma 桌面主題已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
        <source>The KWin effect has been installed</source>
        <translation>KWin 特效已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
        <source>The KWin script has been installed</source>
        <translation>KWin 指令稿已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
        <source>The KWin window switcher has been installed</source>
        <translation>KWin 視窗切換器已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
        <source>The archive file has been extracted</source>
        <translation>封存檔已被解壓縮</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
        <source>The file has been installed</source>
        <translation>檔案已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
        <source>Failed to installation</source>
        <translation>安裝失敗</translation>
    </message>
</context>
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation>下載成功</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation>安裝成功</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation>驗證失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation>網路錯誤</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation>儲存檔案失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation>安裝失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation>正在下載</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation>您想要下載嗎</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation>您想要安裝嗎</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation>URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation>檔案</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation>類型</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation>無效的 OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation>詳細資訊</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation>確定</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation>取消</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation>開啟</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation>關閉</translation>
    </message>
</context>
</TS>

lib/lib.pri

0 → 100644
+1 −0
Original line number Diff line number Diff line
include($${PWD}/qtil/qtil.pri)

ocs-url.pro

0 → 100644
+15 −0
Original line number Diff line number Diff line
TARGET = ocs-url

TEMPLATE = app

DEFINES += QT_DEPRECATED_WARNINGS

DISTFILES += $${PWD}/README.md

include($${PWD}/lib/lib.pri)
include($${PWD}/app/app.pri)
include($${PWD}/desktop/desktop.pri)
include($${PWD}/i18n/i18n.pri)
include($${PWD}/pkg/pkg.pri)
include($${PWD}/scripts/scripts.pri)
include($${PWD}/deployment.pri)
Original line number Diff line number Diff line
# Maintainer: Akira Ohgaki <akiraohgaki@gmail.com>

pkgname='xdgurl'
pkgver='2.0.2'
pkgname='ocs-url'
pkgver='3.1.0'
pkgrel='1'
pkgdesc='An install helper program for desktop stuff.'
pkgdesc='An install helper program for items served via OpenCollaborationServices (ocs://).'
arch=('i686' 'x86_64')
url='https://github.com/xdgurl/xdgurl'
url='https://git.opendesktop.org/akiraohgaki/ocs-url'
license=('GPL3')
depends=('qt5-base>=5.3.0' 'qt5-svg>=5.3.0' 'qt5-declarative>=5.3.0' 'qt5-quickcontrols>=5.3.0')
#source=("https://github.com/xdgurl/xdgurl/archive/release-${pkgver}.tar.gz")
depends=('qt5-base>=5.2.0' 'qt5-svg>=5.2.0' 'qt5-declarative>=5.2.0' 'qt5-quickcontrols>=5.2.0')
makedepends=('git')
#source=("https://git.opendesktop.org/akiraohgaki/ocs-url/-/archive/release-${pkgver}/ocs-url-release-${pkgver}.tar.gz")
source=("${pkgname}.tar.gz")
md5sums=() #autofill using updpkgsums

prepare() {
    #cd "${pkgname}-release-${pkgver}"
    cd "${pkgname}"
    ./scripts/prepare
}

build() {
    #cd "${pkgname}-release-${pkgver}"
    cd "${pkgname}"
    qmake PREFIX='/usr'
    qmake PREFIX=/usr
    make
}

pkg/build.sh

deleted100644 → 0
+0 −121
Original line number Diff line number Diff line
#!/bin/bash

PKGNAME='xdgurl'

PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"

BUILDDIR="${PROJDIR}/pkg/build"

BUILDTYPE=''
if [ "${1}" ]; then
    BUILDTYPE="${1}"
fi

TREEISH='HEAD'
if [ "${2}" ]; then
    TREEISH="${2}"
fi

export_source() {
    destdir="${BUILDDIR}"
    if [ "${1}" ]; then
        destdir="${1}"
    fi
    $(cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${destdir}/${PKGNAME}.tar.gz" "${TREEISH}")
}

build_ubuntu() {
    #sudo apt install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev devscripts debhelper fakeroot

    cd "${PROJDIR}"

    mkdir -p "${BUILDDIR}"
    export_source "${BUILDDIR}"
    tar -xzvf "${BUILDDIR}/${PKGNAME}.tar.gz" -C "${BUILDDIR}"
    cp -r "${PROJDIR}/pkg/ubuntu/debian" "${BUILDDIR}/${PKGNAME}"

    cd "${BUILDDIR}/${PKGNAME}"
    debuild -uc -us -b
}

build_fedora() {
    #sudo dnf install make automake gcc gcc-c++ libtool qt5-qtbase-devel qt5-qtsvg-devel qt5-qtdeclarative-devel rpm-build

    cd "${PROJDIR}"

    mkdir -p "${BUILDDIR}"
    mkdir "${BUILDDIR}/SOURCES"
    mkdir "${BUILDDIR}/SPECS"
    export_source "${BUILDDIR}/SOURCES"
    cp "${PROJDIR}/pkg/fedora/xdgurl.spec" "${BUILDDIR}/SPECS"

    rpmbuild --define "_topdir ${BUILDDIR}" -bb "${BUILDDIR}/SPECS/xdgurl.spec"
}

build_arch() {
    #sudo pacman -S base-devel qt5-base qt5-svg qt5-declarative qt5-quickcontrols

    cd "${PROJDIR}"

    mkdir -p "${BUILDDIR}"
    export_source "${BUILDDIR}"
    cp "${PROJDIR}/pkg/arch/PKGBUILD" "${BUILDDIR}"

    cd "${BUILDDIR}"
    updpkgsums
    makepkg -s
}

build_appimage() {
    #sudo add-apt-repository ppa:beineri/opt-qt57-xenial
    #sudo apt update

    #sudo apt install build-essential fuse zsync desktop-file-utils
    #sudo apt install qt57base qt57svg qt57declarative qt57quickcontrols
    # Replace linuxdeployqt download URL to official download URL when the stable version released
    #curl -L -o linuxdeployqt https://dl.dropboxusercontent.com/u/150776/temp/linuxdeployqt-799f704-x86-64.appimage
    #sudo install -m 755 -p linuxdeployqt /usr/local/bin/linuxdeployqt

    #sudo modprobe fuse
    #source /opt/qt57/bin/qt57-env.sh

    cd "${PROJDIR}"

    export VERSION="$(git describe --always)"
    mkdir -p "${BUILDDIR}"
    export_source "${BUILDDIR}"
    tar -xzvf "${BUILDDIR}/${PKGNAME}.tar.gz" -C "${BUILDDIR}"

    cd "${BUILDDIR}/${PKGNAME}"
    #qmake
    /opt/qt57/bin/qmake
    make
    strip ./xdgurl

    cd "${BUILDDIR}"
    mkdir -p "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin"
    install -m 755 -p "${BUILDDIR}/${PKGNAME}/xdgurl" "${BUILDDIR}/${PKGNAME}.AppDir/xdgurl"
    install -m 644 -p "${BUILDDIR}/${PKGNAME}/src/desktop/xdgurl.desktop" "${BUILDDIR}/${PKGNAME}.AppDir/xdgurl.desktop"
    install -m 644 -p "${BUILDDIR}/${PKGNAME}/src/desktop/xdgurl.svg" "${BUILDDIR}/${PKGNAME}.AppDir/xdgurl.svg"
    install -m 755 -p /usr/bin/update-desktop-database "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin/update-desktop-database"
    install -m 755 -p /usr/bin/desktop-file-validate "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin/desktop-file-validate"
    install -m 755 -p /usr/bin/desktop-file-install "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin/desktop-file-install"
    linuxdeployqt "${BUILDDIR}/${PKGNAME}.AppDir/xdgurl" -qmldir="${BUILDDIR}/${PKGNAME}/src/app/qml" -verbose=2 -bundle-non-qt-libs # https://github.com/probonopd/linuxdeployqt/issues/25
    linuxdeployqt "${BUILDDIR}/${PKGNAME}.AppDir/xdgurl" -qmldir="${BUILDDIR}/${PKGNAME}/src/app/qml" -verbose=2 -bundle-non-qt-libs # twice because of #25
    rm "${BUILDDIR}/${PKGNAME}.AppDir/AppRun"
    install -m 755 -p "${BUILDDIR}/${PKGNAME}/src/desktop/appimage-desktopintegration" "${BUILDDIR}/${PKGNAME}.AppDir/AppRun"
    linuxdeployqt --appimage-extract
    ./squashfs-root/usr/bin/appimagetool "${BUILDDIR}/${PKGNAME}.AppDir"
}

if [ "${BUILDTYPE}" = 'ubuntu' ]; then
    build_ubuntu
elif [ "${BUILDTYPE}" = 'fedora' ]; then
    build_fedora
elif [ "${BUILDTYPE}" = 'arch' ]; then
    build_arch
elif [ "${BUILDTYPE}" = 'appimage' ]; then
    build_appimage
else
    echo "sh $(basename "${0}") [ubuntu|fedora|arch|appimage] [tree_ish]"
fi
+94 −0
Original line number Diff line number Diff line
Summary: OCS-URL
Name: ocs-url
Version: 3.1.0
Release: 1%{?dist}
License: GPLv3+
Group: Applications/Internet
URL: https://git.opendesktop.org/akiraohgaki/ocs-url

#Source0: https://git.opendesktop.org/akiraohgaki/ocs-url/-/archive/release-%{version}/ocs-url-release-%{version}.tar.gz
Source0: %{name}.tar.gz

Requires: qt5-qtbase >= 5.2.0, qt5-qtbase-gui >= 5.2.0, qt5-qtsvg >= 5.2.0, qt5-qtdeclarative >= 5.2.0, qt5-qtquickcontrols >= 5.2.0
BuildRequires: git, make, automake, gcc, gcc-c++, libtool, qt5-qtbase-devel >= 5.2.0, qt5-qtsvg-devel >= 5.2.0, qt5-qtdeclarative-devel >= 5.2.0, rpm-build

%description
An install helper program for items served via OpenCollaborationServices (ocs://).

%prep
#%%autosetup -n %{name}-release-%{version}
%autosetup -n %{name}
./scripts/prepare

%build
%define debug_package %{nil}
qmake-qt5 PREFIX=/usr
make

%install
make INSTALL_ROOT="%{buildroot}" install

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg

%clean
rm -rf %{buildroot}

%changelog
* Thu Jul 05 2018 Akira Ohgaki <akiraohgaki@gmail.com> - 3.1.0-1
- Drop old xdg:// and xdgs:// schemes
- Update library

* Tue Feb 06 2018 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.3-1
- Update library
- Fix spelling

* Fri Jun 23 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.2-1
- Add zh_TW translations (by s8321414)

* Mon Jun 05 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.1-1
- Update qtlib
- Fix for C++11
- Fix installation/download destination
- Fix translation messages (by otsoga)

* Sun Mar 05 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.0-1
- Rename xdgurl to ocs-url
- Add ocs:// and ocss:// schemes
- xdg:// and xdgs:// schemes still available for backward compatibile
- New app icon
- New dialog window
- Labels and messages are translatable
- Qt 5.2 support
- Use the same configs of install-types with ocsstore
- Add en_US translation
- Add ja_JP translation
- Add tr_TR translation (by tarakbumba)

* Wed Jan 25 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.3-1
- Change installation destination of type bin
- Update qtlib
- Fix for dialog

* Thu Nov 17 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.2-1
- Update qtlibs
- Small fix

* Mon Nov 14 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.1-1
- Update library
- Fix download/installation process

* Fri Oct 28 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.0-1
- Re-implemented xdgurl as Qt program
- Download progress bar
- Add install-type "bin"

* Fri Jul 15 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 1.0.1-1
- Clean successful message
- Return exit code

* Wed Jul 06 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 1.0.0-1
- Initial release
Original line number Diff line number Diff line
Summary: An install helper program for desktop stuff
Name: xdgurl
Version: 2.0.2
Summary: OCS-URL
Name: ocs-url
Version: 3.1.0
Release: 1%{?dist}
License: GPLv3+
Group: Applications/Internet
URL: https://github.com/xdgurl/xdgurl
URL: https://git.opendesktop.org/akiraohgaki/ocs-url

#Source0: https://github.com/xdgurl/xdgurl/archive/release-%{version}.tar.gz
#Source0: https://git.opendesktop.org/akiraohgaki/ocs-url/-/archive/release-%{version}/ocs-url-release-%{version}.tar.gz
Source0: %{name}.tar.gz

Requires: qt5-qtbase >= 5.3.0, qt5-qtbase-gui >= 5.3.0, qt5-qtsvg >= 5.3.0, qt5-qtdeclarative >= 5.3.0, qt5-qtquickcontrols >= 5.3.0
BuildRequires: make, automake, gcc, gcc-c++, libtool, qt5-qtbase-devel, qt5-qtsvg-devel, qt5-qtdeclarative-devel, rpm-build
Requires: libQt5Svg5 >= 5.2.0, libqt5-qtquickcontrols >= 5.2.0
BuildRequires: git, make, automake, gcc, gcc-c++, libtool, libqt5-qtbase-devel >= 5.2.0, libqt5-qtsvg-devel >= 5.2.0, libqt5-qtdeclarative-devel >= 5.2.0, rpm-build

%description
An install helper program for desktop stuff.
An install helper program for items served via OpenCollaborationServices (ocs://).

%prep
#%%autosetup -n %{name}-release-%{version}
%autosetup -n %{name}
./scripts/prepare

%build
%define debug_package %{nil}
qmake-qt5 PREFIX='/usr'
qmake-qt5 PREFIX=/usr
make

%install
@@ -37,6 +38,41 @@ make INSTALL_ROOT="%{buildroot}" install
rm -rf %{buildroot}

%changelog
* Thu Jul 05 2018 Akira Ohgaki <akiraohgaki@gmail.com> - 3.1.0-1
- Drop old xdg:// and xdgs:// schemes
- Update library

* Tue Feb 06 2018 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.3-1
- Update library
- Fix spelling

* Fri Jun 23 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.2-1
- Add zh_TW translations (by s8321414)

* Mon Jun 05 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.1-1
- Update qtlib
- Fix for C++11
- Fix installation/download destination
- Fix translation messages (by otsoga)

* Sun Mar 05 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.0-1
- Rename xdgurl to ocs-url
- Add ocs:// and ocss:// schemes
- xdg:// and xdgs:// schemes still available for backward compatibile
- New app icon
- New dialog window
- Labels and messages are translatable