prevent crash if no tab is present.
This commit is contained in:
@@ -2593,7 +2593,11 @@ void PTextEdit::musrView()
|
||||
}
|
||||
|
||||
QString cmd = fAdmin->getExecPath() + "/musrview";
|
||||
QString workDir = QFileInfo(*fFilenames.find( currentEditor() )).absolutePath();
|
||||
QString fln="./";
|
||||
PSubTextEdit *ce = currentEditor();
|
||||
if (ce != nullptr)
|
||||
fln = *fFilenames.find(currentEditor());
|
||||
QString workDir = QFileInfo(fln).absolutePath();
|
||||
QStringList arg;
|
||||
QString str;
|
||||
|
||||
@@ -2662,7 +2666,11 @@ void PTextEdit::musrView2Dat()
|
||||
return;
|
||||
|
||||
QString cmd = fAdmin->getExecPath() + "/musrview";
|
||||
QString workDir = QFileInfo(*fFilenames.find( currentEditor() )).absolutePath();
|
||||
QString fln="./";
|
||||
PSubTextEdit *ce = currentEditor();
|
||||
if (ce != nullptr)
|
||||
fln = *fFilenames.find(currentEditor());
|
||||
QString workDir = QFileInfo(fln).absolutePath();
|
||||
QStringList arg;
|
||||
|
||||
for (auto it : flns) {
|
||||
@@ -2782,6 +2790,9 @@ void PTextEdit::musrT0()
|
||||
*/
|
||||
void PTextEdit::musrFT()
|
||||
{
|
||||
PSubTextEdit *ce = currentEditor();
|
||||
if (ce == nullptr)
|
||||
return;
|
||||
|
||||
PGetMusrFTOptionsDialog *dlg = new PGetMusrFTOptionsDialog(*fFilenames.find( currentEditor() ), fMusrFTPrevCmd, fAdmin->getHelpUrl("musrFT"));
|
||||
|
||||
@@ -3093,7 +3104,11 @@ void PTextEdit::mupp()
|
||||
|
||||
QProcess *proc = new QProcess(this);
|
||||
|
||||
QString workDir = QFileInfo(*fFilenames.find( currentEditor() )).absolutePath();
|
||||
QString fln="./";
|
||||
PSubTextEdit *ce = currentEditor();
|
||||
if (ce != nullptr)
|
||||
fln = *fFilenames.find(currentEditor());
|
||||
QString workDir = QFileInfo(fln).absolutePath();
|
||||
|
||||
// make sure that the system environment variables are properly set
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
|
||||
@@ -2585,12 +2585,16 @@ void PTextEdit::musrView()
|
||||
}
|
||||
|
||||
QString cmd = fAdmin->getExecPath() + "/musrview";
|
||||
QString workDir = QFileInfo(*fFilenames.find( currentEditor() )).absolutePath();
|
||||
QString fln="./";
|
||||
PSubTextEdit *ce = currentEditor();
|
||||
if (ce != nullptr)
|
||||
fln = *fFilenames.find(currentEditor());
|
||||
QString workDir = QFileInfo(fln).absolutePath();
|
||||
QStringList arg;
|
||||
QString str;
|
||||
|
||||
// file name
|
||||
str = *fFilenames.find( currentEditor() );
|
||||
str = fln;
|
||||
int pos = str.lastIndexOf("/");
|
||||
if (pos != -1)
|
||||
str.remove(0, pos+1);
|
||||
@@ -2650,7 +2654,11 @@ void PTextEdit::musrView2Dat()
|
||||
return;
|
||||
|
||||
QString cmd = fAdmin->getExecPath() + "/musrview";
|
||||
QString workDir = QFileInfo(*fFilenames.find( currentEditor() )).absolutePath();
|
||||
QString fln="./";
|
||||
PSubTextEdit *ce = currentEditor();
|
||||
if (ce != nullptr)
|
||||
fln = *fFilenames.find(currentEditor());
|
||||
QString workDir = QFileInfo(fln).absolutePath();
|
||||
QStringList arg;
|
||||
|
||||
for (auto it : flns) {
|
||||
@@ -2763,6 +2771,9 @@ void PTextEdit::musrT0()
|
||||
*/
|
||||
void PTextEdit::musrFT()
|
||||
{
|
||||
PSubTextEdit *ce = currentEditor();
|
||||
if (ce == nullptr)
|
||||
return;
|
||||
|
||||
PGetMusrFTOptionsDialog *dlg = new PGetMusrFTOptionsDialog(*fFilenames.find(currentEditor()), fMusrFTPrevCmd, fAdmin->getHelpUrl("musrFT"));
|
||||
|
||||
@@ -3064,7 +3075,11 @@ void PTextEdit::mupp()
|
||||
|
||||
QProcess *proc = new QProcess(this);
|
||||
|
||||
QString workDir = QFileInfo(*fFilenames.find( currentEditor() )).absolutePath();
|
||||
QString fln="./";
|
||||
PSubTextEdit *ce = currentEditor();
|
||||
if (ce != nullptr)
|
||||
fln = *fFilenames.find(currentEditor());
|
||||
QString workDir = QFileInfo(fln).absolutePath();
|
||||
|
||||
// make sure that the system environment variables are properly set
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
|
||||
Reference in New Issue
Block a user