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