[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdegraphics/kpaint
From: Nadeem Hasan <nhasan () nadmm ! com>
Date: 2003-01-11 23:50:17
[Download RAW message or body]
CVS commit by nhasan:
Cleanups and a small bugfix.
M +7 -16 canvas.cpp 1.34
M +8 -7 kpaint.cpp 1.108
M +3 -8 kpaint.h 1.42
--- kdegraphics/kpaint/canvas.cpp #1.33:1.34
@@ -354,6 +354,5 @@ void Canvas::setDepth(int d)
if (d != pix->depth()) {
- i= pix->convertToImage();
- i.convertDepth(d);
+ i= pix->convertToImage().convertDepth( d );
px= new QPixmap(pix->width(), pix->height(), d);
*px= i;
@@ -443,18 +442,10 @@ bool Canvas::load(const QString & filena
bool s;
QPixmap p;
- QPixmap q; // Fix UMR when reading transparent pixels (they hold junk)
- if (!format)
- {
- s = p.load(filename);
- }
- else
- {
s = p.load(filename, format);
- }
if (s)
{
- q.resize(p.size());
+ QPixmap q( p.size(), p.depth() ); // Fix UMR when reading transparent pixels (they hold junk)
q.fill(QColor("white"));
bitBlt(&q, 0, 0, &p);
--- kdegraphics/kpaint/kpaint.cpp #1.107:1.108
@@ -3,10 +3,9 @@
#include <qclipboard.h>
#include <qlayout.h>
-#include <qregexp.h>
-#include <qwidget.h>
#include <qsignalmapper.h>
+#include <qscrollview.h>
+
#include <config.h>
-#include <kaccel.h>
#include <kaction.h>
#include <kapplication.h>
@@ -18,5 +17,4 @@
#include <kedittoolbar.h>
#include <kfiledialog.h>
-#include <kiconloader.h>
#include <kimageio.h>
#include <kio/netaccess.h>
@@ -25,8 +23,9 @@
#include <kmessagebox.h>
#include <kmainwindow.h>
-#include <kstdaccel.h>
#include <kstdaction.h>
#include <ktoolbar.h>
#include <kurl.h>
+#include <ktempfile.h>
+#include <kstatusbar.h>
#include "canvas.h"
@@ -491,4 +490,6 @@ bool KPaint::loadFile(const KURL& _url)
format = KImageIO::type(url.fileName());
statusbar->changeItem(url.prettyURL(), ID_FILE_NAME);
+ statusbar->changeItem( QString( "%1 bpp" ).arg( m_canvas->getDepth() ),
+ ID_COLOR_DEPTH );
orig_width = m_canvas->width();
orig_height = m_canvas->height();
@@ -754,5 +755,5 @@ void KPaint::viewZoom( const QString &_s
{
QString z( _strZoom );
- z = z.replace( QRegExp( "%" ), "" );
+ z = z.replace( "%", "" );
z = z.simplifyWhiteSpace();
int new_zoom = z.toInt();
--- kdegraphics/kpaint/kpaint.h #1.41:1.42
@@ -9,13 +9,6 @@
#define KPAINT_H
-#include <qwidget.h>
-#include <qscrollview.h>
#include <kmainwindow.h>
-#include <ktoolbar.h>
-#include <kmenubar.h>
-#include <kstatusbar.h>
-#include <ktempfile.h>
-#include <qrect.h>
#include "canvas.h"
#include "manager.h"
@@ -34,4 +27,6 @@ class NavWidget;
class KColorButton;
class KToolbar;
+class KTempFile;
+class QScrollView;
class KPaint : public KMainWindow
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic