#ifndef WX_PRECOMP
#include "wx/string.h"
- #include "wx/icon.h"
+ #if wxUSE_GUI
+ #include "wx/icon.h"
+ #endif
#endif //WX_PRECOMP
// Doesn't compile in WIN16 mode
#ifdef __WXMSW__
#include "wx/msw/registry.h"
#include "windows.h"
-#elif defined(__UNIX__)
+#elif defined(__UNIX__) || defined(__WXPM__)
#include "wx/ffile.h"
#include "wx/textfile.h"
#include "wx/dir.h"
// other standard headers
#include <ctype.h>
+// in case we're compiling in non-GUI mode
+class WXDLLEXPORT wxIcon;
+
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
{
wxArrayString dirs;
dirs.Add(_T("/usr/share"));
- dirs.Add(wxGetHomeDir() + _T("/.gnome"));
+
+ wxString gnomedir;
+ wxGetHomeDir( &gnomedir );
+ gnomedir += _T("/.gnome");
+ dirs.Add( gnomedir );
size_t nDirs = dirs.GetCount();
for ( size_t nDir = 0; nDir < nDirs; nDir++ )
// KDE stores the icon info in its .kdelnk files. The file for mimetype/subtype
// 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
//
// The format of a .kdelnk file is almost the same as the one used by
void wxKDEIconHandler::Init()
{
wxArrayString dirs;
- dirs.Add(_T("/usr/share"));
+
+ // the variable KDEDIR is set when KDE is running
+ const char *kdedir = getenv("KDEDIR");
+ if ( 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();