Skip to content
This repository was archived by the owner on Sep 1, 2019. It is now read-only.

Commit 8d3f77f

Browse files
committed
fixed missing leading / in path (required for some SFTP servers)
1 parent 7106638 commit 8d3f77f

File tree

5 files changed

+80
-5
lines changed

5 files changed

+80
-5
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ clone_depth: 1
77
build_script:
88
- mkdir build
99
- cd build
10-
- cmake -G "Visual Studio 12 Win64" -DCMAKE_PREFIX_PATH=C:\Qt\5.8\msvc2013_64 ..
10+
- cmake -G "Visual Studio 12 Win64" -DCMAKE_PREFIX_PATH=C:\Qt\5.8\msvc2013_64\lib\cmake ..
1111
- cmake --build .
1212
test: off
1313
deploy: off

bootstrap-vs15.cmd

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@echo off
2+
3+
if "%QTDIR%" EQU "" (
4+
set QT=C:\Qt\5.10.0\msvc2017_64
5+
) else (
6+
set QT=%QTDIR%
7+
)
8+
set Qt5Core_DIR=%QT%
9+
set Qt5Gui_DIR=%QT%
10+
set Qt5Widgets_DIR=%QT%
11+
set Qt5WinExtras_DIR=%QT%
12+
set PATH=%QT%\bin;%PATH%
13+
14+
set _IsNativeEnvironment=true
15+
call "%VS150COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" x64
16+
17+
set BUILD="%~dp0build"
18+
19+
mkdir "%BUILD%" 2>nul
20+
pushd "%BUILD%"
21+
22+
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ..
23+
if %ERRORLEVEL% neq 0 (
24+
popd
25+
exit /b 1
26+
)
27+
devenv /useenv rclone-browser.sln
28+
29+
popd

bootstrap.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ if "%QTDIR%" EQU "" (
55
) else (
66
set QT=%QTDIR%
77
)
8+
set Qt5Core_DIR=%QT%
9+
set Qt5Gui_DIR=%QT%
10+
set Qt5Widgets_DIR=%QT%
11+
set Qt5WinExtras_DIR=%QT%
812
set PATH=%QT%\bin;%PATH%
913

1014
set _IsNativeEnvironment=true

src/CMakeLists.txt

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
3+
if (NOT ${CMAKE_VERSION} VERSION_LESS "3.0.0")
4+
cmake_policy(SET CMP0028 NEW)
5+
endif()
6+
if (NOT ${CMAKE_VERSION} VERSION_LESS "2.8.11")
7+
cmake_policy(SET CMP0020 NEW)
8+
endif()
9+
110
if(WIN32)
211
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /wd4100 /wd4189")
312
else()
413
add_definitions("-pedantic -Wall -Wextra -Werror -std=c++11")
514
endif()
615

716
project(rclone-browser)
17+
FIND_PACKAGE(Qt5Core REQUIRED)
18+
FIND_PACKAGE(Qt5Gui REQUIRED)
19+
FIND_PACKAGE(Qt5Widgets REQUIRED)
20+
21+
if (WIN32)
22+
FIND_PACKAGE(Qt5WinExtras REQUIRED)
23+
elseif(APPLE)
24+
FIND_PACKAGE(Qt5MacExtras REQUIRED)
25+
endif()
826

927
set(CMAKE_INCLUDE_CURRENT_DIR ON)
1028

@@ -74,8 +92,25 @@ qt5_add_resources(QRC_OUT ${QRC} OPTIONS "-no-compress")
7492
source_group("" FILES ${SOURCE} ${MOC} ${UI} ${QRC} ${OTHER})
7593
source_group("Generated" FILES ${MOC_OUT} ${UI_OUT} ${MOC_OUT} ${QRC_OUT})
7694

77-
use_pch(pch.h pch.cpp "${SOURCE}")
78-
use_pch(pch.h pch.cpp "${MOC_OUT}")
95+
MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar)
96+
IF(MSVC)
97+
GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE)
98+
SET(PrecompiledBinary "${CMAKE_CURRENT_BINARY_DIR}/${PrecompiledBasename}.pch")
99+
SET(Sources ${${SourcesVar}})
100+
101+
SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource}
102+
PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
103+
OBJECT_OUTPUTS "${PrecompiledBinary}")
104+
SET_SOURCE_FILES_PROPERTIES(${Sources}
105+
PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledHeader}\" /FI\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
106+
OBJECT_DEPENDS "${PrecompiledBinary}")
107+
# Add precompiled header to SourcesVar
108+
LIST(APPEND ${SourcesVar} ${PrecompiledSource})
109+
ENDIF(MSVC)
110+
ENDMACRO(ADD_MSVC_PRECOMPILED_HEADER)
111+
112+
ADD_MSVC_PRECOMPILED_HEADER(pch.h pch.cpp SOURCE)
113+
ADD_MSVC_PRECOMPILED_HEADER(pch.h pch.cpp MOC_OUT)
79114

80115
if(WIN32)
81116
add_executable(RcloneBrowser WIN32 ${SOURCE} ${BACKEND} ${OTHER} ${MOC} ${MOC_OUT} ${UI_OUT} ${MOC_OUT} ${QRC_OUT})

src/item_model.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,15 @@ void ItemModel::load(const QPersistentModelIndex& parentIndex, Item* parent)
611611
timer->start(100);
612612
UseRclonePassword(lsd);
613613
UseRclonePassword(lsl);
614-
lsd->start(GetRclone(), QStringList() << "lsd" << GetRcloneConf() << mRemote + ":" + parent->path.path(), QIODevice::ReadOnly);
615-
lsl->start(GetRclone(), QStringList() << "lsl" << GetRcloneConf() << "--max-depth" << "1" << mRemote + ":" + parent->path.path(), QIODevice::ReadOnly);
614+
QString path = parent->path.path();
615+
if (path.trimmed().length() == 0) {
616+
path = "/";
617+
}
618+
else if (path.at(0) != '/') {
619+
path = "/" + path;
620+
}
621+
lsd->start(GetRclone(), QStringList() << "lsd" << GetRcloneConf() << mRemote + ":" + path, QIODevice::ReadOnly);
622+
lsl->start(GetRclone(), QStringList() << "lsl" << GetRcloneConf() << "--max-depth" << "1" << mRemote + ":" + path, QIODevice::ReadOnly);
616623
}
617624

618625
void ItemModel::sortRecursive(Item* item, const ItemSorter& sorter)

0 commit comments

Comments
 (0)