Skip to content

Commit c5f5238

Browse files
committed
Fix descriptions removal, refactoring, warnings
1 parent 7bda1c2 commit c5f5238

19 files changed

Lines changed: 109 additions & 28 deletions

_build/ci/travis/build.cmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ call :%COMPILER%
1010
:MSVC_PROJ
1111
set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin;%PATH%
1212

13+
rem print version
14+
cl
15+
1316
cd far
1417
MSBuild.exe /property:Configuration=%CONFIG% /property:Platform=%PLATFORM% far.vcxproj || %throw%
1518

@@ -20,6 +23,9 @@ MSBuild.exe /property:Configuration=%CONFIG% /property:Platform=%PLATFORM% far.v
2023
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars%PLATFORM:~-2%.bat" || %throw%
2124
if %CONFIG%==Debug set DEBUG=1
2225

26+
rem print version
27+
cl
28+
2329
cd far
2430
nmake /f makefile_vc %ADD_MAKE% || %throw%
2531
cd ..
@@ -37,6 +43,9 @@ set PATH=C:\Program Files\LLVM\bin;%PATH%
3743
set CLANG=1
3844
if %CONFIG%==Debug set DEBUG=1
3945

46+
rem print version
47+
clang --version
48+
4049
cd far
4150
nmake /f makefile_vc %ADD_MAKE% || %throw%
4251
cd ..
@@ -48,6 +57,9 @@ cd ..
4857
set PATH=C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw%PLATFORM:~-2%\bin;%PATH%
4958
if %CONFIG%==Debug set DEBUG=1
5059

60+
rem print version
61+
gcc --version
62+
5163
cd far
5264
mingw32-make -j4 -f makefile_gcc %ADD_MAKE% || %throw%
5365
cd ..

appveyor-clang.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ environment:
3737
bit: 64
3838

3939
build_script:
40+
#print version
41+
- clang --version
4042
#build Far
4143
- cd far
4244
- set FARMANAGER_BUILD_TYPE=VS_RELEASE

appveyor-gcc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ environment:
3737
ADD_MAKE: DIRBIT=64
3838

3939
build_script:
40+
#print version
41+
- gcc --version
4042
#build Far
4143
- cd far
4244
- set FARMANAGER_BUILD_TYPE=VS_RELEASE

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ build_script:
8888
- enc/tools/tool.make_lua_chm.bat
8989
#set vs environment variables
9090
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars%bit%.bat"
91+
#print version
92+
- cl
9193
#build far
9294
- cd far
9395
- set FARMANAGER_BUILD_TYPE=VS_RELEASE

far/changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
drkns 29.05.2020 18:57:47 +0100 - build 5612
2+
3+
1. В некоторых случаях не удалялись описания файлов.
4+
5+
2. Рефакторинг.
6+
7+
3. Warnings.
8+
19
svs 27.05.2020 21:30:18 +0300 - build 5611
210

311
1. SQLite 3.32.1

far/changelog_eng

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
drkns 29.05.2020 18:57:47 +0100 - build 5612
2+
3+
1. File descriptions weren't removed in some cases.
4+
5+
2. Refactoring.
6+
7+
3. Warnings.
8+
9+
svs 27.05.2020 21:30:18 +0300 - build 5611
10+
11+
1. SQLite 3.32.1
12+
113
drkns 26.05.2020 08:45:08 +0100 - build 5610
214

315
1. Correction of 5608.

far/common/function_traits.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3636

3737
namespace detail
3838
{
39-
template<typename T>
40-
using root_type_t = std::remove_cv_t<std::remove_reference_t<std::remove_pointer_t<T>>>;
41-
4239
template<typename result, typename object, typename... args>
4340
struct function_traits_impl
4441
{
4542
using result_type = result;
4643

4744
template <size_t i>
4845
using arg = std::tuple_element_t<i, std::tuple<args...>>;
49-
50-
using root_result_type = root_type_t<result>;
5146
};
5247
}
5348

@@ -67,6 +62,6 @@ template<typename result, typename object, typename... args>
6762
struct function_traits<result(object::*)(args...) const>: detail::function_traits_impl<result, object, args...> {};
6863

6964

70-
#define FN_RETURN_TYPE(...) function_traits<decltype(&__VA_ARGS__)>::root_result_type
65+
#define FN_RETURN_TYPE(...) std::decay_t<function_traits<decltype(&__VA_ARGS__)>::result_type>
7166

7267
#endif // FUNCTION_TRAITS_HPP_071DD1DD_F933_40DC_A662_CB85F7BE7F00

far/common/utility.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3232
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
*/
3434

35+
#include "function_traits.hpp"
36+
#include "type_traits.hpp"
37+
3538
//----------------------------------------------------------------------------
3639

3740
template<typename T>
@@ -231,6 +234,13 @@ template<typename... args> overload(args&&...) -> overload<args...>;
231234
template<typename callable, typename variant>
232235
constexpr decltype(auto) visit_if(callable&& Callable, variant&& Variant)
233236
{
237+
{
238+
using arg = typename function_traits<callable>::template arg<0>;
239+
using get_arg = decltype(std::get<std::decay_t<arg>>(Variant));
240+
// This will fail if callable's arg type is not compatible with the variant:
241+
using try_call [[maybe_unused]] = decltype(Callable(std::declval<get_arg>()));
242+
}
243+
234244
return std::visit(overload
235245
{
236246
FWD(Callable),

far/delete.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ struct total_items
9393
class ShellDelete : noncopyable
9494
{
9595
public:
96-
ShellDelete(panel_ptr SrcPanel, delete_type Type, bool UpdateDiz);
96+
ShellDelete(panel_ptr SrcPanel, delete_type Type);
9797

9898
struct progress
9999
{
@@ -718,11 +718,18 @@ void ShellDelete::process_item(
718718

719719
}
720720

721-
ShellDelete::ShellDelete(panel_ptr SrcPanel, delete_type const Type, bool const UpdateDiz):
721+
ShellDelete::ShellDelete(panel_ptr SrcPanel, delete_type const Type):
722722
m_DeleteFolders(!Global->Opt->Confirm.DeleteFolder),
723-
m_UpdateDiz(UpdateDiz),
723+
m_UpdateDiz(Global->Opt->Diz.UpdateMode == DIZ_UPDATE_ALWAYS || (SrcPanel->IsDizDisplayed() && Global->Opt->Diz.UpdateMode == DIZ_UPDATE_IF_DISPLAYED)),
724724
m_DeleteType(Type)
725725
{
726+
if (m_UpdateDiz)
727+
SrcPanel->ReadDiz();
728+
729+
const auto strDizName = SrcPanel->GetDizName();
730+
const auto CheckDiz = [&] { return !strDizName.empty() && os::fs::exists(strDizName); };
731+
const auto DizPresent = CheckDiz();
732+
726733
SCOPED_ACTION(TPreRedrawFuncGuard)(std::make_unique<DelPreRedrawItem>());
727734

728735
const auto SelCount = SrcPanel->GetSelCount();
@@ -742,6 +749,9 @@ ShellDelete::ShellDelete(panel_ptr SrcPanel, delete_type const Type, bool const
742749

743750
SCOPE_EXIT
744751
{
752+
if (m_UpdateDiz && DizPresent == CheckDiz())
753+
SrcPanel->FlushDiz();
754+
745755
ShellUpdatePanels(SrcPanel, NeedSetUpADir);
746756
};
747757

@@ -1156,24 +1166,12 @@ bool delayed_deleter::any() const
11561166

11571167
void Delete(const panel_ptr& SrcPanel, delete_type const Type)
11581168
{
1159-
const auto UpdateDiz = Global->Opt->Diz.UpdateMode == DIZ_UPDATE_ALWAYS || (SrcPanel->IsDizDisplayed() && Global->Opt->Diz.UpdateMode == DIZ_UPDATE_IF_DISPLAYED);
1160-
1161-
if (UpdateDiz)
1162-
SrcPanel->ReadDiz();
1163-
1164-
const auto strDizName = SrcPanel->GetDizName();
1165-
const auto CheckDiz = [&]{ return !strDizName.empty() && os::fs::exists(strDizName); };
1166-
const auto DizPresent = CheckDiz();
1167-
11681169
try
11691170
{
1170-
ShellDelete(SrcPanel, Type, UpdateDiz);
1171+
ShellDelete(SrcPanel, Type);
11711172
}
11721173
catch (const operation_cancelled&)
11731174
{
11741175
// Nop
11751176
}
1176-
1177-
if (UpdateDiz && DizPresent == CheckDiz())
1178-
SrcPanel->FlushDiz();
11791177
}

far/filelist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5198,7 +5198,7 @@ void FileList::UpdateKeyBar()
51985198

51995199
bool FileList::PluginPanelHelp(const plugin_panel* hPlugin) const
52005200
{
5201-
auto strPath = hPlugin->plugin()->ModuleName();
5201+
string_view strPath = hPlugin->plugin()->ModuleName();
52025202
CutToSlash(strPath);
52035203
const auto [File, Name, Codepage] = OpenLangFile(strPath, Global->HelpFileMask, Global->Opt->strHelpLanguage);
52045204
if (!File)

0 commit comments

Comments
 (0)