Skip to content

Commit

Permalink
fix getfilename
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Dec 25, 2023
1 parent 793cfd3 commit 268b7f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/texstudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4063,7 +4063,9 @@ void Texstudio::editGotoDefinition(QDocumentCursor c)
target = defs.keys().constFirst();
edView = getEditorViewFromHandle(target);
if(edView->isHidden()){
openExternalFile(target->document()->getFileName());
LatexDocument *ltxdoc = qobject_cast<LatexDocument*>(target->document());
if(ltxdoc)
openExternalFile(ltxdoc->getFileName());
}
}
if (!edView) return;
Expand Down
3 changes: 2 additions & 1 deletion src/textanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ QByteArray escapeAsCSV(const QString &s)

void TextAnalysisDialog::slotExportButton()
{
QString fn = FileDialog::getSaveFileName(this, tr("CSV Export"), editor ? editor->document()->getFileName().replace(".tex", ".csv") : QString(), tr("CSV file") + " (*.csv)" ";;" + tr("All files") + " (*)");
LatexDocument *doc=editor ? qobject_cast<LatexDocument*>(editor->document()): nullptr;
QString fn = FileDialog::getSaveFileName(this, tr("CSV Export"), doc ? doc->getFileName().replace(".tex", ".csv") : QString(), tr("CSV file") + " (*.csv)" ";;" + tr("All files") + " (*)");
if (fn.isEmpty()) return;
QFile f(fn);
if (!f.open(QFile::WriteOnly))
Expand Down

0 comments on commit 268b7f2

Please sign in to comment.