[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdegraphics/kviewshell/plugins/pdf
From: Wilfried Huss <Wilfried.Huss () gmx ! at>
Date: 2006-05-02 20:21:42
Message-ID: 1146601302.234235.28441.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 536728 by whuss:
qt3support--
M +6 -2 pdfMultipage.cpp
M +11 -11 pdfRenderer.cpp
M +4 -3 pdfWidget.cpp
M +1 -1 sourceSplitter.h
--- trunk/KDE/kdegraphics/kviewshell/plugins/pdf/pdfMultipage.cpp #536727:536728
@@ -41,10 +41,13 @@
const char *name, const QStringList&)
: KMultiPage(parentWidget, parent), pdfRenderer(parentWidget)
{
+ Q_UNUSED(widgetName);
+ Q_UNUSED(name);
+
/* This is kparts wizardry that cannot be understood by man. Simply
change the names to match your implementation. */
setInstance(PdfMultiPageFactory::instance());
- pdfRenderer.setName("Pdf renderer");
+ pdfRenderer.setObjectName("Pdf renderer");
setXMLFile("pdfMultipage.rc");
@@ -53,7 +56,8 @@
files, and crashes may result. */
setRenderer(&pdfRenderer);
- docInfoAction = new KAction(i18n("Document &Info"), "info", 0, &pdfRenderer, \
SLOT(showInfo()), actionCollection(), "info_pdf"); + docInfoAction = new \
KAction(KIcon("info"), i18n("Document &Info"), actionCollection(), "info_pdf"); + \
connect(docInfoAction, SIGNAL(triggered()), &pdfRenderer, SLOT(showInfo()));
enableActions(false);
}
--- trunk/KDE/kdegraphics/kviewshell/plugins/pdf/pdfRenderer.cpp #536727:536728
@@ -232,7 +232,7 @@
// that it is a file, not a directory. Otherwise, show an error
// message and exit..
QFileInfo fi(fname);
- filename = fi.absFilePath();
+ filename = fi.absoluteFilePath();
if (!fi.exists() || fi.isDir()) {
KMessageBox::error( parentWidget,
i18n("<qt><strong>File error.</strong> The specified file '%1' does not \
exist.</qt>", filename), @@ -248,7 +248,7 @@
}
// Now we assume that the file is fine and load the file.
- document = Poppler::Document::load(filename.ascii());
+ document = Poppler::Document::load(filename.toAscii());
if (!document || document->isLocked())
{
KMessageBox::error( parentWidget,
@@ -305,7 +305,7 @@
}
// Store path to current file
- path = fi.dirPath();
+ path = fi.absolutePath();
// Load pdfsync file if available
QString pdfsync_filename = path + "/" + fi.baseName() + ".pdfsync";
@@ -339,7 +339,7 @@
bool PdfRenderer::isValidFile(const QString fileName)
{
- Poppler::Document* doc = Poppler::Document::load(fileName.ascii());
+ Poppler::Document* doc = Poppler::Document::load(fileName.toAscii());
if (doc)
{
delete doc;
@@ -469,7 +469,7 @@
double minimum = 0;
int minIndex = 0;
- for (unsigned int i = 0; i < pageTarget.count(); i++)
+ for (int i = 0; i < pageTarget.count(); i++)
{
// Remember the closest source link
double dx = x.getLength_in_cm() - pageTarget[i].x.getLength_in_cm();
@@ -616,11 +616,11 @@
QLabel* label1 = new QLabel(contents);
label1->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
- lay->add(label1);
+ lay->addWidget(label1);
QLabel* label2 = new QLabel(i18n("<qt>A pdfsync file has been found. You may \
click into the text with the "
"middle mouse button, and an editor will open the TeX-source file \
immediately.</qt>"), contents); label2->setMinimumSize(label2->sizeHint());
- lay->add(label2);
+ lay->addWidget(label2);
lay->addStretch(1);
QSize extraSize = QSize(50,30);
@@ -677,7 +677,7 @@
// case 2: The reference is of form "src:1111Filename", where "1111"
// points to line number 1111 in the file "Filename". KViewShell then
// looks for pdfsync targets that are close to the given line number
- if (reference.find("src:", 0, false) == 0)
+ if (reference.indexOf("src:", 0, Qt::CaseInsensitive) == 0)
{
// Extract the file name and the numeral part from the reference string
SourceFileSplitter splitter(reference, filename);
@@ -705,7 +705,7 @@
QMap<int, PdfSyncLine>::Iterator it;
for (it = pdfSyncLines.begin(); it != pdfSyncLines.end(); ++it)
{
- PdfSyncLine& pdfSyncLine = it.data();
+ PdfSyncLine& pdfSyncLine = it.value();
QString targetFilename = path + "/" + pdfSyncLine.filename;
//kDebug(kvs::pdf) << "test target filename = " << targetFilename << endl;
if (targetFilename == refFileName || targetFilename + ".tex" == refFileName)
@@ -735,10 +735,10 @@
kDebug(kvs::pdf) << "Key found: " << key << ", Offset: " << minimumDelta << \
endl;
- for (unsigned int i = 0; i < pdfSyncTargets.count(); i++)
+ for (int i = 0; i < pdfSyncTargets.count(); i++)
{
QVector<PdfSyncTarget>& targetList = pdfSyncTargets[i];
- for (unsigned int j = 0; j < targetList.count(); j++)
+ for (int j = 0; j < targetList.count(); j++)
{
if (targetList[j].record == key)
{
--- trunk/KDE/kdegraphics/kviewshell/plugins/pdf/pdfWidget.cpp #536727:536728
@@ -48,7 +48,7 @@
// Check if the mouse is pressed on a source-hyperlink
// source hyperlinks can be invoked with the Middle Mousebutton or alternatively
// with Control+Left Mousebutton
- if (e->button() == Qt::MidButton || (e->button() == Qt::LeftButton && (e->state() \
& Qt::ControlButton))) + if (e->button() == Qt::MidButton || (e->button() == \
Qt::LeftButton && (e->modifiers() & Qt::ControlButton))) {
PdfPageCache* pdfCache = static_cast<PdfPageCache*>(documentCache);
pdfCache->inverseSearch(pageNumber, inverseMap(e->pos()), true);
@@ -74,7 +74,7 @@
// Analyze the mouse movement only if no mouse button was pressed
- if ( e->state() == 0 )
+ if ( e->modifiers() == Qt::NoModifier )
{
PdfPageCache* pdfCache = static_cast<PdfPageCache*>(documentCache);
@@ -84,7 +84,8 @@
if (!clearStatusBarTimer.isActive())
{
// clear the statusbar after one second.
- clearStatusBarTimer.start(1000, true);
+ clearStatusBarTimer.setSingleShot(true);
+ clearStatusBarTimer.start(1000);
}
}
}
--- trunk/KDE/kdegraphics/kviewshell/plugins/pdf/sourceSplitter.h #536727:536728
@@ -35,7 +35,7 @@
SourceFileSplitter(const QString& scrlink, const QString& dviFile);
QString fileName() { return m_fileInfo.fileName(); }
- QString filePath() { return m_fileInfo.absFilePath(); }
+ QString filePath() { return m_fileInfo.absoluteFilePath(); }
bool fileExists() { return m_fileInfo.exists(); }
Q_UINT32 line() { return m_line; }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic