Bugfix: don't show a document after it has been closed

svn path=/trunk/kdegraphics/kdvi/; revision=58639
remotes/origin/kdvi-2.0
Stefan Kebekus 26 years ago
parent 1cd225bb6b
commit 0a793634fd
  1. 14
      dviwin.cpp
  2. 5
      kdvi_multipage.cpp

@ -342,10 +342,20 @@ void dviWindow::setFile( const char *fname )
QFileInfo fi(fname);
QString filename = fi.absFilePath();
// Make sure the file actually exists.
if (strlen(fname) == 0)
// If fname is the empty string, then this means: "close". Delete
// the dvifile and the pixmap.
if (strlen(fname) == 0) {
if (dviFile)
delete dviFile;
dviFile = 0;
if (pixmap)
delete pixmap;
pixmap = 0;
resize(0, 0);
return;
}
// Make sure the file actually exists.
if (!fi.exists() || fi.isDir()) {
KMessageBox::error( this,
i18n("File error!\n\n") +

@ -124,11 +124,8 @@ bool KDVIMultiPage::openFile()
bool KDVIMultiPage::closeURL()
{
window->setFile("");
scrollView()->resizeContents(0, 0);
window->setFile(""); // That means: close the file. Resize the widget to 0x0.
emit previewChanged(false);
return true;
}

Loading…
Cancel
Save