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

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
  • kimblejeremy/ocs-url
  • yuvrajsm/ocs-url
  • wawmart/ocs-url
  • jhefry/ocs-url
  • robcdntruckin/ocs-url
  • bigmake2266/ocs-url
  • kamil-chbeir/ocs-url
  • jocker73/ocs-url
  • laboties/ocs-url
  • smekke61279-522014/ocs-url
  • coolduck/ocs-url
  • zulfikar-lahiya/ocs-url
  • faz-83/ocs-url
  • dado105/ocs-url
34 results
Show changes
Commits on Source (150)
Showing
with 405 additions and 180 deletions
*.pro.user
build_*/
lib/qtlib/
lib/qtil/
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
# ocs-url
An install helper program for items served on OpenCollaborationServices (OCS).
[![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 ocs-url wiki for more information.
https://www.opendesktop.org/p/1136805/
https://github.com/ocs-url/ocs-url/wiki
And please see docs/* for more information.
CONFIG += c++11
QT += \
core \
gui \
widgets \
qml \
quick \
svg
......
{
"id": "ocs-url",
"name": "ocs-url",
"version": "3.0.0",
"organization": "ocs-url",
"domain": "com.ocs-url.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 on OpenCollaborationServices (OCS).",
"description": "An install helper program for items served via OpenCollaborationServices (ocs://).",
"license": "GPL-3+",
"author": "Akira Ohgaki",
"contact": "akiraohgaki@gmail.com",
"homepage": "https://github.com/ocs-url/ocs-url"
"author": "Opendesktop.org",
"contact": "contact@opendesktop.org",
"homepage": "https://git.opendesktop.org/akiraohgaki/ocs-url"
}
{
"bin": {
"name": "Softwares",
"name": "Software",
"destination": "$HOME/.local/bin",
"generic_destination": "$APP_DATA/bin"
},
"downloads": {
"name": "Downloads",
"destination": "$HOME/Downloads",
"destination": "$XDG_DOWNLOAD_DIR",
"generic_destination": "$APP_DATA/downloads"
},
"documents": {
"name": "Documents",
"destination": "$HOME/Documents",
"destination": "$XDG_DOCUMENTS_DIR",
"generic_destination": "$APP_DATA/documents"
},
"pictures": {
"name": "Pictures",
"destination": "$HOME/Pictures",
"destination": "$XDG_PICTURES_DIR",
"generic_destination": "$APP_DATA/pictures"
},
"music": {
"name": "Music",
"destination": "$HOME/Music",
"destination": "$XDG_MUSIC_DIR",
"generic_destination": "$APP_DATA/music"
},
"videos": {
"name": "Videos",
"destination": "$HOME/Videos",
"destination": "$XDG_VIDEOS_DIR",
"generic_destination": "$APP_DATA/videos"
},
"wallpapers": {
......
......@@ -23,8 +23,8 @@ ApplicationWindow {
var metadata = ocsUrlHandler.metadata();
var primaryMessages = {
"success_download": qsTr("Download successfull"),
"success_install": qsTr("Installation successfull"),
"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"),
......
#include "confighandler.h"
#include <QStringList>
#include <QStandardPaths>
#include "qtlib_dir.h"
#include "qtil_dir.h"
ConfigHandler::ConfigHandler(QObject *parent)
: QObject(parent)
{
appConfig_ = qtlib::Config(":/configs");
appConfig_ = Qtil::Config(":/configs");
importAppConfigApplication();
importAppConfigInstallTypes();
}
QJsonObject ConfigHandler::getAppConfigApplication()
QJsonObject ConfigHandler::getAppConfigApplication() const
{
if (appConfigApplication_.isEmpty()) {
appConfigApplication_ = appConfig_.get("application");
}
return appConfigApplication_;
}
QJsonObject ConfigHandler::getAppConfigInstallTypes()
QJsonObject ConfigHandler::getAppConfigInstallTypes() const
{
if (appConfigInstallTypes_.isEmpty()) {
QJsonObject installTypes = appConfig_.get("install_types");
foreach (const QString &key, installTypes.keys()) {
QJsonObject installtype = installTypes[key].toObject();
installtype["destination"] = convertPathString(installtype["destination"].toString());
installtype["generic_destination"] = convertPathString(installtype["generic_destination"].toString());
installTypes[key] = installtype;
}
QJsonObject installTypesAlias = appConfig_.get("install_types_alias");
foreach (const QString &key, installTypesAlias.keys()) {
QJsonObject installTypeAlias = installTypesAlias[key].toObject();
QString baseKey = installTypeAlias["base"].toString();
if (installTypes.contains(baseKey)) {
QJsonObject installType = installTypes[baseKey].toObject();
installType["base"] = baseKey;
installType["name"] = installTypeAlias["name"].toString();
installTypes[key] = installType;
}
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;
}
return appConfigInstallTypes_;
appConfigInstallTypes_ = installTypes;
}
QString ConfigHandler::convertPathString(const QString &path)
QString ConfigHandler::convertPathString(const QString &path) const
{
QString newPath = path;
auto newPath = path;
if (newPath.contains("$HOME")) {
newPath.replace("$HOME", qtlib::Dir::homePath());
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", qtlib::Dir::genericDataPath());
newPath.replace("$XDG_DATA_HOME", Qtil::Dir::genericDataPath());
}
else if (newPath.contains("$KDEHOME")) {
newPath.replace("$KDEHOME", qtlib::Dir::kdehomePath());
newPath.replace("$KDEHOME", Qtil::Dir::kdehomePath());
}
else if (newPath.contains("$APP_DATA")) {
newPath.replace("$APP_DATA", qtlib::Dir::genericDataPath() + "/" + getAppConfigApplication()["id"].toString());
newPath.replace("$APP_DATA", Qtil::Dir::genericDataPath() + "/" + getAppConfigApplication()["id"].toString());
}
return newPath;
}
......@@ -3,23 +3,25 @@
#include <QObject>
#include <QJsonObject>
#include "qtlib_config.h"
#include "qtil_config.h"
class ConfigHandler : public QObject
{
Q_OBJECT
public:
explicit ConfigHandler(QObject *parent = 0);
explicit ConfigHandler(QObject *parent = nullptr);
public slots:
QJsonObject getAppConfigApplication();
QJsonObject getAppConfigInstallTypes();
QJsonObject getAppConfigApplication() const;
QJsonObject getAppConfigInstallTypes() const;
private:
QString convertPathString(const QString &path);
void importAppConfigApplication();
void importAppConfigInstallTypes();
QString convertPathString(const QString &path) const;
qtlib::Config appConfig_;
Qtil::Config appConfig_;
QJsonObject appConfigApplication_;
QJsonObject appConfigInstallTypes_;
};
......@@ -3,10 +3,10 @@
#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"
#include "handlers/confighandler.h"
......@@ -39,15 +39,15 @@ void OcsUrlHandler::process()
return;
}
QString url = metadata_["url"].toString();
qtlib::NetworkResource *resource = new qtlib::NetworkResource(url, QUrl(url), true, this);
connect(resource, &qtlib::NetworkResource::downloadProgress, this, &OcsUrlHandler::downloadProgress);
connect(resource, &qtlib::NetworkResource::finished, this, &OcsUrlHandler::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 OcsUrlHandler::isValid()
bool OcsUrlHandler::isValid() const
{
QString scheme = metadata_["scheme"].toString();
QString command = metadata_["command"].toString();
......@@ -55,8 +55,7 @@ bool OcsUrlHandler::isValid()
QString type = metadata_["type"].toString();
QString filename = metadata_["filename"].toString();
// Still support xdg and xdgs schemes for backward compatibility
if ((scheme == "ocs" || scheme == "ocss" || scheme == "xdg" || scheme == "xdgs")
if ((scheme == "ocs" || scheme == "ocss")
&& (command == "download" || command == "install")
&& QUrl(url).isValid()
&& configHandler_->getAppConfigInstallTypes().contains(type)
......@@ -66,13 +65,13 @@ bool OcsUrlHandler::isValid()
return false;
}
void OcsUrlHandler::openDestination()
void OcsUrlHandler::openDestination() const
{
QString type = metadata_["type"].toString();
auto type = metadata_["type"].toString();
QDesktopServices::openUrl(QUrl("file://" + configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString()));
}
void OcsUrlHandler::networkResourceFinished(qtlib::NetworkResource *resource)
void OcsUrlHandler::networkResourceFinished(Qtil::NetworkResource *resource)
{
if (!resource->isFinishedWithNoError()) {
QJsonObject result;
......@@ -127,14 +126,14 @@ void OcsUrlHandler::parse()
}
}
void OcsUrlHandler::saveDownloadedFile(qtlib::NetworkResource *resource)
void OcsUrlHandler::saveDownloadedFile(Qtil::NetworkResource *resource)
{
QJsonObject result;
QString type = metadata_["type"].toString();
qtlib::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].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");
......@@ -151,11 +150,11 @@ void OcsUrlHandler::saveDownloadedFile(qtlib::NetworkResource *resource)
resource->deleteLater();
}
void OcsUrlHandler::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");
......@@ -165,11 +164,11 @@ void OcsUrlHandler::installDownloadedFile(qtlib::NetworkResource *resource)
return;
}
qtlib::Package package(tempFile.path());
QString type = metadata_["type"].toString();
qtlib::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].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())) {
......
......@@ -3,7 +3,7 @@
#include <QObject>
#include <QJsonObject>
namespace qtlib {
namespace Qtil {
class NetworkResource;
}
......@@ -14,7 +14,7 @@ class OcsUrlHandler : public QObject
Q_OBJECT
public:
explicit OcsUrlHandler(const QString &ocsUrl, ConfigHandler *configHandler, QObject *parent = 0);
explicit OcsUrlHandler(const QString &ocsUrl, ConfigHandler *configHandler, QObject *parent = nullptr);
signals:
void started();
......@@ -27,16 +27,16 @@ public slots:
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 saveDownloadedFile(qtlib::NetworkResource *resource);
void installDownloadedFile(qtlib::NetworkResource *resource);
void saveDownloadedFile(Qtil::NetworkResource *resource);
void installDownloadedFile(Qtil::NetworkResource *resource);
QString ocsUrl_;
ConfigHandler *configHandler_;
......
......@@ -18,8 +18,8 @@ int main(int argc, char *argv[])
// Init
QApplication app(argc, argv);
ConfigHandler *configHandler = new ConfigHandler();
QJsonObject appConfigApplication = configHandler->getAppConfigApplication();
auto *configHandler = new ConfigHandler();
auto appConfigApplication = configHandler->getAppConfigApplication();
app.setApplicationName(appConfigApplication["name"].toString());
app.setApplicationVersion(appConfigApplication["version"].toString());
......@@ -41,17 +41,17 @@ int main(int argc, char *argv[])
clParser.addPositionalArgument("OCS-URL", "OCS-URL that starts with ocs://");
clParser.process(app);
QStringList args = clParser.positionalArguments();
auto args = clParser.positionalArguments();
if (args.size() != 1) {
clParser.showHelp(1);
}
QString ocsUrl = args.at(0);
auto ocsUrl = QString(args.at(0));
// Setup QML
QQmlApplicationEngine qmlAppEngine;
QQmlContext *qmlContext = qmlAppEngine.rootContext();
auto *qmlContext = qmlAppEngine.rootContext();
configHandler->setParent(&qmlAppEngine);
qmlContext->setContextProperty("configHandler", configHandler);
qmlContext->setContextProperty("ocsUrlHandler", new OcsUrlHandler(ocsUrl, configHandler, &qmlAppEngine));
......
pipelines:
branches:
master:
- step:
image: ubuntu:14.04
script:
- apt update -qq
- apt -y install sudo git curl
- apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
- apt -y install devscripts debhelper fakeroot
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh ubuntu
custom:
build-ubuntu:
- step:
image: ubuntu:14.04
script:
- apt update -qq
- apt -y install sudo git curl
- apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
- apt -y install devscripts debhelper fakeroot
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh ubuntu
build-fedora:
- step:
image: fedora:20
script:
# dnf >= fedora:22
- yum -y install sudo git curl
- yum -y install make automake gcc gcc-c++ libtool qt5-qtbase-devel qt5-qtsvg-devel qt5-qtdeclarative-devel
- yum -y install rpm-build
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh fedora
build-archlinux:
- step:
image: finalduty/archlinux:latest
script:
- pacman -Syu --noconfirm
- pacman -S --noconfirm sudo git curl
- pacman -S --noconfirm base-devel qt5-base qt5-svg qt5-declarative qt5-quickcontrols
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh archlinux
build-snap:
- step:
image: ubuntu:16.04
script:
- apt update -qq
- apt -y install sudo git curl
- apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
- apt -y install snapcraft
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh snap
build-appimage:
- step:
image: ubuntu:14.04
script:
# Require docker run with --cap-add SYS_ADMIN --device /dev/fuse
- echo 'appimage build is disabled currently'
- exit 1
- apt update -qq
- apt -y install sudo git curl
- apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
- apt -y install fuse zsync desktop-file-utils
#- modprobe fuse
- useradd -m pkgbuilder
- export HOME=/home/pkgbuilder
- chown -R pkgbuilder:pkgbuilder $(pwd)
- sudo -u pkgbuilder sh scripts/build.sh appimage
......@@ -6,4 +6,4 @@ Type=Application
Terminal=false
NoDisplay=true
Categories=Network;Utility;
MimeType=x-scheme-handler/ocs;x-scheme-handler/ocss;x-scheme-handler/xdg;x-scheme-handler/xdgs;
MimeType=x-scheme-handler/ocs;x-scheme-handler/ocss;
# 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
# 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"
# 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.
# 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
SOURCES += $$system(find ../app -type f -name "*.cpp" -or -name "*.qml" -or -name "*.js")
SOURCES += $$system(find $${PWD}/../app -type f -name "*.cpp" -or -name "*.qml" -or -name "*.js")
TRANSLATIONS += \
messages.ts \
messages.en_US.ts
$${PWD}/messages.ts \
$${PWD}/messages.en_US.ts \
$${PWD}/messages.ja_JP.ts \
$${PWD}/messages.tr_TR.ts \
$${PWD}/messages.zh_TW.ts
include(i18n.pri)
include($${PWD}/i18n.pri)
......@@ -2,5 +2,8 @@
<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>