Skip to content

Commit

Permalink
Revert "Revert using submodules"
Browse files Browse the repository at this point in the history
This reverts commit cf4af7c.
  • Loading branch information
Shatur committed May 10, 2022
1 parent cf4af7c commit 98d630c
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 52 deletions.
1 change: 1 addition & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/third-party/*
60 changes: 60 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Main
on:
push:
branches-ignore:
- 'releases/**'
paths-ignore:
- '**.md'
- '.github/workflows/release.yml'
- '.gitignore'
- 'crowdin.yml'
- 'data/translations/**'
pull_request:
paths-ignore:
- '**.md'
- '.github/workflows/release.yml'
- '.gitignore'
- 'crowdin.yml'
- 'data/translations/**'
jobs:
format:
name: Format
runs-on: ubuntu-20.04
steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Check formatting
uses: DoozyX/[email protected]
with:
clangFormatVersion: 12

build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Clone repo
uses: actions/checkout@v2
with:
submodules: recursive

- name: Install apt packages
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install extra-cmake-modules libqt5x11extras5-dev qttools5-dev libkf5notifications-dev libkf5iconthemes-dev ninja-build
# See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4766#note_1091927
- name: Downgrade CMake
if: runner.os == 'Windows'
uses: lukka/[email protected]

- name: Build without Plasma feature
run: |
cmake -B build -G Ninja -D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror"
cmake --build build --parallel 2
- name: Build with Plasma feature
run: |
cmake -B build -G Ninja -D WITH_PLASMA=ON -D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror"
cmake --build build --parallel 2
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release
on:
release:
types: [created]
jobs:
pack:
name: Pack source tarball
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2
with:
submodules: recursive

- name: Create source tarball
run: |
SOURCE_NAME=$(awk -F/ '{print $NF}' <<<"${{ github.repository }}")-$(awk -F/ '{print $NF}' <<<"${{ github.ref }}")
git ls-files --recurse-submodules | \
tar --exclude-vcs --transform "s|^|$SOURCE_NAME/|S" -ca -T - -f ../$SOURCE_NAME-source.tar.gz
- name: Upload source tarball
uses: AButler/[email protected]
with:
files: '../*.tar.gz'
repo-token: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "data/icons/third-party/circle-flags"]
path = data/icons/third-party/circle-flags
url = https://github.com/HatScripts/circle-flags.git
[submodule "data/icons/third-party/masalla-icon-theme"]
path = data/icons/third-party/masalla-icon-theme
url = https://github.com/masalla-art/masalla-icon-theme
[submodule "src/third-party/singleapplication"]
path = src/third-party/singleapplication
url = https://github.com/itay-grudev/SingleApplication
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.7.0)

project(optimus-manager-qt
VERSION 1.6.5
VERSION 1.6.6
LANGUAGES CXX
DESCRIPTION "An interface for Optimus Manager that allows to switch GPUs on Optimus laptops."
)
Expand Down Expand Up @@ -29,10 +29,12 @@ if(WITH_PLASMA)
find_package(KF5 COMPONENTS Notifications IconThemes REQUIRED)
endif()

include(ExternalLibraries)
include(ECMInstallIcons)
include(GNUInstallDirs)

set(QAPPLICATION_CLASS QApplication)
add_subdirectory(src/third-party/singleapplication)

qt5_add_translation(QM_FILES
data/translations/${PROJECT_NAME}_de_DE.ts
data/translations/${PROJECT_NAME}_es_ES.ts
Expand All @@ -49,13 +51,11 @@ qt5_add_translation(QM_FILES
)

configure_file(src/cmake.h.in cmake.h)
configure_file(data/icons/flags.qrc ${CircleFlags_SOURCE_DIR}/flags/flags.qrc COPYONLY)
configure_file(data/icons/masalla.qrc ${Masalla_SOURCE_DIR}/masalla/masalla.qrc COPYONLY)

add_executable(${PROJECT_NAME}
${CircleFlags_SOURCE_DIR}/flags/flags.qrc
${Masalla_SOURCE_DIR}/masalla/masalla.qrc
${QM_FILES}
data/icons/flags.qrc
data/icons/masalla.qrc
src/appsettings.cpp
src/daemonclient.cpp
src/main.cpp
Expand Down
21 changes: 0 additions & 21 deletions cmake/ExternalLibraries.cmake

This file was deleted.

26 changes: 13 additions & 13 deletions data/icons/flags.qrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<RCC>
<qresource prefix="/icons/flags">
<file>br.svg</file>
<file>cn.svg</file>
<file>de.svg</file>
<file>es.svg</file>
<file>fi.svg</file>
<file>hu.svg</file>
<file>jp.svg</file>
<file>nl.svg</file>
<file>ro.svg</file>
<file>ru.svg</file>
<file>tr.svg</file>
<file>ua.svg</file>
<file>us.svg</file>
<file alias="br.svg">third-party/circle-flags/flags/br.svg</file>
<file alias="cn.svg">third-party/circle-flags/flags/cn.svg</file>
<file alias="de.svg">third-party/circle-flags/flags/de.svg</file>
<file alias="es.svg">third-party/circle-flags/flags/es.svg</file>
<file alias="fi.svg">third-party/circle-flags/flags/fi.svg</file>
<file alias="hu.svg">third-party/circle-flags/flags/hu.svg</file>
<file alias="jp.svg">third-party/circle-flags/flags/jp.svg</file>
<file alias="nl.svg">third-party/circle-flags/flags/nl.svg</file>
<file alias="ro.svg">third-party/circle-flags/flags/ro.svg</file>
<file alias="ru.svg">third-party/circle-flags/flags/ru.svg</file>
<file alias="tr.svg">third-party/circle-flags/flags/tr.svg</file>
<file alias="ua.svg">third-party/circle-flags/flags/ua.svg</file>
<file alias="us.svg">third-party/circle-flags/flags/us.svg</file>
</qresource>
</RCC>
22 changes: 11 additions & 11 deletions data/icons/masalla.qrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<RCC>
<qresource prefix="/icons/hicolor">
<file alias="16x16/apps/preferences-system-power-management.svg">apps/16x16/preferences-system-power-management.svg</file>
<file alias="16x16/apps/qt.svg">apps/16x16/qt.svg</file>
<file alias="16x16/apps/utilities-terminal.svg">apps/16x16/utilities-terminal.svg</file>
<file alias="16x16/places/folder.svg">places/16x16/folder.svg</file>
<file alias="48x48/apps/amd.svg">apps/48x48/amd.svg</file>
<file alias="48x48/apps/intel.svg">apps/48x48/intel.svg</file>
<file alias="48x48/apps/nvidia.svg">apps/48x48/nvidia.svg</file>
<file alias="48x48/apps/preferences-system-power-management.svg">apps/48x48/preferences-system-power-management.svg</file>
<file alias="48x48/apps/preferences-system.svg">apps/48x48/preferences-system.svg</file>
<file alias="48x48/mimetypes/text-x-generic.svg">mimetypes/48x48/text-x-generic.svg</file>
<file alias="48x48/status/dialog-information.png">status/48x48/dialog-information.png</file>
<file alias="16x16/apps/preferences-system-power-management.svg">third-party/masalla-icon-theme/masalla/apps/16x16/preferences-system-power-management.svg</file>
<file alias="16x16/apps/qt.svg">third-party/masalla-icon-theme/masalla/apps/16x16/qt.svg</file>
<file alias="16x16/apps/utilities-terminal.svg">third-party/masalla-icon-theme/masalla/apps/16x16/utilities-terminal.svg</file>
<file alias="16x16/places/folder.svg">third-party/masalla-icon-theme/masalla/places/16x16/folder.svg</file>
<file alias="48x48/apps/amd.svg">third-party/masalla-icon-theme/masalla/apps/48x48/amd.svg</file>
<file alias="48x48/apps/intel.svg">third-party/masalla-icon-theme/masalla/apps/48x48/intel.svg</file>
<file alias="48x48/apps/nvidia.svg">third-party/masalla-icon-theme/masalla/apps/48x48/nvidia.svg</file>
<file alias="48x48/apps/preferences-system-power-management.svg">third-party/masalla-icon-theme/masalla/apps/48x48/preferences-system-power-management.svg</file>
<file alias="48x48/apps/preferences-system.svg">third-party/masalla-icon-theme/masalla/apps/48x48/preferences-system.svg</file>
<file alias="48x48/mimetypes/text-x-generic.svg">third-party/masalla-icon-theme/masalla/mimetypes/48x48/text-x-generic.svg</file>
<file alias="48x48/status/dialog-information.png">third-party/masalla-icon-theme/masalla/status/48x48/dialog-information.png</file>
</qresource>
</RCC>
1 change: 1 addition & 0 deletions data/icons/third-party/circle-flags
Submodule circle-flags added at 2225d1
1 change: 1 addition & 0 deletions data/icons/third-party/masalla-icon-theme
Submodule masalla-icon-theme added at d3d3e9
2 changes: 1 addition & 1 deletion src/optimusmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ OptimusSettings::Mode OptimusManager::detectGpu()
if (jsonError.error != QJsonParseError::NoError)
qFatal("Unable to parse Optimus Manager state file: %s", qPrintable(jsonError.errorString()));

QJsonValue modeValue = jsonDocument.object().value(u"current_mode");
QJsonValue modeValue = jsonDocument.object().value("current_mode");
if (modeValue.type() != QJsonValue::String)
qFatal("Unable to read current mode from Optimus Manager state file");

Expand Down
1 change: 1 addition & 0 deletions src/third-party/singleapplication
Submodule singleapplication added at 611e48

0 comments on commit 98d630c

Please sign in to comment.