tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
kdeApplications.grantleetheme: fix build
gnidorah
8 years ago
998f9578
3c80e17e
+71
-73
1 changed file
expand all
collapse all
unified
split
pkgs
applications
kde
grantleetheme
grantlee-merge-theme-dirs.patch
+71
-73
pkgs/applications/kde/grantleetheme/grantlee-merge-theme-dirs.patch
···
11
QString author;
12
QString email;
13
14
-
Index: grantleetheme-17.04.0/src/grantleetheme.cpp
15
===================================================================
16
-
--- grantleetheme-17.04.0.orig/src/grantleetheme.cpp
17
-
+++ grantleetheme-17.04.0/src/grantleetheme.cpp
18
-
@@ -45,7 +45,7 @@ ThemePrivate::ThemePrivate(const ThemePr
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
19
, description(other.description)
20
, name(other.name)
21
, dirName(other.dirName)
···
24
, author(other.author)
25
, email(other.email)
26
, loader(other.loader)
27
-
@@ -63,12 +63,15 @@ void ThemePrivate::setupEngine()
28
29
void ThemePrivate::setupLoader()
30
{
···
38
+ templateDirs << dir.absolutePath();
39
+ }
40
41
-
loader = QSharedPointer<Grantlee::FileSystemTemplateLoader>::create();
42
- loader->setTemplateDirs({ dir.absolutePath() });
43
+ loader->setTemplateDirs(templateDirs);
44
loader->setTheme(dirName);
45
46
if (!sEngine) {
47
-
@@ -122,7 +123,7 @@ Theme::Theme(const QString &themePath, c
48
KConfigGroup group(&config, QStringLiteral("Desktop Entry"));
49
if (group.isValid()) {
50
d->dirName = dirName;
···
53
d->name = group.readEntry("Name", QString());
54
d->description = group.readEntry("Description", QString());
55
d->themeFileName = group.readEntry("FileName", QString());
56
-
@@ -141,7 +142,7 @@ Theme::~Theme()
57
58
bool Theme::operator==(const Theme &other) const
59
{
···
62
}
63
64
Theme &Theme::operator=(const Theme &other)
65
-
@@ -185,7 +186,12 @@ QString Theme::dirName() const
66
67
QString Theme::absolutePath() const
68
{
···
76
}
77
78
QString Theme::author() const
79
-
@@ -224,6 +230,13 @@ QString Theme::render(const QString &tem
80
return result;
81
}
82
···
90
void Theme::addPluginPath(const QString &path)
91
{
92
if (!ThemePrivate::sEngine) {
93
-
Index: grantleetheme-17.04.0/src/grantleetheme.h
94
-
===================================================================
95
-
--- grantleetheme-17.04.0.orig/src/grantleetheme.h
96
-
+++ grantleetheme-17.04.0/src/grantleetheme.h
97
-
@@ -50,11 +50,14 @@ public:
98
-
QStringList displayExtraVariables() const;
99
-
QString dirName() const;
100
-
QString absolutePath() const;
101
-
+ QStringList absolutePaths() const;
102
-
QString author() const;
103
-
QString authorEmail() const;
104
-
105
-
QString render(const QString &templateName, const QVariantHash &data, const QByteArray &applicationDomain = QByteArray());
106
-
107
-
+ void addThemeDir(const QString&);
108
-
+
109
-
static void addPluginPath(const QString &path);
110
-
111
-
private:
112
-
Index: grantleetheme-17.04.0/src/grantleethememanager.cpp
113
-
===================================================================
114
-
--- grantleetheme-17.04.0.orig/src/grantleethememanager.cpp
115
-
+++ grantleetheme-17.04.0/src/grantleethememanager.cpp
116
-
@@ -142,25 +142,18 @@ public:
117
-
118
-
for (const QString &directory : qAsConst(themesDirectories)) {
119
-
QDirIterator dirIt(directory, QStringList(), QDir::AllDirs | QDir::NoDotAndDotDot);
120
-
- QStringList alreadyLoadedThemeName;
121
-
while (dirIt.hasNext()) {
122
-
dirIt.next();
123
-
const QString dirName = dirIt.fileName();
124
-
GrantleeTheme::Theme theme = q->loadTheme(dirIt.filePath(), dirName, defaultDesktopFileName);
125
-
if (theme.isValid()) {
126
-
QString themeName = theme.name();
127
-
- if (alreadyLoadedThemeName.contains(themeName)) {
128
-
- int i = 2;
129
-
- const QString originalName(theme.name());
130
-
- while (alreadyLoadedThemeName.contains(themeName)) {
131
-
- themeName = originalName + QStringLiteral(" (%1)").arg(i);
132
-
- ++i;
133
-
- }
134
-
- theme.d->name = themeName;
135
-
+ QMap<QString, GrantleeTheme::Theme>::iterator i = themes.find(dirName);
136
-
+ if (i != themes.end()) {
137
-
+ i.value().addThemeDir(dirIt.filePath());
138
-
+ } else {
139
-
+ themes.insert(dirName, theme);
140
-
}
141
-
- alreadyLoadedThemeName << themeName;
142
-
- themes.insert(dirName, theme);
143
-
- //qDebug()<<" theme.name()"<<theme.name();
144
-
}
145
-
}
146
-
watch->addDir(directory);
147
-
@@ -374,7 +367,7 @@ QString ThemeManager::pathFromThemes(con
148
-
GrantleeTheme::Theme theme = loadTheme(dirIt.filePath(), dirName, defaultDesktopFileName);
149
-
if (theme.isValid()) {
150
-
if (dirName == themeName) {
151
-
- return theme.absolutePath();
152
-
+ return theme.absolutePaths().first();
153
-
}
154
-
}
155
-
}
···
11
QString author;
12
QString email;
13
14
+
Index: grantleetheme-17.04.0/src/grantleetheme.h
15
===================================================================
16
+
--- grantleetheme-17.04.0.orig/src/grantleetheme.h
17
+
+++ grantleetheme-17.04.0/src/grantleetheme.h
18
+
@@ -50,11 +50,14 @@ public:
19
+
QStringList displayExtraVariables() const;
20
+
QString dirName() const;
21
+
QString absolutePath() const;
22
+
+ QStringList absolutePaths() const;
23
+
QString author() const;
24
+
QString authorEmail() const;
25
+
26
+
QString render(const QString &templateName, const QVariantHash &data, const QByteArray &applicationDomain = QByteArray());
27
+
28
+
+ void addThemeDir(const QString&);
29
+
+
30
+
static void addPluginPath(const QString &path);
31
+
32
+
private:
33
+
Index: grantleetheme-17.04.0/src/grantleethememanager.cpp
34
+
===================================================================
35
+
--- grantleetheme-17.04.0.orig/src/grantleethememanager.cpp
36
+
+++ grantleetheme-17.04.0/src/grantleethememanager.cpp
37
+
@@ -142,25 +142,18 @@ public:
38
+
39
+
for (const QString &directory : qAsConst(themesDirectories)) {
40
+
QDirIterator dirIt(directory, QStringList(), QDir::AllDirs | QDir::NoDotAndDotDot);
41
+
- QStringList alreadyLoadedThemeName;
42
+
while (dirIt.hasNext()) {
43
+
dirIt.next();
44
+
const QString dirName = dirIt.fileName();
45
+
GrantleeTheme::Theme theme = q->loadTheme(dirIt.filePath(), dirName, defaultDesktopFileName);
46
+
if (theme.isValid()) {
47
+
QString themeName = theme.name();
48
+
- if (alreadyLoadedThemeName.contains(themeName)) {
49
+
- int i = 2;
50
+
- const QString originalName(theme.name());
51
+
- while (alreadyLoadedThemeName.contains(themeName)) {
52
+
- themeName = originalName + QStringLiteral(" (%1)").arg(i);
53
+
- ++i;
54
+
- }
55
+
- theme.d->name = themeName;
56
+
+ QMap<QString, GrantleeTheme::Theme>::iterator i = themes.find(dirName);
57
+
+ if (i != themes.end()) {
58
+
+ i.value().addThemeDir(dirIt.filePath());
59
+
+ } else {
60
+
+ themes.insert(dirName, theme);
61
+
}
62
+
- alreadyLoadedThemeName << themeName;
63
+
- themes.insert(dirName, theme);
64
+
- //qDebug()<<" theme.name()"<<theme.name();
65
+
}
66
+
}
67
+
watch->addDir(directory);
68
+
@@ -374,7 +367,7 @@ QString ThemeManager::pathFromThemes(con
69
+
GrantleeTheme::Theme theme = loadTheme(dirIt.filePath(), dirName, defaultDesktopFileName);
70
+
if (theme.isValid()) {
71
+
if (dirName == themeName) {
72
+
- return theme.absolutePath();
73
+
+ return theme.absolutePaths().first();
74
+
}
75
+
}
76
+
}
77
+
--- src/grantleetheme.cpp.orig 2017-12-22 16:11:39.863598126 +0300
78
+
+++ ./src/grantleetheme.cpp 2017-12-22 16:16:14.045664607 +0300
79
+
@@ -46,7 +46,7 @@ ThemePrivate::ThemePrivate(const ThemePr
80
, description(other.description)
81
, name(other.name)
82
, dirName(other.dirName)
···
85
, author(other.author)
86
, email(other.email)
87
, loader(other.loader)
88
+
@@ -64,12 +64,15 @@ void ThemePrivate::setupEngine()
89
90
void ThemePrivate::setupLoader()
91
{
···
99
+ templateDirs << dir.absolutePath();
100
+ }
101
102
+
loader = QSharedPointer<GrantleeTheme::QtResourceTemplateLoader>::create();
103
- loader->setTemplateDirs({ dir.absolutePath() });
104
+ loader->setTemplateDirs(templateDirs);
105
loader->setTheme(dirName);
106
107
if (!sEngine) {
108
+
@@ -121,7 +124,7 @@ Theme::Theme(const QString &themePath, c
109
KConfigGroup group(&config, QStringLiteral("Desktop Entry"));
110
if (group.isValid()) {
111
d->dirName = dirName;
···
114
d->name = group.readEntry("Name", QString());
115
d->description = group.readEntry("Description", QString());
116
d->themeFileName = group.readEntry("FileName", QString());
117
+
@@ -140,7 +143,7 @@ Theme::~Theme()
118
119
bool Theme::operator==(const Theme &other) const
120
{
···
123
}
124
125
Theme &Theme::operator=(const Theme &other)
126
+
@@ -184,7 +187,12 @@ QString Theme::dirName() const
127
128
QString Theme::absolutePath() const
129
{
···
137
}
138
139
QString Theme::author() const
140
+
@@ -223,6 +231,13 @@ QString Theme::render(const QString &tem
141
return result;
142
}
143
···
151
void Theme::addPluginPath(const QString &path)
152
{
153
if (!ThemePrivate::sEngine) {
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0