use KDEDIR in wxKDEIconHandler
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
8c264b23ad
commit
509a619604
@ -1385,7 +1385,7 @@ bool wxGNOMEIconHandler::GetIcon(const wxString& mimetype, wxIcon *icon)
|
|||||||
// KDE stores the icon info in its .kdelnk files. The file for mimetype/subtype
|
// KDE stores the icon info in its .kdelnk files. The file for mimetype/subtype
|
||||||
// may be found in either of the following locations
|
// may be found in either of the following locations
|
||||||
//
|
//
|
||||||
// 1. /usr/share/mimelnk/mimetype/subtype.kdelnk
|
// 1. $KDEDIR/share/mimelnk/mimetype/subtype.kdelnk
|
||||||
// 2. ~/.kde/share/mimelnk/mimetype/subtype.kdelnk
|
// 2. ~/.kde/share/mimelnk/mimetype/subtype.kdelnk
|
||||||
//
|
//
|
||||||
// The format of a .kdelnk file is almost the same as the one used by
|
// The format of a .kdelnk file is almost the same as the one used by
|
||||||
@ -1498,12 +1498,21 @@ void wxKDEIconHandler::LoadLinkFilesFromDir(const wxString& dirbase)
|
|||||||
void wxKDEIconHandler::Init()
|
void wxKDEIconHandler::Init()
|
||||||
{
|
{
|
||||||
wxArrayString dirs;
|
wxArrayString dirs;
|
||||||
dirs.Add(_T("/usr/share"));
|
|
||||||
|
// the variable KDEDIR is set when KDE is running
|
||||||
wxString kdedir;
|
const char *kdedir = getenv("KDEDIR");
|
||||||
wxGetHomeDir( &kdedir );
|
if ( kdedir )
|
||||||
kdedir += _T("/.kde/share");
|
{
|
||||||
dirs.Add( kdedir );
|
dirs.Add(wxString(kdedir) + _T("/share"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// try to guess KDEDIR
|
||||||
|
dirs.Add(_T("/usr/share"));
|
||||||
|
dirs.Add(_T("/opt/kde/share"));
|
||||||
|
}
|
||||||
|
|
||||||
|
dirs.Add(wxGetHomeDir() + _T("/.kde/share"));
|
||||||
|
|
||||||
size_t nDirs = dirs.GetCount();
|
size_t nDirs = dirs.GetCount();
|
||||||
for ( size_t nDir = 0; nDir < nDirs; nDir++ )
|
for ( size_t nDir = 0; nDir < nDirs; nDir++ )
|
||||||
|
Loading…
Reference in New Issue
Block a user