Add missing qt patch for relative paths
[gpg4win.git] / patches / qtbase-5.5.1 / relative-paths.patch
1 #! /bin/sh
2 patch -p1 -f -l $* < $0
3 exit $?
4
5 Patch kindly provided by KDE Windows emerge. To
6 look for files relative to the install location.
7
8 diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp
9 index 5e56db3..4d46430 100644
10 --- a/src/corelib/io/qstandardpaths_win.cpp
11 +++ b/src/corelib/io/qstandardpaths_win.cpp
12 @@ -214,6 +214,16 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
13                      dirs.append(QCoreApplication::applicationDirPath());
14                      dirs.append(QCoreApplication::applicationDirPath() + QLatin1String("/data"));
15                  }
16 +                dirs.append(QCoreApplication::applicationDirPath() + QLatin1String("/../share"));
17 +                if (type != GenericDataLocation && type != GenericConfigLocation) {
18 +                    QString appData = QCoreApplication::applicationDirPath() + QLatin1String("/../share");
19 +                    if (!QCoreApplication::organizationName().isEmpty())
20 +                        appData += QLatin1Char('/') + QCoreApplication::organizationName();
21 +                    if (!QCoreApplication::applicationName().isEmpty())
22 +                        appData += QLatin1Char('/') + QCoreApplication::applicationName();
23 +                                       dirs.append(appData);
24 +                               }
25 +                dirs.append(QCoreApplication::applicationDirPath() + QLatin1String("/../etc/xdg"));
26  #endif
27              }
28              break;
29 diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
30 index 06491f1..ef9436f 100644
31 --- a/src/gui/image/qiconloader.cpp
32 +++ b/src/gui/image/qiconloader.cpp
33 @@ -157,6 +157,7 @@ QStringList QIconLoader::themeSearchPaths() const
34  {
35      if (m_iconDirs.isEmpty()) {
36          m_iconDirs = systemIconSearchPaths();
37 +        m_iconDirs.append(QCoreApplication::applicationDirPath() + QLatin1String("/../share/icons"));
38          // Always add resource directory as search path
39          m_iconDirs.append(QLatin1String(":/icons"));
40      }
41 diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
42 index 66735d8..5731560 100644
43 --- a/src/plugins/platforms/windows/qwindowstheme.cpp
44 +++ b/src/plugins/platforms/windows/qwindowstheme.cpp
45 @@ -321,6 +321,8 @@ static inline QStringList iconThemeSearchPaths()
46  static inline QStringList styleNames()
47  {
48      QStringList result;
49 +    result.append(QStringLiteral("breeze"));
50 +    result.append(QStringLiteral("oxygen"));
51      if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA)
52          result.append(QStringLiteral("WindowsVista"));
53      if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP)
54 @@ -382,6 +384,10 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const
55          return QVariant(booleanSystemParametersInfo(SPI_GETSNAPTODEFBUTTON, false));
56      case ContextMenuOnMouseRelease:
57          return QVariant(true);
58 +    case QPlatformTheme::SystemIconThemeName:
59 +         return QVariant(QLatin1String("breeze"));
60 +    case QPlatformTheme::SystemIconFallbackThemeName:
61 +        return QVariant(QLatin1String("oxygen"));
62      default:
63          break;
64      }