Commit 14d49a6b authored by Robert Lancaster's avatar Robert Lancaster Committed by Jasem Mutlaq

This patch should address the path issue for your new port finding algorithm. ...

This patch should address the path issue for your new port finding algorithm.  I also reversed the order of the items in the path so it looks for programs in the app first.  Then I noticed that an algorithm I had used to get the path for the directory the indiserver is located in was out of date in several places.  I had come up with a better algorithm about a month ago.  So I updated that too.
parent e5e46676
......@@ -81,10 +81,10 @@ bool ServerManager::start()
QString indiServerDir=Options::indiServer();
if(Options::indiServerIsInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
else
indiServerDir=QFileInfo(Options::indiServer()).dir().path();
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("PATH", "/usr/local/bin:/usr/bin:" + driversDir + ":" + indiServerDir);
env.insert("PATH", driversDir + ":" + indiServerDir + ":/usr/local/bin:/usr/bin:/bin");
QString gscDirPath=KSPaths::writableLocation(QStandardPaths::GenericDataLocation) + "gsc";
env.insert("GSCDAT", gscDirPath);
serverProcess->setProcessEnvironment(env);
......@@ -180,8 +180,8 @@ bool ServerManager::startDriver(DriverInfo *dv)
driversDir=QCoreApplication::applicationDirPath()+"/indi";
if(Options::indiDriversAreInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
else
indiServerDir=QFileInfo(Options::indiServer()).dir().path();
#endif
QStringList paths;
......
......@@ -588,8 +588,8 @@ void KStars::slotTelescopeWizard()
#ifdef Q_OS_OSX
if(Options::indiServerIsInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
else
indiServerDir=QFileInfo(Options::indiServer()).dir().path();
#endif
QStringList paths;
......@@ -620,8 +620,8 @@ void KStars::slotINDIPanel()
#ifdef Q_OS_OSX
if(Options::indiServerIsInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
else
indiServerDir=QFileInfo(Options::indiServer()).dir().path();
#endif
QStringList paths;
......@@ -649,8 +649,8 @@ void KStars::slotINDIDriver()
#ifdef Q_OS_OSX
if(Options::indiServerIsInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
else
indiServerDir=QFileInfo(Options::indiServer()).dir().path();
#endif
QStringList paths;
......@@ -684,8 +684,8 @@ void KStars::slotEkos()
#ifdef Q_OS_OSX
if(Options::indiServerIsInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
else
indiServerDir=QFileInfo(Options::indiServer()).dir().path();
#endif
QStringList paths;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment