mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-19 07:51:27 +00:00
CXXFLAGS="$CXXFLAGS -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST"
:-) svn path=/trunk/kdegraphics/kdvi/; revision=59876
This commit is contained in:
parent
5afed21885
commit
88d1993362
|
@ -94,7 +94,7 @@ extern struct frame frame0; /* dummy head of list */
|
|||
#define VF_ID_BYTE 202
|
||||
#define VF_MAGIC (VF_PRE << 8) + VF_ID_BYTE
|
||||
|
||||
#define dvi_oops(str) (dvi_oops_msg = (str), longjmp(dvi_env, 1))
|
||||
#define dvi_oops(str) (dvi_oops_msg = (str.utf8()), longjmp(dvi_env, 1))
|
||||
|
||||
static Boolean font_not_found;
|
||||
|
||||
|
|
18
dviwin.cpp
18
dviwin.cpp
|
@ -105,7 +105,7 @@ extern void qt_processEvents(void)
|
|||
|
||||
//------ now comes the dviWindow class implementation ----------
|
||||
|
||||
dviWindow::dviWindow( int bdpi, double zoom, const char *mfm, int mkpk, QWidget *parent, const char *name )
|
||||
dviWindow::dviWindow( int bdpi, double zoom, const QString & mfm, int mkpk, QWidget *parent, const char *name )
|
||||
: QWidget( parent, name )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
|
@ -146,13 +146,13 @@ dviWindow::dviWindow( int bdpi, double zoom, const char *mfm, int mkpk, QWidget
|
|||
is_current_page_drawn = 0;
|
||||
n_files_left = OPEN_MAX;
|
||||
kpse_set_progname ("kdvi");
|
||||
kpse_init_prog ("KDVI", basedpi, MetafontMode.data(), "cmr10");
|
||||
kpse_init_prog ("KDVI", basedpi, MetafontMode.ascii(), "cmr10");
|
||||
kpse_set_program_enabled(kpse_any_glyph_format, 0, kpse_src_cmdline);
|
||||
kpse_format_info[kpse_pk_format].override_path
|
||||
= kpse_format_info[kpse_gf_format].override_path
|
||||
= kpse_format_info[kpse_any_glyph_format].override_path
|
||||
= kpse_format_info[kpse_tfm_format].override_path
|
||||
= FontPath.ascii();
|
||||
= QFile::encodeName(FontPath);
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ void dviWindow::setMakePK( int flag )
|
|||
makepk = flag;
|
||||
}
|
||||
|
||||
void dviWindow::setFontPath( const char *s )
|
||||
void dviWindow::setFontPath( const QString & s )
|
||||
{
|
||||
if (dviFile != NULL)
|
||||
KMessageBox::sorry( this,
|
||||
|
@ -205,7 +205,7 @@ void dviWindow::setFontPath( const char *s )
|
|||
FontPath = s;
|
||||
}
|
||||
|
||||
void dviWindow::setMetafontMode( const char *mfm )
|
||||
void dviWindow::setMetafontMode( const QString & mfm )
|
||||
{
|
||||
if (dviFile != NULL)
|
||||
KMessageBox::sorry( this,
|
||||
|
@ -272,7 +272,7 @@ void dviWindow::drawPage()
|
|||
foreGroundPaint.end();
|
||||
KMessageBox::error( this,
|
||||
i18n("File corruption!\n\n") +
|
||||
dvi_oops_msg +
|
||||
QString::fromUtf8(dvi_oops_msg) +
|
||||
i18n("\n\nMost likely this means that the DVI file\nis broken, or that it is not a DVI file."));
|
||||
return;
|
||||
} else {
|
||||
|
@ -329,14 +329,14 @@ void dviWindow::changePageSize()
|
|||
|
||||
//------ setup the dvi interpreter (should do more here ?) ----------
|
||||
|
||||
void dviWindow::setFile( const char *fname )
|
||||
void dviWindow::setFile( const QString & fname )
|
||||
{
|
||||
QFileInfo fi(fname);
|
||||
QString filename = fi.absFilePath();
|
||||
|
||||
// If fname is the empty string, then this means: "close". Delete
|
||||
// the dvifile and the pixmap.
|
||||
if (strlen(fname) == 0) {
|
||||
if (fname.isEmpty()) {
|
||||
if (dviFile)
|
||||
delete dviFile;
|
||||
dviFile = 0;
|
||||
|
@ -361,7 +361,7 @@ void dviWindow::setFile( const char *fname )
|
|||
QApplication::restoreOverrideCursor();
|
||||
KMessageBox::error( this,
|
||||
i18n("File corruption!\n\n") +
|
||||
dvi_oops_msg +
|
||||
QString::fromUtf8(dvi_oops_msg) +
|
||||
i18n("\n\nMost likely this means that the DVI file\n") +
|
||||
filename +
|
||||
i18n("\nis broken, or that it is not a DVI file."));
|
||||
|
|
14
dviwin.h
14
dviwin.h
|
@ -41,7 +41,7 @@ class dviWindow : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
dviWindow( int basedpi, double zoom, const char *mfmode, int makepk,
|
||||
dviWindow( int basedpi, double zoom, const QString & mfmode, int makepk,
|
||||
QWidget *parent=0, const char *name=0 );
|
||||
~dviWindow();
|
||||
|
||||
|
@ -58,11 +58,11 @@ public:
|
|||
int makePK() { return makepk; };
|
||||
void setResolution( int basedpi );
|
||||
int resolution() { return basedpi; };
|
||||
void setMetafontMode( const char * );
|
||||
const char * metafontMode() { return MetafontMode; };
|
||||
void setMetafontMode( const QString & );
|
||||
QString metafontMode() { return MetafontMode; };
|
||||
void setPaper(double w, double h);
|
||||
void setFontPath( const char * );
|
||||
const char * fontPath() { return FontPath; };
|
||||
void setFontPath( const QString & );
|
||||
QString fontPath() { return FontPath; };
|
||||
bool correctDVI(QString filename);
|
||||
unsigned char xxone();
|
||||
unsigned long xnum(unsigned char size);
|
||||
|
@ -82,7 +82,7 @@ public:
|
|||
void set_char(unsigned int cmd, unsigned int ch);
|
||||
void set_empty_char(unsigned int cmd, unsigned int ch);
|
||||
void set_no_char(unsigned int cmd, unsigned int ch);
|
||||
void applicationDoSpecial(char *cp);
|
||||
void applicationDoSpecial(char * cp);
|
||||
void special(long nbytes);
|
||||
void bang_special(QString cp);
|
||||
void quote_special(QString cp);
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
|
||||
|
||||
public slots:
|
||||
void setFile(const char *fname);
|
||||
void setFile(const QString & fname);
|
||||
void gotoPage(int page);
|
||||
void setZoom(double zoom);
|
||||
double zoom() { return _zoom; };
|
||||
|
|
|
@ -148,9 +148,9 @@ void dviWindow::xskip(long offset)
|
|||
}
|
||||
|
||||
|
||||
static void tell_oops(QString message)
|
||||
static void tell_oops(const QString & message)
|
||||
{
|
||||
dvi_oops_msg = (message), longjmp(dvi_env, 1); /* dvi_oops */
|
||||
dvi_oops_msg = (message.utf8()), longjmp(dvi_env, 1); /* dvi_oops */
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ void KDVIMultiPage::about()
|
|||
|
||||
void KDVIMultiPage::bugform()
|
||||
{
|
||||
KAboutData *kab = new KAboutData("kdvi", i18n("KDVI"), "0.9", 0, 0, 0, 0, 0);
|
||||
KAboutData *kab = new KAboutData("kdvi", I18N_NOOP("KDVI"), "0.9", 0, 0, 0, 0, 0);
|
||||
KBugReport *kbr = new KBugReport(0, true, kab );
|
||||
kbr->show();
|
||||
}
|
||||
|
@ -310,13 +310,13 @@ void KDVIMultiPage::preferencesChanged()
|
|||
}
|
||||
|
||||
|
||||
bool KDVIMultiPage::print(const QStrList &pages, int current)
|
||||
bool KDVIMultiPage::print(const QStringList &pages, int current)
|
||||
{
|
||||
Print * printdlg = new Print(window, "printdlg");
|
||||
|
||||
printdlg->setFile(m_file);
|
||||
printdlg->setCurrentPage(current+1, window->totalPages());
|
||||
printdlg->setMarkList(&pages);
|
||||
printdlg->setMarkList(pages);
|
||||
printdlg->exec();
|
||||
|
||||
delete printdlg;
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
|
||||
virtual bool preview(QPainter *p, int w, int h);
|
||||
|
||||
virtual bool print(const QStrList &pages, int current);
|
||||
virtual bool print(const QStringList &pages, int current);
|
||||
|
||||
protected:
|
||||
/// For internal use only. See the comments in kdvi_multipage.cpp, right
|
||||
|
|
17
print.cpp
17
print.cpp
|
@ -29,7 +29,7 @@ class DVIFile
|
|||
public:
|
||||
DVIFile(){}
|
||||
~DVIFile(){};
|
||||
void dviCopy(QString ifile, QString ofile, QStrList *pagelist,
|
||||
void dviCopy(const QString & ifile, const QString & ofile, const QStringList & pagelist,
|
||||
int first = 0, int last = 999999 );
|
||||
|
||||
};
|
||||
|
@ -76,10 +76,10 @@ void Print::setCurrentPage( int _page, int _totalpages )
|
|||
totalpages = _totalpages;
|
||||
}
|
||||
|
||||
void Print::setMarkList( const QStrList *_marklist )
|
||||
void Print::setMarkList( const QStringList & _marklist )
|
||||
{
|
||||
marklist = (QStrList *)_marklist;
|
||||
if ( !marklist || marklist->isEmpty() )
|
||||
marklist = _marklist;
|
||||
if ( marklist.isEmpty() )
|
||||
return;
|
||||
printMarked->setEnabled( TRUE );
|
||||
printMarked->setChecked( TRUE );
|
||||
|
@ -108,7 +108,7 @@ void Print::rangeToggled( bool on )
|
|||
#define put2(f,i) (f.putch(((i)>>8)&0xff), f.putch((i)&0xff))
|
||||
#define put4(f,i) (put2(f,i>>16), put2(f,(i)))
|
||||
|
||||
void DVIFile::dviCopy(QString ifile, QString ofile, QStrList *pagelist,
|
||||
void DVIFile::dviCopy(const QString & ifile, const QString & ofile, const QStringList & pagelist,
|
||||
int first, int last)
|
||||
{
|
||||
QFile in(ifile);
|
||||
|
@ -171,8 +171,7 @@ void DVIFile::dviCopy(QString ifile, QString ofile, QStrList *pagelist,
|
|||
int defsdone = 0;
|
||||
for ( n=0; n < tot; n++ ) // copy pages to out
|
||||
{
|
||||
if ( pagelist &&
|
||||
pagelist->find( QString().sprintf( "%4d", n + 1 ) ) < 0 )
|
||||
if ( pagelist.findIndex( QString().sprintf( "%4d", n + 1 ) ) < 0 )
|
||||
continue;
|
||||
if ( n + 1 < first || n + 1 > last )
|
||||
continue;
|
||||
|
@ -271,8 +270,8 @@ void Print::okPressed()
|
|||
|
||||
cmd += " &";
|
||||
|
||||
kdError() << "About to run: " << cmd.data() << endl;
|
||||
system( cmd );
|
||||
kdError() << "About to run: " << cmd << endl;
|
||||
system( QFile::encodeName(cmd) );
|
||||
accept();
|
||||
}
|
||||
|
||||
|
|
4
print.h
4
print.h
|
@ -30,7 +30,7 @@ public:
|
|||
|
||||
void setFile( QString file );
|
||||
void setCurrentPage( int page, int totalpages );
|
||||
void setMarkList( const QStrList *marklist );
|
||||
void setMarkList( const QStringList & marklist );
|
||||
|
||||
protected slots:
|
||||
|
||||
|
@ -45,7 +45,7 @@ protected slots:
|
|||
private:
|
||||
QString ifile,ofile;
|
||||
int curpage, totalpages, nup, printdest;
|
||||
QStrList *marklist;
|
||||
QStringList marklist;
|
||||
QString nupProgram, printMethod, spooler;
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue