mirror of
https://invent.kde.org/graphics/okular
synced 2024-11-05 18:34:53 +00:00
less qt3_support
svn path=/branches/work/kde4/playground/graphics/okular/; revision=525131
This commit is contained in:
parent
86423f06b3
commit
55bc51a6d0
10 changed files with 29 additions and 27 deletions
|
@ -143,7 +143,7 @@ void RegularArea<NormalizedShape, Shape>::simplify()
|
|||
}
|
||||
while (!m_remove.isEmpty())
|
||||
{
|
||||
this->remove( m_remove.last() );
|
||||
this->removeAll( m_remove.last() );
|
||||
m_remove.pop_back();
|
||||
}
|
||||
kDebug() << "from " << end << " to " << this->count() << endl;
|
||||
|
|
|
@ -266,7 +266,7 @@ void ProtocolMSITS::listDir (const KUrl & url)
|
|||
QVector<QString> listing;
|
||||
|
||||
if ( chm_enumerate_dir ( m_chmFile,
|
||||
filepath.local8Bit(),
|
||||
filepath.toLocal8Bit(),
|
||||
CHM_ENUMERATE_NORMAL | CHM_ENUMERATE_FILES | CHM_ENUMERATE_DIRS,
|
||||
chmlib_enumerator,
|
||||
&listing ) != 1 )
|
||||
|
|
|
@ -61,7 +61,7 @@ const QPixmap * KCHMMainTreeViewItem::pixmap( int i ) const
|
|||
|
||||
QString KCHMMainTreeViewItem::getUrl( ) const
|
||||
{
|
||||
if ( url.find ('|') == -1 )
|
||||
if ( url.indexOf ('|') == -1 )
|
||||
return url;
|
||||
/*
|
||||
// Create a dialog with URLs, and show it, so user can select an URL he/she wants.
|
||||
|
|
|
@ -53,13 +53,13 @@ namespace KCHMUrl
|
|||
&& !isJavascriptURL (url)
|
||||
&& !isNewChmURL (url, p1, p2) )
|
||||
{
|
||||
newurl = QDir::cleanDirPath (url);
|
||||
newurl = QDir::cleanPath (url);
|
||||
|
||||
// Normalize url, so it becomes absolute
|
||||
if ( newurl[0] != '/' )
|
||||
newurl = "/" + newurl;
|
||||
|
||||
newurl = QDir::cleanDirPath (newurl);
|
||||
newurl = QDir::cleanPath (newurl);
|
||||
}
|
||||
|
||||
//qDebug ("KCHMViewWindow::makeURLabsolute (%s) -> (%s)", url.ascii(), newurl.ascii());
|
||||
|
@ -75,7 +75,7 @@ namespace KCHMUrl
|
|||
&& !isJavascriptURL (url)
|
||||
&& !isNewChmURL (url, p1, p2) )
|
||||
{
|
||||
newurl = QDir::cleanDirPath (url);
|
||||
newurl = QDir::cleanPath (url);
|
||||
|
||||
// Normalize url, so it becomes absolute
|
||||
if ( newurl[0] != '/' )
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <qfileinfo.h>
|
||||
#include <qpainter.h>
|
||||
#include <qpaintdevice.h>
|
||||
#include <QX11Info>
|
||||
|
||||
#include "faxrenderer.h"
|
||||
#include "core/page.h"
|
||||
|
@ -142,8 +143,8 @@ bool FaxRenderer::loadDocument( const QString & fileName, QVector< KPDFPage * >
|
|||
kError() << "File invalid resolutions, dpi x = " << dpix << ", dpi y = " << dpiy << ". This information will be ignored and 75 DPI assumed." << endl;
|
||||
dpix = dpiy = 75.0;
|
||||
}
|
||||
pagesVector[pg] = new KPDFPage(pg, QPaintDevice::x11AppDpiX () * pageSize.width() / dpix,
|
||||
QPaintDevice::x11AppDpiX () * pageSize.height()/dpiy,0);
|
||||
pagesVector[pg] = new KPDFPage(pg, QX11Info::appDpiX () * pageSize.width() / dpix,
|
||||
QX11Info::appDpiX () * pageSize.height()/dpiy,0);
|
||||
}
|
||||
|
||||
// the return value 'true' indicates that this operation was not successful.
|
||||
|
|
|
@ -39,8 +39,9 @@ static const char littleTIFF[] = "\x49\x49\x2a\x00";
|
|||
static const char bigTIFF[] = "\x4d\x4d\x00\x2a";
|
||||
|
||||
KFaxImage::KFaxImage( const QString &filename, QObject *parent, const char *name )
|
||||
: QObject(parent,name)
|
||||
: QObject(parent)
|
||||
{
|
||||
setObjectName(QLatin1String(name));
|
||||
KGlobal::locale()->insertCatalog( QString::fromLatin1("libkfaximage") );
|
||||
loadImage(filename);
|
||||
}
|
||||
|
@ -190,7 +191,7 @@ KFaxImage::notetiff()
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (file.readBlock(SC(header), 8) != 8) {
|
||||
if (file.read(SC(header), 8) != 8) {
|
||||
kfaxerror(i18n("Unable to read file header (file too short)."));
|
||||
return 0;
|
||||
}
|
||||
|
@ -234,12 +235,12 @@ KFaxImage::notetiff()
|
|||
file.close();
|
||||
return 1;
|
||||
}
|
||||
if (file.readBlock(SC(buf), 2) != 2)
|
||||
if (file.read(SC(buf), 2) != 2)
|
||||
goto realbad;
|
||||
ndirent = get2(buf, endian);
|
||||
int len = 12*ndirent+4;
|
||||
dir = (unsigned char *) malloc(len);
|
||||
if (file.readBlock(SC(dir), len) != len)
|
||||
if (file.read(SC(dir), len) != len)
|
||||
goto realbad;
|
||||
for (dp = dir; ndirent; ndirent--, dp += 12) {
|
||||
/* for each directory entry */
|
||||
|
@ -287,7 +288,7 @@ KFaxImage::notetiff()
|
|||
if (!file.at(value))
|
||||
goto realbad;
|
||||
for (count = 0; count < nstrips; count++) {
|
||||
if (file.readBlock(SC(buf), (ftype == 3) ? 2 : 4) <= 0)
|
||||
if (file.read(SC(buf), (ftype == 3) ? 2 : 4) <= 0)
|
||||
goto realbad;
|
||||
strips[count].offset = (ftype == 3) ?
|
||||
get2(buf, endian) : get4(buf, endian);
|
||||
|
@ -340,7 +341,7 @@ KFaxImage::notetiff()
|
|||
if (!file.at(value))
|
||||
goto realbad;
|
||||
for (count = 0; count < nstrips; count++) {
|
||||
if (file.readBlock(SC(buf), (ftype == 3) ? 2 : 4) <= 0)
|
||||
if (file.read(SC(buf), (ftype == 3) ? 2 : 4) <= 0)
|
||||
goto realbad;
|
||||
strips[count].size = (ftype == 3) ?
|
||||
get2(buf, endian) : get4(buf, endian);
|
||||
|
@ -348,7 +349,7 @@ KFaxImage::notetiff()
|
|||
break;
|
||||
case 283: /* YResolution */
|
||||
if (!file.at(value) ||
|
||||
file.readBlock(SC(buf), 8) != 8)
|
||||
file.read(SC(buf), 8) != 8)
|
||||
goto realbad;
|
||||
yres = get4(buf, endian) / get4(buf+4, endian);
|
||||
break;
|
||||
|
@ -484,7 +485,7 @@ KFaxImage::getstrip(pagenode *pn, int strip)
|
|||
|
||||
/* we expect to get it in one gulp... */
|
||||
if (!file.at(offset) ||
|
||||
(size_t) file.readBlock((char *)Data, pn->length) != pn->length) {
|
||||
(size_t) file.read((char *)Data, pn->length) != pn->length) {
|
||||
badfile(pn);
|
||||
free(Data);
|
||||
return NULL;
|
||||
|
|
|
@ -207,7 +207,7 @@ const CDSCMEDIA* GSInternalDocument::findMediaByName( const QString& mediaName )
|
|||
for( unsigned int i = 0; i < m_dsc->media_count(); i++ )
|
||||
{
|
||||
if( m_dsc->media()[i] && m_dsc->media()[i]->name
|
||||
&& qstricmp( mediaName.local8Bit(), m_dsc->media()[i]->name ) == 0 )
|
||||
&& qstricmp( mediaName.toLocal8Bit(), m_dsc->media()[i]->name ) == 0 )
|
||||
{
|
||||
return m_dsc->media()[i];
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ const CDSCMEDIA* GSInternalDocument::findMediaByName( const QString& mediaName )
|
|||
const CDSCMEDIA *m = dsc_known_media;
|
||||
while( m->name )
|
||||
{
|
||||
if( qstricmp( mediaName.local8Bit(), m->name ) == 0 )
|
||||
if( qstricmp( mediaName.toLocal8Bit(), m->name ) == 0 )
|
||||
return m;
|
||||
m++;
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ QString GSInternalDocument::getPaperSize( const QString& mediaName ) const
|
|||
const CDSCMEDIA *m = dsc_known_media;
|
||||
while( m->name )
|
||||
{
|
||||
if( qstricmp( m_fallbackMedia.local8Bit(), m->name ) == 0 )
|
||||
if( qstricmp( m_fallbackMedia.toLocal8Bit(), m->name ) == 0 )
|
||||
return QString(m->name);
|
||||
m++;
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ bool PDFGenerator::loadDocument( const QString & filePath, QVector<KPDFPage*> &
|
|||
// look for the pass in that folder
|
||||
QString retrievedPass;
|
||||
if ( !wallet->readPassword( filePath.section('/', -1, -1), retrievedPass ) )
|
||||
password = retrievedPass.local8Bit();
|
||||
password = retrievedPass.toLocal8Bit();
|
||||
}
|
||||
triedWallet = true;
|
||||
}
|
||||
|
|
|
@ -311,9 +311,9 @@ bool Shell::handleCompressed(KUrl & url, const QString &path, const KMimeType::P
|
|||
QByteArray buf(1024);
|
||||
int read = 0, wrtn = 0;
|
||||
|
||||
while ((read = filterDev->readBlock(buf.data(), buf.size())) > 0)
|
||||
while ((read = filterDev->read(buf.data(), buf.size())) > 0)
|
||||
{
|
||||
wrtn = m_tempfile->file()->writeBlock(buf.data(), read);
|
||||
wrtn = m_tempfile->file()->write(buf.data(), read);
|
||||
if ( read != wrtn )
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -476,9 +476,9 @@ NewStuffDialog::NewStuffDialog( QWidget * parentWidget )
|
|||
d->sortCombo->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
|
||||
d->sortCombo->setMinimumWidth( 100 );
|
||||
d->sortCombo->setEnabled( false );
|
||||
d->sortCombo->insertItem( SmallIcon( "fonts" ), i18n("Name") );
|
||||
d->sortCombo->insertItem( SmallIcon( "knewstuff" ), i18n("Rating") );
|
||||
d->sortCombo->insertItem( SmallIcon( "favorites" ), i18n("Downloads") );
|
||||
d->sortCombo->addItem( SmallIconSet( "fonts" ), i18n("Name") );
|
||||
d->sortCombo->addItem( SmallIconSet( "knewstuff" ), i18n("Rating") );
|
||||
d->sortCombo->addItem( SmallIconSet( "favorites" ), i18n("Downloads") );
|
||||
connect( d->sortCombo, SIGNAL( activated(int) ),
|
||||
this, SLOT( slotSortingSelected(int) ) );
|
||||
|
||||
|
@ -711,10 +711,10 @@ void NewStuffDialog::slotProvidersListResult( KIO::Job * job )
|
|||
{
|
||||
const Provider * provider = *it;
|
||||
// provider icon: using local KIconLoader, not loading from remote url
|
||||
QPixmap icon = DesktopIcon( provider->icon().url(), 16 );
|
||||
QIcon icon = DesktopIconSet( provider->icon().url(), 16 );
|
||||
QString name = provider->name();
|
||||
// insert provider in combo
|
||||
d->typeCombo->insertItem( icon, name );
|
||||
d->typeCombo->addItem( icon, name );
|
||||
}
|
||||
|
||||
// automatically load the first provider
|
||||
|
|
Loading…
Reference in a new issue