27
27
#include < stdarg.h>
28
28
#include < errno.h>
29
29
30
- #include < qfileinfo.h>
31
30
#include < qdir.h>
32
31
33
32
#include < thread>
41
40
42
41
#include " lang_cfg.h"
43
42
#include " configoptions.h"
43
+ #include " fileinfo.h"
44
44
45
45
#define YY_NO_INPUT 1
46
46
#define YY_NO_UNISTD_H 1
@@ -766,7 +766,7 @@ static void processList()
766
766
static FILE *tryPath (const char *path,const char *fileName)
767
767
{
768
768
QCString absName=(path ? (QCString)path+" /" +fileName : (QCString)fileName);
769
- QFileInfo fi (absName);
769
+ FileInfo fi (absName. str () );
770
770
if (fi.exists () && fi.isFile ())
771
771
{
772
772
FILE *f=Portable::fopen (absName," r" );
@@ -1327,7 +1327,7 @@ static QCString configFileToString(const char *name)
1327
1327
}
1328
1328
else // read from file
1329
1329
{
1330
- QFileInfo fi (name);
1330
+ FileInfo fi (name);
1331
1331
if (!fi.exists () || !fi.isFile ())
1332
1332
{
1333
1333
config_err (" file '%s' not found\n " ,name);
@@ -1393,10 +1393,10 @@ static void cleanUpPaths(StringVector &str)
1393
1393
std::replace (path.begin (),path.end (),' \\ ' ,' /' );
1394
1394
if ((path[0 ]!=' /' && (path.size ()<=2 || path[1 ]!=' :' )) || path[path.size ()-1 ]!=' /' )
1395
1395
{
1396
- QFileInfo fi (path. c_str () );
1396
+ FileInfo fi (path);
1397
1397
if (fi.exists () && fi.isDir ())
1398
1398
{
1399
- path = fi.absFilePath (). utf8 (). str () ;
1399
+ path = fi.absFilePath ();
1400
1400
if (path[path.size ()-1 ]!=' /' ) path+=' /' ;
1401
1401
}
1402
1402
}
@@ -1551,7 +1551,7 @@ void Config::checkAndCorrect()
1551
1551
QCString headerFile = Config_getString (HTML_HEADER);
1552
1552
if (!headerFile.isEmpty ())
1553
1553
{
1554
- QFileInfo fi (headerFile);
1554
+ FileInfo fi (headerFile. str () );
1555
1555
if (!fi.exists ())
1556
1556
{
1557
1557
config_term (" tag HTML_HEADER: header file '%s' "
@@ -1564,7 +1564,7 @@ void Config::checkAndCorrect()
1564
1564
QCString footerFile = Config_getString (HTML_FOOTER);
1565
1565
if (!footerFile.isEmpty ())
1566
1566
{
1567
- QFileInfo fi (footerFile);
1567
+ FileInfo fi (footerFile. str () );
1568
1568
if (!fi.exists ())
1569
1569
{
1570
1570
config_term (" tag HTML_FOOTER: footer file '%s' "
@@ -1579,7 +1579,7 @@ void Config::checkAndCorrect()
1579
1579
QCString mathJaxCodefile = Config_getString (MATHJAX_CODEFILE);
1580
1580
if (!mathJaxCodefile.isEmpty ())
1581
1581
{
1582
- QFileInfo fi (mathJaxCodefile);
1582
+ FileInfo fi (mathJaxCodefile. str () );
1583
1583
if (!fi.exists ())
1584
1584
{
1585
1585
config_term (" tag MATHJAX_CODEFILE file '%s' "
@@ -1599,7 +1599,7 @@ void Config::checkAndCorrect()
1599
1599
QCString latexHeaderFile = Config_getString (LATEX_HEADER);
1600
1600
if (!latexHeaderFile.isEmpty ())
1601
1601
{
1602
- QFileInfo fi (latexHeaderFile);
1602
+ FileInfo fi (latexHeaderFile. str () );
1603
1603
if (!fi.exists ())
1604
1604
{
1605
1605
config_term (" tag LATEX_HEADER: header file '%s' "
@@ -1612,7 +1612,7 @@ void Config::checkAndCorrect()
1612
1612
QCString latexFooterFile = Config_getString (LATEX_FOOTER);
1613
1613
if (!latexFooterFile.isEmpty ())
1614
1614
{
1615
- QFileInfo fi (latexFooterFile);
1615
+ FileInfo fi (latexFooterFile. str () );
1616
1616
if (!fi.exists ())
1617
1617
{
1618
1618
config_term (" tag LATEX_FOOTER: footer file '%s' "
@@ -1625,7 +1625,7 @@ void Config::checkAndCorrect()
1625
1625
const StringVector &includePath = Config_getList (INCLUDE_PATH);
1626
1626
for (const auto &s : includePath)
1627
1627
{
1628
- QFileInfo fi (s. c_str () );
1628
+ FileInfo fi (s);
1629
1629
if (!fi.exists ()) warn_uncond (" tag INCLUDE_PATH: include path '%s' "
1630
1630
" does not exist\n " ,s.c_str ());
1631
1631
}
@@ -1774,22 +1774,23 @@ void Config::checkAndCorrect()
1774
1774
QCString dotPath = Config_getString (DOT_PATH);
1775
1775
if (!dotPath.isEmpty ())
1776
1776
{
1777
- QFileInfo fi (dotPath);
1777
+ FileInfo fi (dotPath. str () );
1778
1778
if (fi.exists () && fi.isFile ()) // user specified path + exec
1779
1779
{
1780
- dotPath=fi.dirPath (TRUE ). utf8 () +" /" ;
1780
+ dotPath=fi.dirPath (TRUE )+" /" ;
1781
1781
}
1782
1782
else
1783
1783
{
1784
- QFileInfo dp (dotPath+" /dot" +Portable::commandExtension ());
1784
+ QCString dotExe = dotPath+" /dot" +Portable::commandExtension ();
1785
+ FileInfo dp (dotExe.str ());
1785
1786
if (!dp.exists () || !dp.isFile ())
1786
1787
{
1787
1788
warn_uncond (" the dot tool could not be found at %s\n " ,dotPath.data ());
1788
1789
dotPath=" " ;
1789
1790
}
1790
1791
else
1791
1792
{
1792
- dotPath=dp.dirPath (TRUE ). utf8 () +" /" ;
1793
+ dotPath=dp.dirPath (TRUE )+" /" ;
1793
1794
}
1794
1795
}
1795
1796
#if defined(_WIN32) // convert slashes
@@ -1808,13 +1809,14 @@ void Config::checkAndCorrect()
1808
1809
QCString plantumlJarPath = Config_getString (PLANTUML_JAR_PATH);
1809
1810
if (!plantumlJarPath.isEmpty ())
1810
1811
{
1811
- QFileInfo pu (plantumlJarPath);
1812
+ FileInfo pu (plantumlJarPath. str () );
1812
1813
if (pu.exists () && pu.isDir ()) // PLANTUML_JAR_PATH is directory
1813
1814
{
1814
- QFileInfo jar (plantumlJarPath+Portable::pathSeparator ()+" plantuml.jar" );
1815
+ QCString plantumlJar = plantumlJarPath+Portable::pathSeparator ()+" plantuml.jar" ;
1816
+ FileInfo jar (plantumlJar.str ());
1815
1817
if (jar.exists () && jar.isFile ())
1816
1818
{
1817
- plantumlJarPath = jar.dirPath (TRUE ). utf8 () +Portable::pathSeparator ();
1819
+ plantumlJarPath = jar.dirPath (TRUE )+Portable::pathSeparator ();
1818
1820
}
1819
1821
else
1820
1822
{
@@ -1825,7 +1827,7 @@ void Config::checkAndCorrect()
1825
1827
}
1826
1828
else if (pu.exists () && pu.isFile () && plantumlJarPath.right (4 )==" .jar" ) // PLANTUML_JAR_PATH is file
1827
1829
{
1828
- plantumlJarPath = pu.dirPath (TRUE ). utf8 () +Portable::pathSeparator ();
1830
+ plantumlJarPath = pu.dirPath (TRUE )+Portable::pathSeparator ();
1829
1831
}
1830
1832
else
1831
1833
{
@@ -1841,15 +1843,16 @@ void Config::checkAndCorrect()
1841
1843
QCString diaPath = Config_getString (DIA_PATH);
1842
1844
if (!diaPath.isEmpty ())
1843
1845
{
1844
- QFileInfo dp (diaPath+" /dia" +Portable::commandExtension ());
1846
+ QCString diaExe = diaPath+" /dia" +Portable::commandExtension ();
1847
+ FileInfo dp (diaExe.str ());
1845
1848
if (!dp.exists () || !dp.isFile ())
1846
1849
{
1847
1850
warn_uncond (" dia could not be found at %s\n " ,diaPath.data ());
1848
1851
diaPath=" " ;
1849
1852
}
1850
1853
else
1851
1854
{
1852
- diaPath=dp.dirPath (TRUE ). utf8 () +" /" ;
1855
+ diaPath=dp.dirPath (TRUE )+" /" ;
1853
1856
#if defined(_WIN32) // convert slashes
1854
1857
uint i=0 ,l=diaPath.length ();
1855
1858
for (i=0 ;i<l;i++) if (diaPath.at (i)==' /' ) diaPath.at (i)=' \\ ' ;
@@ -1874,7 +1877,7 @@ void Config::checkAndCorrect()
1874
1877
{
1875
1878
for (const auto &s : inputSources)
1876
1879
{
1877
- QFileInfo fi (s.c_str ());
1880
+ FileInfo fi (s.c_str ());
1878
1881
if (!fi.exists ())
1879
1882
{
1880
1883
warn_uncond (" tag INPUT: input source '%s' does not exist\n " ,s.c_str ());
0 commit comments