Summary: | Caption should ommit file:// | ||
---|---|---|---|
Product: | [Unmaintained] kpdf | Reporter: | leon pollak <leonp> |
Component: | general | Assignee: | Albert Astals Cid <aacid> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 0.5.6 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
leon pollak
2007-03-13 09:39:01 UTC
SVN commit 642287 by aacid: Fix emision of window caption for remote files and for kpdf windows restored by the session manager BUGS: 142906 M +19 -0 part.cpp M +1 -0 part.h M +0 -3 shell/shell.cpp --- branches/KDE/3.5/kdegraphics/kpdf/part.cpp #642286:642287 @@ -89,6 +89,10 @@ // connect the started signal to tell the job the mimetypes we like connect(this, SIGNAL(started(KIO::Job *)), this, SLOT(setMimeTypes(KIO::Job *))); + // connect the completed signal so we can put the window caption when loading remote files + connect(this, SIGNAL(completed()), this, SLOT(emitWindowCaption())); + connect(this, SIGNAL(canceled(const QString &)), this, SLOT(emitWindowCaption())); + // load catalog for translation KGlobal::locale()->insertCatalogue("kpdf"); @@ -460,10 +464,18 @@ // this calls the above 'openURL' method bool b = KParts::ReadOnlyPart::openURL(url); + + // these setWindowCaption calls only work for local files if ( !b ) + { KMessageBox::error( widget(), i18n("Could not open %1").arg( url.prettyURL() ) ); + emit setWindowCaption(""); + } else + { m_viewportDirty.pageNumber = -1; + emit setWindowCaption(url.filename()); + } emit enablePrintAction(b); return b; } @@ -482,6 +494,13 @@ m_jobMime = mime; } +void Part::emitWindowCaption() +{ + // these setWindowCaption call only works for remote files + if (m_document->isOpened()) emit setWindowCaption(url().filename()); + else emit setWindowCaption(""); +} + bool Part::closeURL() { if (!m_temporaryLocalFile.isNull()) --- branches/KDE/3.5/kdegraphics/kpdf/part.h #642286:642287 @@ -121,6 +121,7 @@ void saveSplitterSize(); void setMimeTypes(KIO::Job *job); void readMimeType(KIO::Job *job, const QString &mime); + void emitWindowCaption(); public slots: // connected to Shell action (and browserExtension), not local one --- branches/KDE/3.5/kdegraphics/kpdf/shell/shell.cpp #642286:642287 @@ -118,10 +118,7 @@ { bool openOk = m_part->openURL( url ); if ( openOk ) - { m_recent->addURL( url ); - setCaption(url.fileName()); - } else m_recent->removeURL( url ); } |