summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1514aaa)
This works only on UNIX. On other platforms, you probably should build-in the
icons anyway, or tell me if there are (standard locations for) icon themes at all...
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
- cmake_policy(SET CMP0005 NEW)
endif(COMMAND cmake_policy)
# Use our own (well, and KDE's) version of some modules
endif(COMMAND cmake_policy)
# Use our own (well, and KDE's) version of some modules
set(ICON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/icons)
set(XDG_APPS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications)
set(ICON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/icons)
set(XDG_APPS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications)
-add_definitions(-DPREFIX=${CMAKE_INSTALL_PREFIX})
-
# Enable various flags on gcc
if(CMAKE_COMPILER_IS_GNUCXX)
# Let's just hope that all gccs support these options and skip the tests...
# Enable various flags on gcc
if(CMAKE_COMPILER_IS_GNUCXX)
# Let's just hope that all gccs support these options and skip the tests...
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
+#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QDebug>
#include <QDir>
#include <QFile>
_themedIconDirNames.clear();
_plainIconDirNames.clear();
QString path;
_themedIconDirNames.clear();
_plainIconDirNames.clear();
QString path;
- QStringList dataDirNames = QString(qgetenv("XDG_DATA_DIRS")).split(':');
+ QStringList dataDirNames = QString(qgetenv("XDG_DATA_DIRS")).split(':', QString::SkipEmptyParts);
+
+// Provide a fallback
+# ifdef Q_OS_UNIX
+ if(dataDirNames.isEmpty()) dataDirNames.append("/usr/share");
+ // on UNIX, we always check our install prefix
+ QString appDir = QCoreApplication::applicationDirPath();
+ int binpos = appDir.lastIndexOf("/bin");
+ if(binpos >= 0) {
+ appDir.replace(binpos, 4, "/share");
+ if(!dataDirNames.contains(appDir)) dataDirNames.append(appDir);
+ }
+# endif
// System theme in $data/icons/$theme
foreach(QString dir, dataDirNames) {
// System theme in $data/icons/$theme
foreach(QString dir, dataDirNames) {