Skip to content

Commit

Permalink
Whitespace changes only
Browse files Browse the repository at this point in the history
  • Loading branch information
in3otd committed Feb 23, 2020
1 parent 16d6fcc commit ff1100b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 47 deletions.
41 changes: 15 additions & 26 deletions qucs/qucs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ void createListComponentEntry(){

QList<Module *> Comps;
Comps = Category::getModules(category);

// \fixme, crash with diagrams, skip
if(category == "diagrams" || category == "paintings") continue;

Expand All @@ -469,7 +468,7 @@ void createListComponentEntry(){

foreach (Module *Mod, Comps) {
Element *e = (Mod->info) (Name, File, true);
// dangerous. better precheck cast
// dangerous. better precheck cast
Component *c = (Component* ) e;

// FIXME: cleanup
Expand Down Expand Up @@ -565,9 +564,9 @@ int main(int argc, char *argv[])
QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/";
var = getenv("QUCS_LIBDIR");
if(var != NULL) {
QucsSettings.LibDir = QString(var);
QucsSettings.LibDir = QString(var);
}else{
QucsSettings.LibDir = QucsDir.canonicalPath() + "/share/qucs/library/";
QucsSettings.LibDir = QucsDir.canonicalPath() + "/share/qucs/library/";
}
QucsSettings.OctaveDir = QucsDir.canonicalPath() + "/share/qucs/octave/";
QucsSettings.ExamplesDir = QucsDir.canonicalPath() + "/share/qucs/examples/";
Expand Down Expand Up @@ -641,31 +640,21 @@ int main(int argc, char *argv[])
QucsSettings.BGColor.setRgb(255, 250, 225);

// syntax highlighting
if(!QucsSettings.Comment.isValid())
QucsSettings.Comment = Qt::gray;
if(!QucsSettings.String.isValid())
QucsSettings.String = Qt::red;
if(!QucsSettings.Integer.isValid())
QucsSettings.Integer = Qt::blue;
if(!QucsSettings.Real.isValid())
QucsSettings.Real = Qt::darkMagenta;
if(!QucsSettings.Character.isValid())
QucsSettings.Character = Qt::magenta;
if(!QucsSettings.Type.isValid())
QucsSettings.Type = Qt::darkRed;
if(!QucsSettings.Attribute.isValid())
QucsSettings.Attribute = Qt::darkCyan;
if(!QucsSettings.Directive.isValid())
QucsSettings.Directive = Qt::darkCyan;
if(!QucsSettings.Task.isValid())
QucsSettings.Task = Qt::darkRed;

if(!QucsSettings.Comment .isValid()) QucsSettings.Comment = Qt::gray;
if(!QucsSettings.String .isValid()) QucsSettings.String = Qt::red;
if(!QucsSettings.Integer .isValid()) QucsSettings.Integer = Qt::blue;
if(!QucsSettings.Real .isValid()) QucsSettings.Real = Qt::darkMagenta;
if(!QucsSettings.Character.isValid()) QucsSettings.Character = Qt::magenta;
if(!QucsSettings.Type .isValid()) QucsSettings.Type = Qt::darkRed;
if(!QucsSettings.Attribute.isValid()) QucsSettings.Attribute = Qt::darkCyan;
if(!QucsSettings.Directive.isValid()) QucsSettings.Directive = Qt::darkCyan;
if(!QucsSettings.Task .isValid()) QucsSettings.Task = Qt::darkRed;

a.setFont(QucsSettings.font);

// set codecs
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForTr (QTextCodec::codecForName("UTF-8"));

QTranslator tor( 0 );
QString lang = QucsSettings.Language;
Expand Down Expand Up @@ -735,9 +724,9 @@ int main(int argc, char *argv[])
return 0;
}else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
#ifdef GIT
fprintf(stdout, "Qucs " PACKAGE_VERSION " (" GIT ")" "\n");
fprintf(stdout, "Qucs " PACKAGE_VERSION " (" GIT ")" "\n");
#else
fprintf(stdout, "Qucs " PACKAGE_VERSION "\n");
fprintf(stdout, "Qucs " PACKAGE_VERSION "\n");
#endif
return 0;
}
Expand Down
42 changes: 21 additions & 21 deletions qucs/qucs/qucs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ void QucsApp::slotButtonProjOpen()
QModelIndex idx = Projects->currentIndex();
if (!idx.isValid()) {
QMessageBox::information(this, tr("Info"),
tr("No project is selected !"));
tr("No project is selected !"));
} else {
slotListProjOpen(idx);
}
Expand Down Expand Up @@ -1531,12 +1531,12 @@ bool QucsApp::saveAs()

if(isTextDocument (w))
Filter = tr("VHDL Sources")+" (*.vhdl *.vhd);;" +
tr("Verilog Sources")+" (*.v);;"+
tr("Verilog-A Sources")+" (*.va);;"+
tr("Octave Scripts")+" (*.m *.oct);;"+
tr("Qucs Netlist")+" (*.net *.qnet);;"+
tr("Plain Text")+" (*.txt);;"+
tr("Any File")+" (*)";
tr("Verilog Sources")+" (*.v);;"+
tr("Verilog-A Sources")+" (*.va);;"+
tr("Octave Scripts")+" (*.m *.oct);;"+
tr("Qucs Netlist")+" (*.net *.qnet);;"+
tr("Plain Text")+" (*.txt);;"+
tr("Any File")+" (*)";
else
Filter = QucsFileFilter;

Expand All @@ -1560,9 +1560,9 @@ bool QucsApp::saveAs()
Info.setFile(s);
if(QFile::exists(s)) {
n = QMessageBox::warning(this, tr("Warning"),
tr("The file '")+Info.fileName()+tr("' already exists!\n")+
tr("Saving will overwrite the old one! Continue?"),
tr("No"), tr("Yes"), tr("Cancel"));
tr("The file '")+Info.fileName()+tr("' already exists!\n")+
tr("Saving will overwrite the old one! Continue?"),
tr("No"), tr("Yes"), tr("Cancel"));
if(n == 2) return false; // cancel
if(n == 0) continue;
}
Expand All @@ -1571,7 +1571,7 @@ bool QucsApp::saveAs()
QucsDoc * d = findDoc (s);
if(d) {
QMessageBox::information(this, tr("Info"),
tr("Cannot overwrite an open document"));
tr("Cannot overwrite an open document"));
return false;
}

Expand Down Expand Up @@ -2117,7 +2117,7 @@ void QucsApp::slotSimulate()
if(Doc->SimTime.isEmpty() && ((TextDoc*)Doc)->simulation) {
DigiSettingsDialog *d = new DigiSettingsDialog((TextDoc*)Doc);
if(d->exec() == QDialog::Rejected)
return;
return;
}
}
else
Expand Down Expand Up @@ -2154,9 +2154,9 @@ void QucsApp::slotSimulate()
// disconnect is automatically performed, if one of the involved objects
// is destroyed !
connect(sim, SIGNAL(SimulationEnded(int, SimMessage*)), this,
SLOT(slotAfterSimulation(int, SimMessage*)));
SLOT(slotAfterSimulation(int, SimMessage*)));
connect(sim, SIGNAL(displayDataPage(QString&, QString&)),
this, SLOT(slotChangePage(QString&, QString&)));
this, SLOT(slotChangePage(QString&, QString&)));

sim->show();
if(!sim->startProcess()) return;
Expand Down Expand Up @@ -2198,18 +2198,18 @@ void QucsApp::slotAfterSimulation(int Status, SimMessage *sim)
if(sim->SimOpenDpl) {
// switch to data display
if(sim->DataDisplay.right(2) == ".m" ||
sim->DataDisplay.right(4) == ".oct") { // Is it an Octave script?
octave->startOctave();
octave->runOctaveScript(sim->DataDisplay);
sim->DataDisplay.right(4) == ".oct") { // Is it an Octave script?
octave->startOctave();
octave->runOctaveScript(sim->DataDisplay);
}
else
slotChangePage(sim->DocName, sim->DataDisplay);
slotChangePage(sim->DocName, sim->DataDisplay);
sim->slotClose(); // close and delete simulation window
}
else
if(w) if(!isTextDocument (sim->DocWidget))
// load recent simulation data (if document is still open)
((Schematic*)sim->DocWidget)->reloadGraphs();
// load recent simulation data (if document is still open)
((Schematic*)sim->DocWidget)->reloadGraphs();
}

if(!isTextDocument (sim->DocWidget))
Expand Down Expand Up @@ -2244,7 +2244,7 @@ void QucsApp::slotChangePage(QString& DocName, QString& DataDisplay)
QString ext = QucsDoc::fileSuffix (DataDisplay);

if (ext != "vhd" && ext != "vhdl" && ext != "v" && ext != "va" &&
ext != "oct" && ext != "m") {
ext != "oct" && ext != "m") {
d = DocumentTab->createEmptySchematic(Name);
} else {
d = DocumentTab->createEmptyTextDoc(Name);
Expand Down

0 comments on commit ff1100b

Please sign in to comment.