Fix functions and macros using to support both Qt4 and Qt5.

This commit is contained in:
Vladimir Golovnev (Glassez)
2013-09-21 11:59:58 +04:00
committed by sledgehammer999
parent 763d8a392f
commit ce3aac5f9d
51 changed files with 260 additions and 181 deletions

View File

@@ -35,7 +35,7 @@ IconProvider* IconProvider::m_instance = 0;
IconProvider::IconProvider()
{
#if defined(Q_WS_X11)
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
m_useSystemTheme = Preferences().useSystemIconTheme();
#endif
}
@@ -57,7 +57,7 @@ void IconProvider::drop()
QIcon IconProvider::getIcon(const QString &iconId)
{
#if defined(Q_WS_X11)
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
if (m_useSystemTheme) {
QIcon icon = QIcon::fromTheme(iconId, QIcon(":/Icons/oxygen/"+iconId+".png"));
icon = generateDifferentSizes(icon);
@@ -67,7 +67,7 @@ QIcon IconProvider::getIcon(const QString &iconId)
return QIcon(":/Icons/oxygen/"+iconId+".png");
}
#if defined(Q_WS_X11)
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
void IconProvider::useSystemIconTheme(bool enable)
{
m_useSystemTheme = enable;
@@ -102,7 +102,7 @@ QIcon IconProvider::generateDifferentSizes(const QIcon& icon)
QString IconProvider::getIconPath(const QString& iconId)
{
#if defined(Q_WS_X11)
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
if (m_useSystemTheme) {
QString path = QDir::temp().absoluteFilePath(iconId+".png");
if (!QFile::exists(path)) {