Use QCoreApplication to get path
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user