Move getSymbolPatternsList to misc

This commit is contained in:
Vadim Kuznetsov 2024-06-11 19:28:39 +03:00
parent fd168e39a8
commit 0c85634d98
4 changed files with 13 additions and 15 deletions

View File

@ -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;

View File

@ -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

View File

@ -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());
}
}

View File

@ -35,7 +35,6 @@ protected:
void remakeSymbol(int No, QStringList &pin_names);
int loadSymbol(const QString&);
private:
void getSymbolPatternsList(QStringList &symbols);
void removeUnusedPorts();
};