Use QCoreApplication to get path

This commit is contained in:
Aditya Kulkarni
2018-11-21 09:54:58 -08:00
parent 3167fb97d4
commit 9776987971
3 changed files with 5 additions and 9 deletions

View File

@@ -279,16 +279,16 @@ bool ConnectionLoader::startEmbeddedZcashd() {
}
// Finally, start zcashd
QFileInfo fi(Settings::getInstance()->getExecName());
QDir appPath(QCoreApplication::applicationDirPath());
#ifdef Q_OS_LINUX
auto zcashdProgram = fi.dir().absoluteFilePath("zqw-zcashd");
auto zcashdProgram = appPath.absoluteFilePath("zqw-zcashd");
if (!QFile(zcashdProgram).exists()) {
zcashdProgram = fi.dir().absoluteFilePath("zcashd");
zcashdProgram = appPath.absoluteFilePath("zcashd");
}
#elif defined(Q_OS_DARWIN)
auto zcashdProgram = fi.dir().absoluteFilePath("zcashd");
auto zcashdProgram = appPath.absoluteFilePath("zcashd");
#else
auto zcashdProgram = fi.dir().absoluteFilePath("zcashd.exe");
auto zcashdProgram = appPath.absoluteFilePath("zcashd.exe");
#endif
if (!QFile(zcashdProgram).exists()) {

View File

@@ -31,7 +31,6 @@ int main(int argc, char *argv[])
Settings::init();
Settings::getInstance()->setExecName(argv[0]);
if (argc >= 2 && QString::fromStdString(argv[1]) == "--no-embedded") {
Settings::getInstance()->setUseEmbedded(false);

View File

@@ -32,9 +32,6 @@ public:
bool isSyncing();
void setSyncing(bool syncing);
QString getExecName() { return _executable; }
void setExecName(QString name) { _executable = name; }
void setUseEmbedded(bool r) { _useEmbedded = r; }
bool useEmbedded() { return _useEmbedded; }