Skip to content
This repository was archived by the owner on Sep 1, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions bootstrap-vs15.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@echo off

if "%QTDIR%" EQU "" (
set QT=C:\Qt\5.10.0\msvc2017_64
) else (
set QT=%QTDIR%
)
set Qt5Core_DIR=%QT%
set Qt5Gui_DIR=%QT%
set Qt5Widgets_DIR=%QT%
set Qt5WinExtras_DIR=%QT%
set PATH=%QT%\bin;%PATH%

set _IsNativeEnvironment=true
call "%VS150COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" x64

set BUILD="%~dp0build"

mkdir "%BUILD%" 2>nul
pushd "%BUILD%"

cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ..
if %ERRORLEVEL% neq 0 (
popd
exit /b 1
)
devenv /useenv rclone-browser.sln

popd
4 changes: 4 additions & 0 deletions bootstrap.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ if "%QTDIR%" EQU "" (
) else (
set QT=%QTDIR%
)
set Qt5Core_DIR=%QT%
set Qt5Gui_DIR=%QT%
set Qt5Widgets_DIR=%QT%
set Qt5WinExtras_DIR=%QT%
set PATH=%QT%\bin;%PATH%

set _IsNativeEnvironment=true
Expand Down
39 changes: 37 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
cmake_minimum_required(VERSION 2.8)

if (NOT ${CMAKE_VERSION} VERSION_LESS "3.0.0")
cmake_policy(SET CMP0028 NEW)
endif()
if (NOT ${CMAKE_VERSION} VERSION_LESS "2.8.11")
cmake_policy(SET CMP0020 NEW)
endif()

if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /wd4100 /wd4189")
else()
add_definitions("-pedantic -Wall -Wextra -Werror -std=c++11")
endif()

project(rclone-browser)
FIND_PACKAGE(Qt5Core REQUIRED)
FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED)

if (WIN32)
FIND_PACKAGE(Qt5WinExtras REQUIRED)
elseif(APPLE)
FIND_PACKAGE(Qt5MacExtras REQUIRED)
endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)

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

use_pch(pch.h pch.cpp "${SOURCE}")
use_pch(pch.h pch.cpp "${MOC_OUT}")
MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar)
IF(MSVC)
GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE)
SET(PrecompiledBinary "${CMAKE_CURRENT_BINARY_DIR}/${PrecompiledBasename}.pch")
SET(Sources ${${SourcesVar}})

SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource}
PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
OBJECT_OUTPUTS "${PrecompiledBinary}")
SET_SOURCE_FILES_PROPERTIES(${Sources}
PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledHeader}\" /FI\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
OBJECT_DEPENDS "${PrecompiledBinary}")
# Add precompiled header to SourcesVar
LIST(APPEND ${SourcesVar} ${PrecompiledSource})
ENDIF(MSVC)
ENDMACRO(ADD_MSVC_PRECOMPILED_HEADER)

ADD_MSVC_PRECOMPILED_HEADER(pch.h pch.cpp SOURCE)
ADD_MSVC_PRECOMPILED_HEADER(pch.h pch.cpp MOC_OUT)

if(WIN32)
add_executable(RcloneBrowser WIN32 ${SOURCE} ${BACKEND} ${OTHER} ${MOC} ${MOC_OUT} ${UI_OUT} ${MOC_OUT} ${QRC_OUT})
Expand Down
11 changes: 9 additions & 2 deletions src/item_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,15 @@ void ItemModel::load(const QPersistentModelIndex& parentIndex, Item* parent)
timer->start(100);
UseRclonePassword(lsd);
UseRclonePassword(lsl);
lsd->start(GetRclone(), QStringList() << "lsd" << GetRcloneConf() << mRemote + ":" + parent->path.path(), QIODevice::ReadOnly);
lsl->start(GetRclone(), QStringList() << "lsl" << GetRcloneConf() << "--max-depth" << "1" << mRemote + ":" + parent->path.path(), QIODevice::ReadOnly);
QString path = parent->path.path();
if (path.trimmed().length() == 0) {
path = "/";
}
else if (path.at(0) != '/') {
path = "/" + path;
}
lsd->start(GetRclone(), QStringList() << "lsd" << GetRcloneConf() << mRemote + ":" + path, QIODevice::ReadOnly);
lsl->start(GetRclone(), QStringList() << "lsl" << GetRcloneConf() << "--max-depth" << "1" << mRemote + ":" + path, QIODevice::ReadOnly);
}

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