Commit Graph

42 Commits

Author SHA1 Message Date
Vadim Zeitlin
3ad54f2852 Iterate over wxTextFile without using indices
Using iterator methods is less error-prone (there is no danger of using an
invalid index) and slightly shorter and more clear too.
2017-03-09 18:06:33 +01:00
Vadim Zeitlin
058f8c3c0f Use wxFileName instead of manipulating strings directly
Prefer to use wxFileName ctor to string concatenation.
2017-03-09 18:04:44 +01:00
Vadim Zeitlin
214aac6fd6 Avoid calling wxGetenv() twice unnecessarily
Use wxGetEnv() helper function which allows to write the code in more natural
and (slightly) more efficient way.

No real changes.
2017-03-09 18:02:14 +01:00
Vadim Zeitlin
41fe019f3b Refactor: extract GetXDGConfigHome() into a separate function
No real changes, just avoid doing the same thing in 2 different places and do
it in a single helper function instead.
2017-03-09 18:00:29 +01:00
Vadim Zeitlin
a44b61e976 Revert incompatible change to Unix wxStandardPaths::GetUserDir()
There is no reason to break the behaviour of the existing code, which doesn't
call SetFileLayout(FileLayout_XDG), by not returning the correct directories
from GetUserDir(Dir_Downloads) and similar any longer.
2017-03-09 17:56:45 +01:00
Vadim Zeitlin
5cf9fcbb1a Add wxStandardPaths::ConfigFileConv enum for clarity and safety
Use an enum instead of type-unsafe "int" for the second parameter of the
recently added wxStandardPaths::MakeConfigFileName().

This also avoids unnatural dependency of wxStandardPaths on
wxCONFIG_USE_SUBDIR constant defined in a higher level wxFileConfig class.

No real changes, but just make things a bit more robust and hopefully more
clear.
2017-03-09 17:53:14 +01:00
Vadim Zeitlin
4bf6ae8d7c Make FileLayout_XXX elements of an enum
Slight improvement to the previous commit: make FileLayout_Classic and
FileLayout_XDG elements of an enum instead of using an untyped "int" for them
which didn't really make any sense because these values are not bit masks but
exclusive choices for the layout.

Also rewrite the checks for them to use "switch" instead of "if" to be warned
by the compiler if we ever add another enum value but forget to update the
code to handle it.

Finally, improve the documentation (add missing "@since") and comments.
2017-03-09 17:23:20 +01:00
Martin Koegler
d56d127d3f Implement XDG file layout 2017-03-08 22:30:21 +01:00
Martin Koegler
8d5d00db9d Implement MakeConfigFileName 2017-03-08 22:29:55 +01:00
VZ
4212202a9a Add support for cache directory to wxStandardPaths::GetUserDir()
This has direct equivalent under macOS and when using XDG.

See #17727.
2016-11-29 19:32:14 +01:00
Tobias Taschner
a0fb808087 Add wxStandardPaths::GetUserDir() to get Desktop, Download etc
All major supported platforms have well defined per-user directories to store
Downloads, Music, Pictures, Videos and the Desktop files. The new method
wxStandardPaths::GetUserDir() allows for a unified way to access these on MSW,
OS X and Unix (if XDG user dirs specification is implemented for the latter).

See https://github.com/wxWidgets/wxWidgets/pull/89
2015-10-04 01:05:23 +02:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Paul Cornett
784d9056f4 sizeof(char) is 1. By definition.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 03:08:33 +00:00
Dimitri Schoolwerth
80fdcdb90e No changes, synchronised source names that appear commented at the top of files with the actual path to the files.
Fixed commented names (path, filename, and extension) of files in include/ and src/. Prepended the names in src/ with "src/" everywhere, while starting those in include/wx/ with "wx/".

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-20 00:14:35 +00:00
Vadim Zeitlin
526954c596 Globally use "wxWindows licence" consistently.
Use "wxWindows licence" and not "wxWidgets licence" (the latter doesn't
exist) and consistently spell "licence" using British spelling.

See #12165.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-13 13:29:13 +00:00
Vadim Zeitlin
3781248c7d Compilation fix for STL build.
Don't rely on implicit conversion of wxString to char* in
wxStandardPaths::GetDataDir() added in r62337.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-10 18:28:34 +00:00
Vadim Zeitlin
f3d793069f Compilation fix for PCH-less compilation.
To use wxTheApp (added in r62337) we need to include wx/app.h.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-09 13:05:32 +00:00
Vadim Zeitlin
306a5d9515 Add a WX_APPNAME_DATA_DIR hack for wxStandardPaths::GetDataDir().
Applications using wxStandardPaths::GetDataDir() to find their files under
Unix can't be ran without being installed as they look for their data files
under $prefix/share/appname. Make it possible to override this location by
setting WX_APPNAME_DATA_DIR environment variable to allow running them without
installation.

Notice that this shouldn't present any security risk unless the application is
SUID (which would be a very bad idea anyhow).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-08 22:38:03 +00:00
Vadim Zeitlin
9a83f86094 Globally replace _T() with wxT().
Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-23 20:30:22 +00:00
Vadim Zeitlin
5c33522fca replace wx_{const,static,reinterpret}_cast with their standard C++ equivalents
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-02 02:39:52 +00:00
Vadim Zeitlin
f95abb9d3d blind fix for PCH-less build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-29 22:11:52 +00:00
Julian Smart
0ce52f3d4e Try standard XDG location for documents directory
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-08 13:52:39 +00:00
Vadim Zeitlin
2b147f2e19 allow to optionally use vendor name component in standard paths (slightly modified patch 1831308)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-17 14:59:13 +00:00
Václav Slavík
e0b3b9d044 take wxString, not wxChar* in wxStandardPaths::GetLocalizedResourcesDir
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-23 19:10:36 +00:00
Jouk Jansen
b29aaf4a77 Solves 2 problems I encounterd on OpenVMS :
stdpaths.cpp : missing rourtine in VMS part
     bitmap.cpp : type casts WXPixmap changed to Pixmap

 Modified Files:
 	wxWidgets/src/unix/stdpaths.cpp wxWidgets/src/x11/bitmap.cpp


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43443 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-11-16 13:31:40 +00:00
Robert Roebling
ac7ad70d4c [ 1590221 ] wxStandardPaths::GetExecutablePath
Required for optimised stackwalker patch.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43340 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-11-12 12:58:10 +00:00
Paul Cornett
ab9f9e7136 non-pch build fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-23 00:50:52 +00:00
Vadim Zeitlin
3abcfa9b7f make install location autodetection work for executables compressed with (latest version of) UPX under Linux (patch 1565357)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-22 14:19:50 +00:00
Vadim Zeitlin
3af9f2de59 added wxStandardPaths::GetResourcesDir() and GetLocalizedResourcesDir()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-25 17:00:40 +00:00
Vadim Zeitlin
cc4d990340 implemented GetPluginsDir() to behave as documented
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38369 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-25 14:50:31 +00:00
Vadim Zeitlin
d3b9c6271b use one #ifdef __VMS instead of doing it in each and every function
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-25 14:47:44 +00:00
Vadim Zeitlin
4907027102 removed wxMac stuff from here, unless I'm missing something this file is not used under Mac at all
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38367 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-25 14:42:05 +00:00
Vadim Zeitlin
300ff33dec don't crash in GetInstallPrefix() if wxTheApp == NULL (especially as we don't need it anyhow)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-25 14:34:27 +00:00
Julian Smart
789e2d57b8 Use ~/Application Support folder on Mac
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-12-08 21:49:52 +00:00
Vadim Zeitlin
d5437b854c fixed broken code using readlink(): please don't just cast wxChar * to char *, this doesn't risk to ever work
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-12-04 13:01:50 +00:00
David Surovell
ca7d651d5d fixed compilation bug in prior checkin (Pt. 2)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-12-04 05:00:26 +00:00
David Surovell
9238471679 fixed compilation bug in prior checkin
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36338 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-12-04 01:04:02 +00:00
David Surovell
74ebd40690 fix for bug 1371386, with some minor mods and cleanup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-12-03 21:17:17 +00:00
Jouk Jansen
a98ce49a41 Committing in .
OPenVMS updates

 Modified Files:
 	wxWidgets/setup.h_vms wxWidgets/src/unix/stdpaths.cpp
 ----------------------------------------------------------------------


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-03-11 09:33:29 +00:00
Vadim Zeitlin
07158944d8 added wxUSE_STDPATHS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-03-07 22:37:58 +00:00
Vadim Zeitlin
c39e759922 Unicode compilation fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-10-22 00:23:35 +00:00
Vadim Zeitlin
c320b3e32d initial Unix implementation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-10-20 00:35:26 +00:00