die, duplicated code.

svn path=/trunk/kdegraphics/kdvi/; revision=38694
This commit is contained in:
David Faure 2000-01-19 01:35:02 +00:00
parent cafce5e100
commit 681dd53ed7
3 changed files with 2 additions and 105 deletions

View file

@ -19,7 +19,7 @@ libkdvi_la_SOURCES = kdvi.cpp dviwin.cpp marklist.cpp prefs.cpp print.cpp\
printData.cpp printSetup.cpp printSetupData.cpp pushbutton.cpp\
scrbox.cpp kdvi_miniwidget.cpp kdvi_view.cpp kbrowser.moc.cc\
psheader.c dvi_draw.c dvi_init.c font-open.c gf.c new.c pk.c psgs.c\
special.c util.c vf.c # konq_progressproxy.cc
special.c util.c vf.c
kdvi_SOURCES = main.cpp
@ -36,7 +36,7 @@ kdvi_LDADD = libkdvi.la
## this option you can leave out. Just, if you use "make dist", you need it
noinst_HEADERS = c-openmx.h dvi.h dviwin.h kdvi.h marklist.h oconfig.h\
prefs.h print.h printData.h printSetup.h printSetupData.h pushbutton.h\
scrbox.h xdvi.h kdvi_miniwidget.h kdvi_view.h # konq_progressproxy.h
scrbox.h xdvi.h kdvi_miniwidget.h kdvi_view.h
messages:
$(XGETTEXT) -C -ki18n -x $(includedir)/kde.pot *.cpp && mv messages.po $(podir)/kdvi.pot

View file

@ -1,56 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "konq_progressproxy.h"
#include <kbrowser.h>
#include <kio_job.h>
KonqProgressProxy::KonqProgressProxy( BrowserView *view, KIOJob *job )
: QObject( job )
{
connect( job, SIGNAL( sigTotalSize( int, unsigned long ) ), this, SLOT( slotTotalSize( int, unsigned long ) ) );
connect( job, SIGNAL( sigProcessedSize( int, unsigned long ) ), this, SLOT( slotProcessedSize( int, unsigned long ) ) );
connect( job, SIGNAL( sigSpeed( int, unsigned long ) ), this, SLOT( slotSpeed( int, unsigned long ) ) );
connect( this, SIGNAL( loadingProgress( int ) ), view, SIGNAL( loadingProgress( int ) ) );
connect( this, SIGNAL( speedProgress( int ) ), view, SIGNAL( speedProgress( int ) ) );
m_ulTotalDocumentSize = 0;
}
void KonqProgressProxy::slotTotalSize( int, unsigned long size )
{
m_ulTotalDocumentSize = size;
}
void KonqProgressProxy::slotProcessedSize( int, unsigned long size )
{
if ( m_ulTotalDocumentSize > (unsigned long)0 )
emit loadingProgress( size * 100 / m_ulTotalDocumentSize );
}
void KonqProgressProxy::slotSpeed( int, unsigned long bytesPerSecond )
{
emit speedProgress( (long int)bytesPerSecond );
}
#include "konq_progressproxy.moc"

View file

@ -1,47 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __konq_progressproxy_h__
#define __konq_progressproxy_h__
#include <qobject.h>
class BrowserView;
class KIOJob;
class KonqProgressProxy : public QObject
{
Q_OBJECT
public:
KonqProgressProxy( BrowserView *view, KIOJob *job );
protected slots:
void slotTotalSize( int, unsigned long size );
void slotProcessedSize( int, unsigned long size );
void slotSpeed( int, unsigned long bytesPerSecond );
signals:
void loadingProgress( int percent );
void speedProgress( int bytesPerSecond );
private:
unsigned long m_ulTotalDocumentSize;
};
#endif