-
Notifications
You must be signed in to change notification settings - Fork 0
/
nadoinit.cpp
executable file
·83 lines (70 loc) · 2.46 KB
/
nadoinit.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "nadoinit.h"
void nadoinit::run()
{
isinit = false;
QStringList dirFilter;
QString dirsIt;
#if !defined Q_OS_WIN
dirFilter << "notantiq.qhc" << "hyph_de_DE.dic" << "*.natemplate" << "lualatex" << "gregorio" << "lilypond-book";
#endif
#if defined Q_OS_WIN | defined __MINGW32__
dirFilter << "notantiq.qhc" << "hyph_de_DE.dic" << "*.natemplate" << "lualatex.exe" << "gregorio.exe" << "lilypond-book.py";
#endif
if (!basePath.isEmpty())
dirsIt = basePath;
else {
#if !defined Q_OS_WIN
dirsIt = "/";
#endif
#if defined Q_OS_WIN | defined __MINGW32__
dirsIt = "C:/";
#endif
}
QDirIterator findPaths(dirsIt,dirFilter,QDir::Files,QDirIterator::Subdirectories);
while(findPaths.hasNext())
{
QString dirsSearched = findPaths.next();
QString currDir = findPaths.filePath();
emit pathHasChanged(currDir);
currentPath = tr("Current Directory: %1").arg(currDir);
if (dirsSearched.contains("hyph_de_DE.dic"))
{
dictFolder << findPaths.fileInfo().canonicalPath();
}
if (dirsSearched.contains("notantiq.qhc"))
{
helpFolder << findPaths.fileInfo().canonicalPath();
}
if (dirsSearched.contains("article.natemplate")) {
templateFolder << findPaths.fileInfo().canonicalPath();
}
#if !defined Q_OS_WIN
if (dirsSearched.contains("lualatex")) {
#endif
#if defined Q_OS_WIN | defined __MINGW32__
if (dirsSearched.contains("lualatex.exe")) {
#endif
LaTeX_Path << findPaths.fileInfo().canonicalPath();
}
#if !defined Q_OS_WIN
if (dirsSearched.contains("lilypond-book")) {
#endif
#if defined Q_OS_WIN | defined __MINGW32__
if (dirsSearched.contains("lilypond-book.py")) {
#endif
Lilypond_Path << findPaths.fileInfo().canonicalPath();
}
#if !defined Q_OS_WIN
if (dirsSearched.contains("gregorio")) {
#endif
#if defined Q_OS_WIN | defined __MINGW32__
if (dirsSearched.contains("gregorio.exe")) {
#endif
Gregorio_Path << findPaths.fileInfo().canonicalPath();
}
}
}
void nadoinit::setValues(QString path)
{
basePath = path;
}