Compare commits
11 Commits
f3f98450e8
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
4045938bb7 | ||
|
26c10b8ccc | ||
4c18fa3944 | |||
8e2ff6c116 | |||
2408dc32ea | |||
|
0a6c764ce3 | ||
|
dc38809146 | ||
f308c6845e | |||
bfbb45d5cc | |||
7503db9059 | |||
|
25b78bd8d8 |
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
@ -7,29 +7,34 @@ jobs:
|
|||||||
build-msvc:
|
build-msvc:
|
||||||
name: Build Windows
|
name: Build Windows
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
BUILD_TOOLS_PATH: C:\apps\build-tools\
|
||||||
steps:
|
steps:
|
||||||
- name: Add Conan to path
|
- run: echo $env:BUILD_TOOLS_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
run: echo "C:\Program Files\Conan\conan\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Install deps
|
- name: Install Build tools
|
||||||
run: choco install jom conan -y
|
shell: cmake -P {0}
|
||||||
|
run: |
|
||||||
|
file(MAKE_DIRECTORY $ENV{BUILD_TOOLS_PATH})
|
||||||
|
file(DOWNLOAD https://cdn.anotherfoxguy.com/build-tools.zip "$ENV{TMP}/build-tools.zip" SHOW_PROGRESS)
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf "$ENV{TMP}/build-tools.zip" WORKING_DIRECTORY "$ENV{BUILD_TOOLS_PATH}")
|
||||||
|
|
||||||
- name: Enable Developer Command Prompt
|
- name: Enable Developer Command Prompt
|
||||||
uses: ilammy/msvc-dev-cmd@v1.10.0
|
uses: ilammy/msvc-dev-cmd@v1.10.0
|
||||||
|
|
||||||
- name: Cache conan packages
|
- name: Cache conan packages
|
||||||
uses: actions/cache@v2.1.6
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
key: win-conan-${{ hashFiles('**/conanfile.txt') }}
|
key: win-conan-${{ hashFiles('**/conanfile.txt') }}
|
||||||
path: ~/.conan/
|
path: ~/.conan/
|
||||||
|
|
||||||
- name: Cache Qt
|
- name: Cache Qt
|
||||||
id: cache-qt
|
id: cache-qt
|
||||||
uses: actions/cache@v2.1.6
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: "${{ github.workspace }}/qt/"
|
path: "${{ github.workspace }}/qt/"
|
||||||
key: ${{ runner.os }}-QtCache
|
key: ${{ runner.os }}-QtCache
|
||||||
@ -41,23 +46,22 @@ jobs:
|
|||||||
modules: qtwebengine
|
modules: qtwebengine
|
||||||
dir: "${{ github.workspace }}/qt/"
|
dir: "${{ github.workspace }}/qt/"
|
||||||
|
|
||||||
- name: Export qtkeychain
|
- name: Add conan remote
|
||||||
run: |
|
run: conan remote add fuel-scm https://artifactory.anotherfoxguy.com/artifactory/api/conan/fuel-scm -f
|
||||||
conan export recipes/qtkeychain
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
conan install .. --build=missing
|
conan install .. --build=missing
|
||||||
cmake -G"NMake Makefiles JOM" -DCMAKE_INSTALL_PREFIX=redist ..
|
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=redist ..
|
||||||
jom
|
ninja
|
||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
jom install
|
ninja install
|
||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
- name: Upload redist folder
|
- name: Upload redist folder
|
||||||
@ -70,7 +74,7 @@ jobs:
|
|||||||
name: Build Linux
|
name: Build Linux
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
@ -85,4 +89,4 @@ jobs:
|
|||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
make -j4
|
make -j4
|
||||||
shell: bash
|
shell: bash
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -44,4 +44,5 @@ CMakeLists.txt.user*
|
|||||||
|
|
||||||
*.qm
|
*.qm
|
||||||
/build*
|
/build*
|
||||||
.idea/
|
.idea/
|
||||||
|
test-pr
|
@ -155,7 +155,9 @@ endif ()
|
|||||||
# ------------------------------------------------------------------------------------------------#
|
# ------------------------------------------------------------------------------------------------#
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
include(FetchContent)
|
||||||
|
|
||||||
|
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "${PROJECT_NAME}")
|
||||||
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
|
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
|
||||||
set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
|
set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
|
||||||
set(CPACK_PACKAGE_DESCRIPTION "A GUI front-end for the Fossil SCM")
|
set(CPACK_PACKAGE_DESCRIPTION "A GUI front-end for the Fossil SCM")
|
||||||
@ -191,22 +193,34 @@ if (WIN32)
|
|||||||
|
|
||||||
install(CODE "execute_process(COMMAND ${QT_BIN_DIR}/windeployqt.exe $<TARGET_FILE:${PROJECT_NAME}> --release --no-opengl-sw --dir \${CMAKE_INSTALL_PREFIX})")
|
install(CODE "execute_process(COMMAND ${QT_BIN_DIR}/windeployqt.exe $<TARGET_FILE:${PROJECT_NAME}> --release --no-opengl-sw --dir \${CMAKE_INSTALL_PREFIX})")
|
||||||
|
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
fossil
|
||||||
|
URL https://fossil-scm.org/home/uv/fossil-w64-2.17.zip
|
||||||
|
URL_MD5 f62b6e28846871741e057cfd09acdfc8
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(fossil)
|
||||||
|
|
||||||
|
install(
|
||||||
|
PROGRAMS ${fossil_SOURCE_DIR}/fossil.exe
|
||||||
|
DESTINATION .
|
||||||
|
COMPONENT Fossil
|
||||||
|
EXCLUDE_FROM_ALL
|
||||||
|
)
|
||||||
|
|
||||||
# For Windows Desktop shortcuts
|
# For Windows Desktop shortcuts
|
||||||
set(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}" "${PROJECT_NAME}")
|
set(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}" "${PROJECT_NAME}")
|
||||||
|
|
||||||
# Windows Add or Remove Program properties
|
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
||||||
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${PROJECT_NAME}")
|
set(CPACK_NSIS_MODIFY_PATH "ON")
|
||||||
set(CPACK_WIX_PROPERTY_ARPCOMMENTS "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
|
set(CPACK_NSIS_HELP_LINK "https://fuel-scm.org")
|
||||||
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://fuel-scm.org")
|
set(CPACK_NSIS_URL_INFO_ABOUT "https://fuel-scm.org")
|
||||||
set(CPACK_WIX_PROPERTY_URLUPDATEINFO "https://fuel-scm.org")
|
SET(CPACK_NSIS_INSTALLED_ICON_NAME "Fuel.exe")
|
||||||
|
SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/rsrc/icons/fuel.ico")
|
||||||
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/rsrc/icons/fuel.ico")
|
SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/rsrc/icons/fuel.ico")
|
||||||
|
|
||||||
set(CPACK_WIX_LICENSE_RTF "${CPACK_RESOURCE_FILE_LICENSE}")
|
|
||||||
set(CPACK_WIX_UPGRADE_GUID "462522bf-36e4-4ce9-93e1-a4200f23096e")
|
|
||||||
|
|
||||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
|
||||||
set(CPACK_GENERATOR ${CPACK_GENERATOR};WIX)
|
set(CPACK_GENERATOR ${CPACK_GENERATOR} NSIS)
|
||||||
set(CPACK_MODULE_PATH "")
|
set(CPACK_MODULE_PATH "")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[requires]
|
[requires]
|
||||||
qtkeychain/0.12.0
|
qtkeychain/0.13.2
|
||||||
|
|
||||||
[generators]
|
[generators]
|
||||||
qmake
|
qmake
|
||||||
|
8
dist/debian/changelog
vendored
8
dist/debian/changelog
vendored
@ -1,8 +0,0 @@
|
|||||||
fuel (1.0.0-1) unstable; urgency=low
|
|
||||||
* Feature: Long Operations can now be aborted by pressing the Escape key
|
|
||||||
* Improvement: Better support for commit messages with international characters
|
|
||||||
* Improvement: Fossil queries about CR/NL inconsistencies are now handled better
|
|
||||||
* Improvement: Files in Conflicted state are now shown
|
|
||||||
* Added localisations: Russia, Portuguese
|
|
||||||
|
|
||||||
-- Kostas <karanikolas@gmail.com> Sat, 28 Mar 2015 12:00:00 +0200
|
|
1
dist/debian/compat
vendored
1
dist/debian/compat
vendored
@ -1 +0,0 @@
|
|||||||
9
|
|
17
dist/debian/control
vendored
17
dist/debian/control
vendored
@ -1,17 +0,0 @@
|
|||||||
Source: fuel
|
|
||||||
Section: x11
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: Kostas Karanikolas <karanikolas@gmail.com>
|
|
||||||
Build-Depends: cdbs, debhelper (>= 8.0.0), qtbase5-dev, qttools5-dev-tools,
|
|
||||||
libqt5webkit5-dev
|
|
||||||
Standards-Version: 3.9.4
|
|
||||||
Homepage: http://fuelscm.org
|
|
||||||
#Vcs-Git: git://git.debian.org/collab-maint/fuel.git
|
|
||||||
#Vcs-Browser: http://git.debian.org/?p=collab-maint/fuel.git;a=summary
|
|
||||||
|
|
||||||
Package: fuel
|
|
||||||
Architecture: any
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
|
||||||
Recommends: fossil
|
|
||||||
Description: Fossil SCM GUI
|
|
||||||
Fuel is cross-platform GUI front-end for the Fossil SCM tool written in Qt.
|
|
38
dist/debian/copyright
vendored
38
dist/debian/copyright
vendored
@ -1,38 +0,0 @@
|
|||||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
|
||||||
Upstream-Name: fuel
|
|
||||||
Source: <url://example.com>
|
|
||||||
|
|
||||||
Files: *
|
|
||||||
Copyright: <years> <put author's name and email here>
|
|
||||||
<years> <likewise for another author>
|
|
||||||
License: <special license>
|
|
||||||
<Put the license of the package here indented by 1 space>
|
|
||||||
<This follows the format of Description: lines in control file>
|
|
||||||
.
|
|
||||||
<Including paragraphs>
|
|
||||||
|
|
||||||
# If you want to use GPL v2 or later for the /debian/* files use
|
|
||||||
# the following clauses, or change it to suit. Delete these two lines
|
|
||||||
Files: debian/*
|
|
||||||
Copyright: 2014 Kostas <kostas@unknown>
|
|
||||||
License: GPL-2+
|
|
||||||
This package is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
.
|
|
||||||
This package is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
.
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
.
|
|
||||||
On Debian systems, the complete text of the GNU General
|
|
||||||
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
|
||||||
|
|
||||||
# Please also look if there are files or directories which have a
|
|
||||||
# different copyright/license attached and list them here.
|
|
||||||
# Please avoid to pick license terms that are more restrictive than the
|
|
||||||
# packaged work, as it may make Debian's contributions unacceptable upstream.
|
|
1
dist/debian/fuel.install
vendored
1
dist/debian/fuel.install
vendored
@ -1 +0,0 @@
|
|||||||
rsrc/icons/fuel.png usr/share/pixmaps
|
|
6
dist/debian/menu
vendored
6
dist/debian/menu
vendored
@ -1,6 +0,0 @@
|
|||||||
?package(fuel):\
|
|
||||||
needs="X11"\
|
|
||||||
section="Applications/File Management"\
|
|
||||||
title="Fuel"\
|
|
||||||
icon32x32="/usr/share/pixmaps/fuel.png"\
|
|
||||||
command="/usr/bin/fuel"
|
|
6
dist/debian/rules
vendored
6
dist/debian/rules
vendored
@ -1,6 +0,0 @@
|
|||||||
#!/usr/bin/make -f
|
|
||||||
# -*- makefile -*-
|
|
||||||
|
|
||||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
|
||||||
include /usr/share/cdbs/1/class/qmake.mk
|
|
||||||
|
|
1
dist/debian/source/format
vendored
1
dist/debian/source/format
vendored
@ -1 +0,0 @@
|
|||||||
3.0 (quilt)
|
|
24
dist/debian/watch
vendored
24
dist/debian/watch
vendored
@ -1,24 +0,0 @@
|
|||||||
# Example watch control file for uscan
|
|
||||||
# Rename this file to "watch" and then you can run the "uscan" command
|
|
||||||
# to check for upstream updates and more.
|
|
||||||
# See uscan(1) for format
|
|
||||||
|
|
||||||
# Compulsory line, this is a version 3 file
|
|
||||||
version=3
|
|
||||||
|
|
||||||
# Uncomment to examine a Webpage
|
|
||||||
# <Webpage URL> <string match>
|
|
||||||
#http://www.example.com/downloads.php fuel-(.*)\.tar\.gz
|
|
||||||
http://fuelscm.org/files/releases fuel-(.*)\.tar\.gz
|
|
||||||
|
|
||||||
# Uncomment to examine a Webserver directory
|
|
||||||
#http://www.example.com/pub/fuel-(.*)\.tar\.gz
|
|
||||||
|
|
||||||
# Uncommment to examine a FTP server
|
|
||||||
#ftp://ftp.example.com/pub/fuel-(.*)\.tar\.gz debian uupdate
|
|
||||||
|
|
||||||
# Uncomment to find new files on sourceforge, for devscripts >= 2.9
|
|
||||||
# http://sf.net/fuel/fuel-(.*)\.tar\.gz
|
|
||||||
|
|
||||||
# Uncomment to find new files on GooglePages
|
|
||||||
# http://example.googlepages.com/foo.html fuel-(.*)\.tar\.gz
|
|
27
dist/makedeb/PKGBUILD
vendored
Normal file
27
dist/makedeb/PKGBUILD
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Maintainer: Edgar <Edgar{at}AnotherFoxGuy.com>
|
||||||
|
pkgname=fuel-git
|
||||||
|
pkgver=2.0.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="A GUI front-end to Fossil SCM"
|
||||||
|
arch=(i686 x86_64)
|
||||||
|
url="https://fuel-scm.org/"
|
||||||
|
license=('GPL2')
|
||||||
|
depends=('qtbase5-dev' 'qtwebengine5-dev' 'qttools5-dev' 'fossil' 'qt5keychain-dev')
|
||||||
|
makedepends=('git' 'cmake')
|
||||||
|
source=("git://github.com/AnotherFoxGuy/fuel-scm")
|
||||||
|
md5sums=('SKIP')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$srcdir/fuel-scm"
|
||||||
|
[ -d build ] && rm -r build
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
|
||||||
|
make -j$(nproc)
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "$srcdir/fuel-scm/build"
|
||||||
|
make DESTDIR="${pkgdir}" install
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,7 @@ from conans import ConanFile, CMake, tools
|
|||||||
|
|
||||||
class QtkeychainConan(ConanFile):
|
class QtkeychainConan(ConanFile):
|
||||||
name = "qtkeychain"
|
name = "qtkeychain"
|
||||||
version = "0.12.0"
|
version = "0.13.2"
|
||||||
license = "BSD-3"
|
license = "BSD-3"
|
||||||
author = "Edgar"
|
author = "Edgar"
|
||||||
url = "https://github.com/AnotherFoxGuy/fuel-scm"
|
url = "https://github.com/AnotherFoxGuy/fuel-scm"
|
||||||
@ -14,7 +14,7 @@ class QtkeychainConan(ConanFile):
|
|||||||
scm = {
|
scm = {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/frankosterfeld/qtkeychain.git",
|
"url": "https://github.com/frankosterfeld/qtkeychain.git",
|
||||||
"revision": "v0.12.0"
|
"revision": "v0.13.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
|
@ -123,7 +123,7 @@ void Settings::SetFossilValue(const QString &name, const QVariant &value)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool Settings::SupportsLang(const QString &langId) const
|
bool Settings::SupportsLang(const QString &langId) const
|
||||||
{
|
{
|
||||||
QString locale_path = QString(":intl/intl/%0.qm").arg(langId);
|
QString locale_path = QString(":intl/%0.qm").arg(langId);
|
||||||
QResource res(locale_path);
|
QResource res(locale_path);
|
||||||
return res.isValid();
|
return res.isValid();
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ bool CloneDialog::run(QWidget *parent, QUrl &url, QString &repository, QUrl &url
|
|||||||
QString urltext = dlg.ui->lineURL->text();
|
QString urltext = dlg.ui->lineURL->text();
|
||||||
|
|
||||||
// Check if the url is a local file
|
// Check if the url is a local file
|
||||||
if (QFileInfo(urltext).exists())
|
if (QFileInfo::exists(urltext))
|
||||||
url = QUrl::fromLocalFile(urltext);
|
url = QUrl::fromLocalFile(urltext);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -36,14 +36,14 @@ WorkspaceState Fossil::getWorkspaceState()
|
|||||||
bool run_ok = exit_code == EXIT_SUCCESS;
|
bool run_ok = exit_code == EXIT_SUCCESS;
|
||||||
|
|
||||||
activeTags.clear();
|
activeTags.clear();
|
||||||
for (QStringList::iterator it = res.begin(); it != res.end(); ++it)
|
for (auto &re : res)
|
||||||
{
|
{
|
||||||
int col_index = it->indexOf(':');
|
int col_index = re.indexOf(':');
|
||||||
if (col_index == -1)
|
if (col_index == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString key = it->left(col_index).trimmed();
|
QString key = re.left(col_index).trimmed();
|
||||||
QString value = it->mid(col_index + 1).trimmed();
|
QString value = re.mid(col_index + 1).trimmed();
|
||||||
|
|
||||||
if (key == "fossil")
|
if (key == "fossil")
|
||||||
{
|
{
|
||||||
@ -363,7 +363,7 @@ bool Fossil::revertFiles(const QStringList &fileList)
|
|||||||
bool Fossil::renameFile(const QString &beforePath, const QString &afterPath, bool renameLocal)
|
bool Fossil::renameFile(const QString &beforePath, const QString &afterPath, bool renameLocal)
|
||||||
{
|
{
|
||||||
// Ensure we can rename the file
|
// Ensure we can rename the file
|
||||||
if (!QFileInfo(beforePath).exists() || QFileInfo(afterPath).exists())
|
if (!QFileInfo::exists(beforePath) || QFileInfo::exists(afterPath))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Do Rename
|
// Do Rename
|
||||||
@ -449,7 +449,7 @@ bool Fossil::setRemoteUrl(const QUrl &url)
|
|||||||
|
|
||||||
// FIXME: Fossil ignores any password passed via the URL
|
// FIXME: Fossil ignores any password passed via the URL
|
||||||
// Run as silent to avoid displaying credentials in the log
|
// Run as silent to avoid displaying credentials in the log
|
||||||
bool ok = runFossil(QStringList() << "remote-url" << u, 0, RUNFLAGS_SILENT_INPUT);
|
bool ok = runFossil(QStringList() << "remote-url" << u, nullptr, RUNFLAGS_SILENT_INPUT);
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -817,7 +817,7 @@ bool Fossil::runFossilRaw(const QStringList &args, QStringList *output, int *exi
|
|||||||
// Create fossil process
|
// Create fossil process
|
||||||
// FIXME: when we are sure this works delete this
|
// FIXME: when we are sure this works delete this
|
||||||
// LoggedProcess process(parentWidget*/);
|
// LoggedProcess process(parentWidget*/);
|
||||||
LoggedProcess process(0);
|
LoggedProcess process(nullptr);
|
||||||
|
|
||||||
process.setWorkingDirectory(wkdir);
|
process.setWorkingDirectory(wkdir);
|
||||||
|
|
||||||
@ -860,11 +860,7 @@ bool Fossil::runFossilRaw(const QStringList &args, QStringList *output, int *exi
|
|||||||
|
|
||||||
if (uiCallback->processAborted())
|
if (uiCallback->processAborted())
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN // Verify this is still true on Qt5
|
|
||||||
process.kill(); // QT on windows cannot terminate console processes with QProcess::terminate
|
|
||||||
#else
|
|
||||||
process.terminate();
|
process.terminate();
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1109,7 +1105,7 @@ bool Fossil::isWorkspace(const QString &path)
|
|||||||
QString checkout_file1 = wkspace + PATH_SEPARATOR + FOSSIL_CHECKOUT1;
|
QString checkout_file1 = wkspace + PATH_SEPARATOR + FOSSIL_CHECKOUT1;
|
||||||
QString checkout_file2 = wkspace + PATH_SEPARATOR + FOSSIL_CHECKOUT2;
|
QString checkout_file2 = wkspace + PATH_SEPARATOR + FOSSIL_CHECKOUT2;
|
||||||
|
|
||||||
return (QFileInfo(checkout_file1).exists() || QFileInfo(checkout_file2).exists());
|
return (QFileInfo::exists(checkout_file1) || QFileInfo::exists(checkout_file2));
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -1204,11 +1200,7 @@ void Fossil::stopUI()
|
|||||||
{
|
{
|
||||||
if (uiRunning())
|
if (uiRunning())
|
||||||
{
|
{
|
||||||
#ifdef Q_WS_WIN
|
|
||||||
fossilUI.kill(); // QT on windows cannot terminate console processes with QProcess::terminate
|
|
||||||
#else
|
|
||||||
fossilUI.terminate();
|
fossilUI.terminate();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
fossilUI.close();
|
fossilUI.close();
|
||||||
fossilUIPort.clear();
|
fossilUIPort.clear();
|
||||||
|
@ -199,12 +199,12 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Q_ASSERT(recent_sep);
|
Q_ASSERT(recent_sep);
|
||||||
for (int i = 0; i < MAX_RECENT; ++i)
|
for (auto &recentWorkspaceAct : recentWorkspaceActs)
|
||||||
{
|
{
|
||||||
recentWorkspaceActs[i] = new QAction(this);
|
recentWorkspaceAct = new QAction(this);
|
||||||
recentWorkspaceActs[i]->setVisible(false);
|
recentWorkspaceAct->setVisible(false);
|
||||||
connect(recentWorkspaceActs[i], SIGNAL(triggered()), this, SLOT(onOpenRecent()));
|
connect(recentWorkspaceAct, SIGNAL(triggered()), this, SLOT(onOpenRecent()));
|
||||||
ui->menuFile->insertAction(recent_sep, recentWorkspaceActs[i]);
|
ui->menuFile->insertAction(recent_sep, recentWorkspaceAct);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom Actions
|
// Custom Actions
|
||||||
@ -368,7 +368,7 @@ bool MainWindow::openWorkspace(const QString &path)
|
|||||||
QString checkout_file1 = wkspace + PATH_SEPARATOR + FOSSIL_CHECKOUT1;
|
QString checkout_file1 = wkspace + PATH_SEPARATOR + FOSSIL_CHECKOUT1;
|
||||||
QString checkout_file2 = wkspace + PATH_SEPARATOR + FOSSIL_CHECKOUT2;
|
QString checkout_file2 = wkspace + PATH_SEPARATOR + FOSSIL_CHECKOUT2;
|
||||||
|
|
||||||
if (!(QFileInfo(checkout_file1).exists() || QFileInfo(checkout_file2).exists()))
|
if (!(QFileInfo::exists(checkout_file1) || QFileInfo::exists(checkout_file2)))
|
||||||
{
|
{
|
||||||
if (QMessageBox::Yes != DialogQuery(this, tr("Open Workspace"), tr("A workspace does not exist in this folder.\nWould you like to create one here?")))
|
if (QMessageBox::Yes != DialogQuery(this, tr("Open Workspace"), tr("A workspace does not exist in this folder.\nWould you like to create one here?")))
|
||||||
{
|
{
|
||||||
@ -569,8 +569,8 @@ void MainWindow::on_actionCloneRepository_triggered()
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void MainWindow::rebuildRecent()
|
void MainWindow::rebuildRecent()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_RECENT; ++i)
|
for (auto &recentWorkspaceAct : recentWorkspaceActs)
|
||||||
recentWorkspaceActs[i]->setVisible(false);
|
recentWorkspaceAct->setVisible(false);
|
||||||
|
|
||||||
int enabled_acts = qMin<int>(MAX_RECENT, workspaceHistory.size());
|
int enabled_acts = qMin<int>(MAX_RECENT, workspaceHistory.size());
|
||||||
|
|
||||||
@ -610,8 +610,8 @@ void MainWindow::enableActions(bool on)
|
|||||||
ui->actionViewIgnored, ui->actionViewModifedOnly, ui->actionViewModified, ui->actionViewUnchanged,
|
ui->actionViewIgnored, ui->actionViewModifedOnly, ui->actionViewModified, ui->actionViewUnchanged,
|
||||||
ui->actionViewUnknown};
|
ui->actionViewUnknown};
|
||||||
|
|
||||||
for (size_t i = 0; i < COUNTOF(actions); ++i)
|
for (auto &action : actions)
|
||||||
actions[i]->setEnabled(on);
|
action->setEnabled(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -710,9 +710,8 @@ static void addPathToTree(QStandardItem &root, const QString &path, const QIcon
|
|||||||
QStandardItem *parent = &root;
|
QStandardItem *parent = &root;
|
||||||
|
|
||||||
QString fullpath;
|
QString fullpath;
|
||||||
for (QStringList::iterator it = dirs.begin(); it != dirs.end(); ++it)
|
for (auto &dir : dirs)
|
||||||
{
|
{
|
||||||
const QString &dir = *it;
|
|
||||||
fullpath += dir;
|
fullpath += dir;
|
||||||
|
|
||||||
// Find the child that matches this subdirectory
|
// Find the child that matches this subdirectory
|
||||||
@ -810,7 +809,7 @@ void MainWindow::updateWorkspaceView()
|
|||||||
if (viewMode == VIEWMODE_TREE)
|
if (viewMode == VIEWMODE_TREE)
|
||||||
{
|
{
|
||||||
// FIXME: Change paths to map to allow for automatic sorting
|
// FIXME: Change paths to map to allow for automatic sorting
|
||||||
QStringList paths = getWorkspace().getPaths().toList();
|
QStringList paths = getWorkspace().getPaths().values();
|
||||||
paths.sort();
|
paths.sort();
|
||||||
|
|
||||||
foreach (const QString &dir, paths)
|
foreach (const QString &dir, paths)
|
||||||
@ -885,15 +884,15 @@ void MainWindow::updateWorkspaceView()
|
|||||||
remotes->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTES, ""), ROLE_WORKSPACE_ITEM);
|
remotes->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTES, ""), ROLE_WORKSPACE_ITEM);
|
||||||
remotes->setEditable(false);
|
remotes->setEditable(false);
|
||||||
getWorkspace().getTreeModel().appendRow(remotes);
|
getWorkspace().getTreeModel().appendRow(remotes);
|
||||||
for (remote_map_t::const_iterator it = getWorkspace().getRemotes().begin(); it != getWorkspace().getRemotes().end(); ++it)
|
for (const auto &it : getWorkspace().getRemotes())
|
||||||
{
|
{
|
||||||
QStandardItem *remote_item = new QStandardItem(getCachedIcon(":icons/icon-item-remote"), it->name);
|
QStandardItem *remote_item = new QStandardItem(getCachedIcon(":icons/icon-item-remote"), it.name);
|
||||||
remote_item->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTE, it->url.toString()), ROLE_WORKSPACE_ITEM);
|
remote_item->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTE, it.url.toString()), ROLE_WORKSPACE_ITEM);
|
||||||
|
|
||||||
remote_item->setToolTip(UrlToStringDisplay(it->url));
|
remote_item->setToolTip(UrlToStringDisplay(it.url));
|
||||||
|
|
||||||
// Mark the default url as bold
|
// Mark the default url as bold
|
||||||
if (it->isDefault)
|
if (it.isDefault)
|
||||||
{
|
{
|
||||||
QFont font = remote_item->font();
|
QFont font = remote_item->font();
|
||||||
font.setBold(true);
|
font.setBold(true);
|
||||||
@ -972,12 +971,12 @@ void MainWindow::updateFileView()
|
|||||||
const QString *status_text = &status_unknown;
|
const QString *status_text = &status_unknown;
|
||||||
const char *status_icon_path = ":icons/icon-item-unknown"; // Default icon
|
const char *status_icon_path = ":icons/icon-item-unknown"; // Default icon
|
||||||
|
|
||||||
for (size_t t = 0; t < COUNTOF(stats); ++t)
|
for (auto &stat : stats)
|
||||||
{
|
{
|
||||||
if (e.getType() == stats[t].type)
|
if (e.getType() == stat.type)
|
||||||
{
|
{
|
||||||
status_text = &stats[t].text;
|
status_text = &stat.text;
|
||||||
status_icon_path = stats[t].icon;
|
status_icon_path = stat.icon;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1188,9 +1187,8 @@ void MainWindow::updateSettings()
|
|||||||
Settings::custom_actions_t &actions = settings.GetCustomActions();
|
Settings::custom_actions_t &actions = settings.GetCustomActions();
|
||||||
store->beginWriteArray("CustomActions", actions.size());
|
store->beginWriteArray("CustomActions", actions.size());
|
||||||
int active_actions = 0;
|
int active_actions = 0;
|
||||||
for (int i = 0; i < actions.size(); ++i)
|
for (auto &action : actions)
|
||||||
{
|
{
|
||||||
CustomAction &action = actions[i];
|
|
||||||
if (!action.IsValid())
|
if (!action.IsValid())
|
||||||
continue;
|
continue;
|
||||||
store->setArrayIndex(active_actions);
|
store->setArrayIndex(active_actions);
|
||||||
|
@ -41,9 +41,8 @@ SettingsDialog::SettingsDialog(QWidget *parent, Settings &_settings) : QDialog(p
|
|||||||
|
|
||||||
GetCustomAction(0);
|
GetCustomAction(0);
|
||||||
|
|
||||||
for (int i = 0; i < currentCustomActions.size(); ++i)
|
for (auto &a : currentCustomActions)
|
||||||
{
|
{
|
||||||
CustomAction &a = currentCustomActions[i];
|
|
||||||
ui->cmbCustomAction->addItem(a.Id);
|
ui->cmbCustomAction->addItem(a.Id);
|
||||||
}
|
}
|
||||||
ui->cmbCustomAction->setCurrentIndex(0);
|
ui->cmbCustomAction->setCurrentIndex(0);
|
||||||
@ -79,9 +78,8 @@ void SettingsDialog::on_buttonBox_accepted()
|
|||||||
if (curr_langid != new_langid)
|
if (curr_langid != new_langid)
|
||||||
QMessageBox::information(this, tr("Restart required"), tr("The language change will take effect after restarting the application"), QMessageBox::Ok);
|
QMessageBox::information(this, tr("Restart required"), tr("The language change will take effect after restarting the application"), QMessageBox::Ok);
|
||||||
|
|
||||||
for (int i = 0; i < currentCustomActions.size(); ++i)
|
for (auto &a : currentCustomActions)
|
||||||
{
|
{
|
||||||
CustomAction &a = currentCustomActions[i];
|
|
||||||
a.Description = a.Description.trimmed();
|
a.Description = a.Description.trimmed();
|
||||||
a.Command = a.Command.trimmed();
|
a.Command = a.Command.trimmed();
|
||||||
}
|
}
|
||||||
|
@ -39,15 +39,15 @@ void Workspace::storeWorkspace(QSettings &store)
|
|||||||
|
|
||||||
store.beginWriteArray(workspace_hash);
|
store.beginWriteArray(workspace_hash);
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (remote_map_t::iterator it = remotes.begin(); it != remotes.end(); ++it, ++index)
|
for (auto &re : remotes)
|
||||||
{
|
{
|
||||||
store.setArrayIndex(index);
|
store.setArrayIndex(index);
|
||||||
store.setValue("Name", it->name);
|
store.setValue("Name", re.name);
|
||||||
QUrl url = it->url;
|
QUrl url = re.url;
|
||||||
url.setPassword("");
|
url.setPassword("");
|
||||||
store.setValue("Url", url);
|
store.setValue("Url", url);
|
||||||
if (it->isDefault)
|
if (re.isDefault)
|
||||||
store.setValue("Default", it->isDefault);
|
store.setValue("Default", re.isDefault);
|
||||||
else
|
else
|
||||||
store.remove("Default");
|
store.remove("Default");
|
||||||
}
|
}
|
||||||
@ -77,10 +77,7 @@ bool Workspace::switchWorkspace(const QString &workspace, QSettings &store)
|
|||||||
// Load Remotes
|
// Load Remotes
|
||||||
QString workspace_hash = HashString(QDir::toNativeSeparators(new_workspace));
|
QString workspace_hash = HashString(QDir::toNativeSeparators(new_workspace));
|
||||||
|
|
||||||
QString gr = store.group();
|
|
||||||
|
|
||||||
store.beginGroup("Remotes");
|
store.beginGroup("Remotes");
|
||||||
gr = store.group();
|
|
||||||
int num_remotes = store.beginReadArray(workspace_hash);
|
int num_remotes = store.beginReadArray(workspace_hash);
|
||||||
for (int i = 0; i < num_remotes; ++i)
|
for (int i = 0; i < num_remotes; ++i)
|
||||||
{
|
{
|
||||||
@ -124,12 +121,11 @@ bool Workspace::scanDirectory(QFileInfoList &entries, const QString &dirPath, co
|
|||||||
uiCallback.updateProcess(dirPath);
|
uiCallback.updateProcess(dirPath);
|
||||||
|
|
||||||
QFileInfoList list = dir.entryInfoList(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot);
|
QFileInfoList list = dir.entryInfoList(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot);
|
||||||
for (int i = 0; i < list.count(); ++i)
|
for (auto &info : list)
|
||||||
{
|
{
|
||||||
if (uiCallback.processAborted())
|
if (uiCallback.processAborted())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QFileInfo info = list[i];
|
|
||||||
QString filepath = info.filePath();
|
QString filepath = info.filePath();
|
||||||
QString rel_path = filepath;
|
QString rel_path = filepath;
|
||||||
rel_path.remove(baseDir + PATH_SEPARATOR);
|
rel_path.remove(baseDir + PATH_SEPARATOR);
|
||||||
@ -188,10 +184,10 @@ void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModifie
|
|||||||
if (!scanDirectory(all_files, wkdir, wkdir, ignore, uiCallback))
|
if (!scanDirectory(all_files, wkdir, wkdir, ignore, uiCallback))
|
||||||
goto _done;
|
goto _done;
|
||||||
|
|
||||||
for (QFileInfoList::iterator it = all_files.begin(); it != all_files.end(); ++it)
|
for (auto &all_file : all_files)
|
||||||
{
|
{
|
||||||
QString filename = it->fileName();
|
QString filename = all_file.fileName();
|
||||||
QString fullpath = it->absoluteFilePath();
|
QString fullpath = all_file.absoluteFilePath();
|
||||||
|
|
||||||
// Skip fossil files
|
// Skip fossil files
|
||||||
if (filename == FOSSIL_CHECKOUT1 || filename == FOSSIL_CHECKOUT2 || (!fossil().getRepositoryFile().isEmpty() && QFileInfo(fullpath) == QFileInfo(fossil().getRepositoryFile())))
|
if (filename == FOSSIL_CHECKOUT1 || filename == FOSSIL_CHECKOUT2 || (!fossil().getRepositoryFile().isEmpty() && QFileInfo(fullpath) == QFileInfo(fossil().getRepositoryFile())))
|
||||||
@ -199,7 +195,7 @@ void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModifie
|
|||||||
|
|
||||||
WorkspaceFile::Type type = WorkspaceFile::TYPE_UNKNOWN;
|
WorkspaceFile::Type type = WorkspaceFile::TYPE_UNKNOWN;
|
||||||
|
|
||||||
WorkspaceFile *rf = new WorkspaceFile(*it, type, wkdir);
|
WorkspaceFile *rf = new WorkspaceFile(all_file, type, wkdir);
|
||||||
const QString &path = rf->getPath();
|
const QString &path = rf->getPath();
|
||||||
getFiles().insert(rf->getFilePath(), rf);
|
getFiles().insert(rf->getFilePath(), rf);
|
||||||
getPaths().insert(path);
|
getPaths().insert(path);
|
||||||
@ -220,9 +216,9 @@ void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModifie
|
|||||||
uiCallback.beginProcess(QObject::tr("Updating..."));
|
uiCallback.beginProcess(QObject::tr("Updating..."));
|
||||||
|
|
||||||
// Update Files and Directories
|
// Update Files and Directories
|
||||||
for (QStringList::iterator line_it = res.begin(); line_it != res.end(); ++line_it)
|
for (auto &re : res)
|
||||||
{
|
{
|
||||||
QString line = (*line_it).trimmed();
|
QString line = re.trimmed();
|
||||||
if (line.length() == 0)
|
if (line.length() == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -323,9 +319,9 @@ void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModifie
|
|||||||
parent_path = "";
|
parent_path = "";
|
||||||
|
|
||||||
// Merge path of child to parent
|
// Merge path of child to parent
|
||||||
pathstate_map_t::iterator state_it = pathState.find(parent_path);
|
pathstate_map_t::iterator state_it2 = pathState.find(parent_path);
|
||||||
if (state_it != pathState.end())
|
if (state_it2 != pathState.end())
|
||||||
state_it.value() = static_cast<WorkspaceFile::Type>(state_it.value() | state);
|
state_it2.value() = static_cast<WorkspaceFile::Type>(state_it2.value() | state);
|
||||||
else
|
else
|
||||||
pathState.insert(parent_path, state);
|
pathState.insert(parent_path, state);
|
||||||
}
|
}
|
||||||
@ -386,15 +382,15 @@ bool Workspace::setRemoteDefault(const QUrl &url)
|
|||||||
const QString &url_str = url.toString();
|
const QString &url_str = url.toString();
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (remote_map_t::iterator it = remotes.begin(); it != remotes.end(); ++it)
|
for (auto &remote : remotes)
|
||||||
{
|
{
|
||||||
if (it->url.toString() == url_str) // FIXME: Use strings as QUrl to QUrl comparisons sometime fail!?
|
if (remote.url.toString() == url_str) // FIXME: Use strings as QUrl to QUrl comparisons sometime fail!?
|
||||||
{
|
{
|
||||||
it->isDefault = true;
|
remote.isDefault = true;
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
it->isDefault = false;
|
remote.isDefault = false;
|
||||||
}
|
}
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
@ -402,10 +398,10 @@ bool Workspace::setRemoteDefault(const QUrl &url)
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QUrl Workspace::getRemoteDefault() const
|
QUrl Workspace::getRemoteDefault() const
|
||||||
{
|
{
|
||||||
for (remote_map_t::const_iterator it = remotes.begin(); it != remotes.end(); ++it)
|
for (const auto &remote : remotes)
|
||||||
{
|
{
|
||||||
if (it->isDefault)
|
if (remote.isDefault)
|
||||||
return it->url;
|
return remote.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
return QUrl();
|
return QUrl();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user