mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Move getSymbolPatternsList to misc
This commit is contained in:
parent
fd168e39a8
commit
0c85634d98
@ -717,6 +717,16 @@ QString misc::unwrapExePath(const QString &exe_file)
|
||||
return abs_exe_path;
|
||||
}
|
||||
|
||||
void misc::getSymbolPatternsList(QStringList &symbols)
|
||||
{
|
||||
QString dir_name = QucsSettings.BinDir + "/../share/" QUCS_NAME "/symbols/";
|
||||
QDir sym_dir(dir_name);
|
||||
QStringList sym_files = sym_dir.entryList(QDir::Files);
|
||||
for (const QString& file : sym_files) {
|
||||
QFileInfo inf(file);
|
||||
symbols.append(inf.baseName());
|
||||
}
|
||||
}
|
||||
|
||||
VersionTriplet::VersionTriplet(){
|
||||
major = minor = patch = 0;
|
||||
|
@ -95,6 +95,8 @@ namespace misc {
|
||||
|
||||
void draw_richtext(QPainter* painter, int x, int y, const QString& text, QRectF* br = nullptr);
|
||||
void draw_resize_handle(QPainter* painter, const QPointF& center);
|
||||
|
||||
void getSymbolPatternsList(QStringList &symbols);
|
||||
}
|
||||
|
||||
/*! handle the application version string
|
||||
|
@ -37,7 +37,7 @@ SpiceLibComp::SpiceLibComp()
|
||||
Simulator = spicecompat::simSpice;
|
||||
|
||||
QStringList patterns;
|
||||
getSymbolPatternsList(patterns);
|
||||
misc::getSymbolPatternsList(patterns);
|
||||
QString p_str = "[auto";
|
||||
if (!patterns.isEmpty()) p_str += "," + patterns.join(",");
|
||||
p_str += "]";
|
||||
@ -227,16 +227,3 @@ QString SpiceLibComp::getSpiceModel()
|
||||
QString s = QString(".INCLUDE \"%1\"\n").arg(f);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SpiceLibComp::getSymbolPatternsList(QStringList &symbols)
|
||||
{
|
||||
QString dir_name = QucsSettings.BinDir + "/../share/" QUCS_NAME "/symbols/";
|
||||
QDir sym_dir(dir_name);
|
||||
QStringList sym_files = sym_dir.entryList(QDir::Files);
|
||||
for (const QString& file : sym_files) {
|
||||
QFileInfo inf(file);
|
||||
symbols.append(inf.baseName());
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ protected:
|
||||
void remakeSymbol(int No, QStringList &pin_names);
|
||||
int loadSymbol(const QString&);
|
||||
private:
|
||||
void getSymbolPatternsList(QStringList &symbols);
|
||||
void removeUnusedPorts();
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user