Skip to content

Commit

Permalink
Merge from master to get localization updates
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjustice committed Apr 27, 2018
2 parents f2dd108 + f038040 commit d793d5f
Show file tree
Hide file tree
Showing 23 changed files with 3,200 additions and 1,438 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,4 @@ __pycache__/
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
*.xsd.cs
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ If you just want to download the WinFile application without worrying about comp

Please select the version which you would like to download.

Latest build from master: coming soon

[Latest Stable Release (v10.0)](https://github.com/Microsoft/winfile/releases/tag/v10.0)

[Original_Plus](https://github.com/Microsoft/winfile/releases/tag/original_plus)
Expand Down Expand Up @@ -97,6 +99,7 @@ You can read the code for more details.

## Contributing

### Contributor License Agreement
As mentioned above, this project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.microsoft.com.
Expand All @@ -109,6 +112,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

### What Makes a Good Pull Request for WinFile?
If you are interested in contributing and/or suggesting changes to the actual application, you might find it helpful to [read this post first](https://github.com/Microsoft/winfile/issues/88).

## License

Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
17 changes: 7 additions & 10 deletions src/BagOValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class BagOValues
this->m_spinlock.Lock();
wstring lowered;
lowered.resize(key.size());
transform(key.begin(), key.end(), lowered.begin(), ::tolower);
m_Values.insert(m_Values.end(), make_pair(lowered, value));
transform(std::begin(key), std::end(key), std::begin(lowered), ::tolower);
m_Values.emplace_back(make_pair(std::move(lowered), value));

m_lastStr.resize(0); // clear this after new data added
this->m_spinlock.Unlock();
Expand All @@ -57,13 +57,13 @@ class BagOValues
// fPrefix = false means that we only return values when an entire key matches and we match substrings of the query
//
// NOTE: returns a newly allocated vector; must delete it
vector<TValue> *Retrieve(const wstring& query, bool fPrefix = true, unsigned maxResults = ULONG_MAX)
vector<TValue> Retrieve(const wstring& query, bool fPrefix = true, unsigned maxResults = ULONG_MAX)
{
wstring lowered;
lowered.resize(query.size());
transform(query.begin(), query.end(), lowered.begin(), ::tolower);
transform(std::cbegin(query), std::cend(query), std::begin(lowered), ::tolower);

vector<TValue> *results = NULL;
vector<TValue> results;
TValue val = TValue();
TPair laspair = make_pair(lowered, val);

Expand Down Expand Up @@ -93,13 +93,10 @@ class BagOValues
continue;
}

if (results == NULL)
results = new vector<TValue>();

if (results->size() >= maxResults)
if (results.size() >= maxResults)
break;

results->insert(results->end(), itr->second);
results.push_back(itr->second);
}
else if (cmp > 0)
{
Expand Down
4 changes: 4 additions & 0 deletions src/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ifeq ($(OS),Windows_NT)
TARGET := $(TARGET).exe
endif

.PHONY: all depend clean
.SUFFIXES: .c .cpp .o .res

all : $(TARGET)
Expand All @@ -59,4 +60,7 @@ res.o : res.rc
clean :
rm -f $(OBJS) $(TARGET)

depend:
gcc -E -MM -w *.c >> Makefile.depends

-include Makefile.depends
11 changes: 9 additions & 2 deletions src/Winfile.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,12 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="suggest.db" />
<None Include="winfile.dlg" />
<None Include="lang\res_en-US.rc"/>
<None Include="lang\res_zh-CN.rc"/>
<None Include="lang\suggest_en-US.db" />
<None Include="lang\suggest_zh-CN.db" />
<None Include="lang\winfile_en-US.dlg" />
<None Include="lang\winfile_zh-CN.dlg" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dbg.c" />
Expand Down Expand Up @@ -278,6 +282,9 @@
<ClCompile Include="winfile.c" />
<ClCompile Include="wnetcaps.c" />
</ItemGroup>
<ItemGroup>
<Manifest Include="winfile.exe.manifest" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
92 changes: 92 additions & 0 deletions src/Winfile.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Manifest Include="winfile.exe.manifest" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dbg.c" />
<ClCompile Include="lfn.c" />
<ClCompile Include="lfnmisc.c" />
<ClCompile Include="numfmt.c" />
<ClCompile Include="suggest.c" />
<ClCompile Include="tbar.c" />
<ClCompile Include="treectl.c" />
<ClCompile Include="wfassoc.c" />
<ClCompile Include="wfchgnot.c" />
<ClCompile Include="wfcomman.c" />
<ClCompile Include="wfcopy.c" />
<ClCompile Include="wfdir.c" />
<ClCompile Include="wfdirrd.c" />
<ClCompile Include="wfdirsrc.c" />
<ClCompile Include="wfdlgs.c" />
<ClCompile Include="wfdlgs2.c" />
<ClCompile Include="wfdlgs3.c" />
<ClCompile Include="wfdos.c" />
<ClCompile Include="wfdrives.c" />
<ClCompile Include="wfdrop.c" />
<ClCompile Include="wfext.c" />
<ClCompile Include="wffile.c" />
<ClCompile Include="wfgoto.cpp" />
<ClCompile Include="wfinfo.c" />
<ClCompile Include="wfinit.c" />
<ClCompile Include="wfmem.c" />
<ClCompile Include="wfprint.c" />
<ClCompile Include="wfsearch.c" />
<ClCompile Include="wftree.c" />
<ClCompile Include="wfutil.c" />
<ClCompile Include="winfile.c" />
<ClCompile Include="wnetcaps.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="dbg.h" />
<ClInclude Include="fmifs.h" />
<ClInclude Include="lfn.h" />
<ClInclude Include="BagOValues.h" />
<ClInclude Include="mpr.h" />
<ClInclude Include="numfmt.h" />
<ClInclude Include="spinlock.h" />
<ClInclude Include="suggest.h" />
<ClInclude Include="treectl.h" />
<ClInclude Include="wfcopy.h" />
<ClInclude Include="wfdlgs.h" />
<ClInclude Include="wfdocb.h" />
<ClInclude Include="wfdrop.h" />
<ClInclude Include="wfext.h" />
<ClInclude Include="wfexti.h" />
<ClInclude Include="wfgwl.h" />
<ClInclude Include="wfhelp.h" />
<ClInclude Include="wfinfo.h" />
<ClInclude Include="wfmem.h" />
<ClInclude Include="winexp.h" />
<ClInclude Include="winfile.h" />
<ClInclude Include="wnetcaps.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res.rc" />
</ItemGroup>
<ItemGroup>
<None Include="lang\res_en-US.rc">
<Filter>lang</Filter>
</None>
<None Include="lang\res_zh-CN.rc">
<Filter>lang</Filter>
</None>
<None Include="lang\suggest_en-US.db">
<Filter>lang</Filter>
</None>
<None Include="lang\suggest_zh-CN.db">
<Filter>lang</Filter>
</None>
<None Include="lang\winfile_en-US.dlg">
<Filter>lang</Filter>
</None>
<None Include="lang\winfile_zh-CN.dlg">
<Filter>lang</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Filter Include="lang">
<UniqueIdentifier>{a74d83f3-58ec-46d3-bb3d-fadca6ac5743}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
Loading

0 comments on commit d793d5f

Please sign in to comment.