diff --git a/dviwin.cpp b/dviwin.cpp
index 10b3b11c9..425a619cb 100644
--- a/dviwin.cpp
+++ b/dviwin.cpp
@@ -768,7 +768,9 @@ void dviWindow::all_fonts_loaded(fontPool *)
if (!ref.at(i).isNumber())
break;
Q_UINT32 refLineNumber = ref.left(i).toUInt();
- QString refFileName = QFileInfo(ref.mid(i).stripWhiteSpace()).absFilePath();
+
+ QFileInfo fi1(dviFile->filename);
+ QString refFileName = QFileInfo(fi1.dir(), ref.mid(i).stripWhiteSpace()).absFilePath();
if (sourceHyperLinkAnchors.isEmpty()) {
KMessageBox::sorry(this, i18n("You have asked KDVI to locate the place in the DVI file which corresponds to "
@@ -776,21 +778,21 @@ void dviWindow::all_fonts_loaded(fontPool *)
"does not contain the necessary source file information. "
"We refer to the manual of KDVI for a detailed explanation on how to include this "
"information. Press the F1 key to open the manual.").arg(ref.left(i)).arg(refFileName),
- i18n( "Could Not Find Reference" ));
+ i18n("Could Not Find Reference"));
return;
}
-
+
Q_INT32 page = 0;
Q_INT32 y = -1000;
QValueVector::iterator it;
- for( it = sourceHyperLinkAnchors.begin(); it != sourceHyperLinkAnchors.end(); ++it )
+ for( it = sourceHyperLinkAnchors.begin(); it != sourceHyperLinkAnchors.end(); ++it )
if (refFileName.stripWhiteSpace() == it->fileName.stripWhiteSpace()) {
if (refLineNumber >= it->line) {
page = it->page;
y = (Q_INT32)(it->vertical_coordinate/shrinkfactor+0.5);
}
}
-
+
reference = QString::null;
if (y >= 0)
emit(request_goto_page(page, y));
@@ -1113,8 +1115,10 @@ void dviWindow::mousePressEvent ( QMouseEvent * e )
QFileInfo fi3(fi1.dir(),cp.mid(i));
TeXfile = fi3.absFilePath();
if ( !fi3.exists() ) {
- KMessageBox::sorry(this, i18n("The DVI-file refers to the TeX-file "
- "%1 which could not be found.").arg(KShellProcess::quote(TeXfile)),
+ KMessageBox::sorry(this, QString("") +
+ i18n("The DVI-file refers to the TeX-file "
+ "%1 which could not be found.").arg(KShellProcess::quote(TeXfile)) +
+ QString(""),
i18n( "Could Not Find File" ));
return;
}
@@ -1122,10 +1126,12 @@ void dviWindow::mousePressEvent ( QMouseEvent * e )
QString command = editorCommand;
if (command.isEmpty() == true) {
- int r = KMessageBox::warningContinueCancel(this, i18n("You have not yet specified an editor for inverse search. "
- "Please choose your favorite editor in the DVI "
- "options dialog which you will find in the "
- "Settings menu."),
+ int r = KMessageBox::warningContinueCancel(this, QString("") +
+ i18n("You have not yet specified an editor for inverse search. "
+ "Please choose your favorite editor in the "
+ "DVI options dialog "
+ "which you will find in the Settings-menu.") +
+ QString(""),
i18n("Need to Specify Editor"),
i18n("Use KDE's Editor Kate for Now"));
if (r == KMessageBox::Continue)
diff --git a/dviwin_prescan.cpp b/dviwin_prescan.cpp
index 524271f81..6209105af 100644
--- a/dviwin_prescan.cpp
+++ b/dviwin_prescan.cpp
@@ -432,7 +432,8 @@ void dviWindow::prescan_ParseSourceSpecial(QString cp)
if (!cp.at(j).isNumber())
break;
Q_UINT32 sourceLineNumber = cp.left(j).toUInt();
- QString sourceFileName = QFileInfo(cp.mid(j).stripWhiteSpace()).absFilePath();
+ QFileInfo fi1(dviFile->filename);
+ QString sourceFileName = QFileInfo(fi1.dir(), cp.mid(j).stripWhiteSpace()).absFilePath();
DVI_SourceFileAnchor sfa(sourceFileName, sourceLineNumber, current_page, currinf.data.dvi_v);
sourceHyperLinkAnchors.push_back(sfa);
}