mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Replaced hardcoded resurces paths
Resources paths at $prefix/share/qucs/ are defined now via QUCS_NAME marcro from config.h
This commit is contained in:
parent
eba11e32ea
commit
5bb55b9562
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
|
||||
QucsDir = QDir (var);
|
||||
QString QucsDirStr = QucsDir.canonicalPath ();
|
||||
LangDir =
|
||||
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
|
||||
QDir::convertSeparators (QucsDirStr + "/share/" QUCS_NAME "/lang/");
|
||||
} else {
|
||||
QString QucsApplicationPath = QCoreApplication::applicationDirPath();
|
||||
#ifdef __APPLE__
|
||||
|
@ -76,7 +76,7 @@ int main( int argc, char ** argv )
|
||||
QucsDir = QDir (var);
|
||||
QString QucsDirStr = QucsDir.canonicalPath ();
|
||||
QucsSettings.LangDir =
|
||||
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
|
||||
QDir::convertSeparators (QucsDirStr + "/share/" QUCS_NAME "/lang/");
|
||||
} else {
|
||||
QString QucsApplicationPath = QCoreApplication::applicationDirPath();
|
||||
#ifdef __APPLE__
|
||||
|
@ -104,7 +104,7 @@ int main(int argc, char *argv[])
|
||||
QucsDir = QDir (var);
|
||||
QString QucsDirStr = QucsDir.canonicalPath ();
|
||||
QucsSettings.LangDir =
|
||||
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
|
||||
QDir::convertSeparators (QucsDirStr + "/share/" QUCS_NAME "/lang/");
|
||||
} else {
|
||||
QString QucsApplicationPath = QCoreApplication::applicationDirPath();
|
||||
#ifdef __APPLE__
|
||||
|
@ -89,7 +89,7 @@ int main(int argc, char *argv[])
|
||||
QucsDir = QDir (var);
|
||||
QString QucsDirStr = QucsDir.canonicalPath ();
|
||||
QucsSettings.LangDir =
|
||||
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
|
||||
QDir::convertSeparators (QucsDirStr + "/share/" QUCS_NAME "/lang/");
|
||||
} else {
|
||||
QString QucsApplicationPath = QCoreApplication::applicationDirPath();
|
||||
#ifdef __APPLE__
|
||||
|
@ -138,9 +138,9 @@ int main(int argc, char *argv[])
|
||||
QucsDir = QDir (QString(var));
|
||||
QString QucsDirStr = QucsDir.canonicalPath ();
|
||||
QucsSettings.DocDir =
|
||||
QDir::convertSeparators (QucsDirStr + "/share/qucs/docs/");
|
||||
QDir::convertSeparators (QucsDirStr + "/share/" QUCS_NAME "/docs/");
|
||||
QucsSettings.LangDir =
|
||||
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
|
||||
QDir::convertSeparators (QucsDirStr + "/share/" QUCS_NAME "/lang/");
|
||||
} else {
|
||||
QString QucsApplicationPath = QCoreApplication::applicationDirPath();
|
||||
#ifdef __APPLE__
|
||||
|
@ -100,8 +100,8 @@ int main(int argc, char *argv[])
|
||||
QDir QucsDir;
|
||||
if (var != NULL) {
|
||||
QucsDir = QDir(QString(var));
|
||||
QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/";
|
||||
QucsSettings.LibDir = QucsDir.canonicalPath() + "/share/qucs/library/";
|
||||
QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/" QUCS_NAME "/lang/";
|
||||
QucsSettings.LibDir = QucsDir.canonicalPath() + "/share/" QUCS_NAME "/library/";
|
||||
} else {
|
||||
QString QucsApplicationPath = QCoreApplication::applicationDirPath();
|
||||
#ifdef __APPLE__
|
||||
|
@ -116,7 +116,7 @@ int main(int argc, char *argv[])
|
||||
QucsDir = QDir (var);
|
||||
QString QucsDirStr = QucsDir.canonicalPath ();
|
||||
QucsSettings.LangDir =
|
||||
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
|
||||
QDir::convertSeparators (QucsDirStr + "/share/" QUCS_NAME "/lang/");
|
||||
} else {
|
||||
QString QucsApplicationPath = QCoreApplication::applicationDirPath();
|
||||
#ifdef __APPLE__
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "spicecomponents/xsp_cmlib.h"
|
||||
#include "main.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
XSPICE_CMbuilder::XSPICE_CMbuilder(Schematic *sch_)
|
||||
{
|
||||
workdir = QucsSettings.S4Qworkdir;
|
||||
@ -151,9 +155,9 @@ void XSPICE_CMbuilder::createCModelTree(QString &output)
|
||||
if (mkfile.open(QIODevice::WriteOnly)) {
|
||||
QTextStream stream(&mkfile);
|
||||
#ifdef __MINGW32__
|
||||
QString rules_file = QucsSettings.BinDir+"../share/qucs/xspice_cmlib/cmlib.mingw32.rules.mk";
|
||||
QString rules_file = QucsSettings.BinDir+"../share/" QUCS_NAME "/xspice_cmlib/cmlib.mingw32.rules.mk";
|
||||
#else
|
||||
QString rules_file = QucsSettings.BinDir+"../share/qucs/xspice_cmlib/cmlib.linux.rules.mk";
|
||||
QString rules_file = QucsSettings.BinDir+"../share/" QUCS_NAME "/xspice_cmlib/cmlib.linux.rules.mk";
|
||||
#endif
|
||||
QFileInfo inf(rules_file);
|
||||
if (!inf.exists())
|
||||
|
@ -777,17 +777,16 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
QucsSettings.BinDir = QucsDir.absolutePath() + "/bin/";
|
||||
QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/";
|
||||
QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/" QUCS_NAME "/lang/";
|
||||
var = getenv("QUCS_LIBDIR");
|
||||
if(var != NULL) {
|
||||
QucsSettings.LibDir = QString(var);
|
||||
}else{
|
||||
QucsSettings.LibDir = QucsDir.canonicalPath() + "/share/qucs/library/";
|
||||
QucsSettings.LibDir = QucsDir.canonicalPath() + "/share/" QUCS_NAME "/library/";
|
||||
}
|
||||
QucsSettings.OctaveDir = QucsDir.canonicalPath() + "/share/qucs/octave/";
|
||||
QucsSettings.ExamplesDir = QucsDir.canonicalPath() + "/share/qucs/docs/examples/";
|
||||
QucsSettings.DocDir = QucsDir.canonicalPath() + "/share/qucs/docs/";
|
||||
|
||||
QucsSettings.OctaveDir = QucsDir.canonicalPath() + "/share/" QUCS_NAME "/octave/";
|
||||
QucsSettings.ExamplesDir = QucsDir.canonicalPath() + "/share/" QUCS_NAME "/docs/examples/";
|
||||
QucsSettings.DocDir = QucsDir.canonicalPath() + "/share/" QUCS_NAME "/docs/";
|
||||
QucsSettings.Editor = "qucs";
|
||||
QucsSettings.QucsHomeDir.setPath(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs"));
|
||||
QucsSettings.QucsWorkDir.setPath(QucsSettings.QucsHomeDir.canonicalPath());
|
||||
|
@ -60,6 +60,10 @@
|
||||
#include "dialogs/aboutdialog.h"
|
||||
#include "module.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
// for editing component name on schematic
|
||||
QRegExp Expr_CompProp;
|
||||
QRegExpValidator Val_CompProp(Expr_CompProp, 0);
|
||||
@ -687,11 +691,11 @@ void QucsApp::editFile(const QString& File)
|
||||
if (QucsSettings.Editor.toLower().contains("qucsedit")) {
|
||||
|
||||
#ifdef __MINGW32__
|
||||
prog = "qucsedit.exe";
|
||||
prog = QUCS_NAME"edit.exe";
|
||||
#elif __APPLE__
|
||||
prog = "qucsedit.app/Contents/MacOS/qucsedit";
|
||||
#else
|
||||
prog = "qucsedit";
|
||||
prog = QUCS_NAME "edit";
|
||||
#endif
|
||||
|
||||
QFileInfo editor(QucsSettings.BinDir + prog);
|
||||
@ -752,26 +756,26 @@ void QucsApp::slotCallEditor()
|
||||
// Is called to start the filter synthesis program.
|
||||
void QucsApp::slotCallFilter()
|
||||
{
|
||||
launchTool("qucsfilter", "filter synthesis");
|
||||
launchTool(QUCS_NAME "filter", "filter synthesis");
|
||||
}
|
||||
|
||||
void QucsApp::slotCallActiveFilter()
|
||||
{
|
||||
launchTool("qucsactivefilter", "active filter synthesis");
|
||||
launchTool(QUCS_NAME "activefilter", "active filter synthesis");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Is called to start the transmission line calculation program.
|
||||
void QucsApp::slotCallLine()
|
||||
{
|
||||
launchTool("qucstrans", "line calculation");
|
||||
launchTool(QUCS_NAME "trans", "line calculation");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Is called to start the component library program.
|
||||
void QucsApp::slotCallLibrary()
|
||||
{
|
||||
launchTool("qucslib", "library");
|
||||
launchTool(QUCS_NAME "lib", "library");
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
@ -786,14 +790,14 @@ void QucsApp::slotCallMatch()
|
||||
// Is called to start the attenuator calculation program.
|
||||
void QucsApp::slotCallAtt()
|
||||
{
|
||||
launchTool("qucsattenuator", "attenuator calculation");
|
||||
launchTool(QUCS_NAME "attenuator", "attenuator calculation");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Is called to start the resistor color code calculation program.
|
||||
void QucsApp::slotCallRes()
|
||||
{
|
||||
launchTool("qucsrescodes", "resistor color code calculation");
|
||||
launchTool(QUCS_NAME "rescodes", "resistor color code calculation");
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -845,7 +849,7 @@ void QucsApp::slotGettingStarted()
|
||||
// --------------------------------------------------------------
|
||||
void QucsApp::showHTML(const QString& Page)
|
||||
{
|
||||
launchTool("qucshelp", "help", Page);
|
||||
launchTool(QUCS_NAME "help", "help", Page);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
@ -28,6 +28,9 @@
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
SpiceLibComp::SpiceLibComp()
|
||||
@ -82,7 +85,7 @@ void SpiceLibComp::createSymbol()
|
||||
{
|
||||
int No;
|
||||
QString FileName = QucsSettings.BinDir;
|
||||
FileName += QString("/../share/qucs/symbols/%1.sym").arg(Props.at(2)->Value);
|
||||
FileName += QString("/../share/" QUCS_NAME "/symbols/%1.sym").arg(Props.at(2)->Value);
|
||||
|
||||
tx = INT_MIN;
|
||||
ty = INT_MIN;
|
||||
@ -216,7 +219,7 @@ QString SpiceLibComp::getSpiceModel()
|
||||
|
||||
void SpiceLibComp::getSymbolPatternsList(QStringList &symbols)
|
||||
{
|
||||
QString dir_name = QucsSettings.BinDir + "/../share/qucs/symbols/";
|
||||
QString dir_name = QucsSettings.BinDir + "/../share/" QUCS_NAME "/symbols/";
|
||||
QDir sym_dir(dir_name);
|
||||
QStringList sym_files = sym_dir.entryList(QDir::Files);
|
||||
foreach (QString file,sym_files) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user