Commit d7326dbf authored by Adrian Page's avatar Adrian Page

Fix errors.

svn path=/trunk/koffice/; revision=527128
parent efa705b3
......@@ -99,11 +99,8 @@ kde4_add_ui3_files(kritaui_LIB_SRCS
wdgbirdeye.ui
wdgcolorsettings.ui
wdgdisplaysettings.ui
wdggeneralsettings.ui
wdglayerproperties.ui
wdglayerbox.ui
wdgnewimage.ui
wdgperformancesettings.ui
wdgselectionoptions.ui
wdgshapeoptions.ui
wdgpressuresettings.ui
......@@ -112,12 +109,15 @@ kde4_add_ui3_files(kritaui_LIB_SRCS
wdgcustompattern.ui
wdgtextbrush.ui
wdgpalettechooser.ui
wdggridsettings.ui
wdgtabletdevicesettings.ui
wdgtabletsettings.ui )
kde4_add_ui_files(kritaui_LIB_SRCS
wdgautogradient.ui
wdgnewimage.ui
wdggeneralsettings.ui
wdgperformancesettings.ui
wdggridsettings.ui
)
include_directories(
......@@ -126,6 +126,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/krita/sdk
${KOFFICEUI_INCLUDES}
${KOPAINTER_INCLUDES}
${KOPALETTE_INCLUDES}
)
kde4_add_dcop_skels(kritaui_LIB_SRCS kis_doc_iface.h kis_view_iface.h )
......
......@@ -85,36 +85,39 @@ void KisColorCup::slotClicked()
QSize KisColorCup::sizeHint() const
{
return style().sizeFromContents(QStyle::CT_PushButton, this, QSize(24, 24)).
expandedTo(QApplication::globalStrut());
#warning kde4 port
// The style api has changed a bit. Disabled for now.
return QSize(24, 24);
// return style().sizeFromContents(QStyle::CT_PushButton, this, QSize(24, 24)).
// expandedTo(QApplication::globalStrut());
}
void KisColorCup::drawButtonLabel( QPainter *painter )
void KisColorCup::drawButtonLabel( QPainter */*painter*/ )
{
int x, y, w, h;
QRect r = style().subRect( QStyle::SR_PushButtonContents, this );
r.rect(&x, &y, &w, &h);
int margin = 2; //style().pixelMetric( QStyle::PM_ButtonMargin, this );
x += margin;
y += margin;
w -= 2*margin;
h -= 2*margin;
if (isOn() || isDown()) {
x += style().pixelMetric( QStyle::PM_ButtonShiftHorizontal, this );
y += style().pixelMetric( QStyle::PM_ButtonShiftVertical, this );
}
qDrawShadePanel( painter, x, y, w, h, colorGroup(), true, 1, NULL);
if ( m_color.isValid() )
painter->fillRect( x+1, y+1, w-2, h-2, m_color );
if ( hasFocus() ) {
QRect focusRect = style().subRect( QStyle::SR_PushButtonFocusRect, this );
style().drawPrimitive( QStyle::PE_FocusRect, painter, focusRect, colorGroup() );
}
// int x, y, w, h;
// QRect r = style().subRect( QStyle::SR_PushButtonContents, this );
// r.rect(&x, &y, &w, &h);
//
// int margin = 2; //style().pixelMetric( QStyle::PM_ButtonMargin, this );
// x += margin;
// y += margin;
// w -= 2*margin;
// h -= 2*margin;
//
// if (isOn() || isDown()) {
// x += style().pixelMetric( QStyle::PM_ButtonShiftHorizontal, this );
// y += style().pixelMetric( QStyle::PM_ButtonShiftVertical, this );
// }
//
// qDrawShadePanel( painter, x, y, w, h, colorGroup(), true, 1, NULL);
// if ( m_color.isValid() )
// painter->fillRect( x+1, y+1, w-2, h-2, m_color );
//
// if ( hasFocus() ) {
// QRect focusRect = style().subRect( QStyle::SR_PushButtonFocusRect, this );
// style().drawPrimitive( QStyle::PE_FocusRect, painter, focusRect, colorGroup() );
// }
//
}
#include "kis_color_cup.moc"
......@@ -17,6 +17,8 @@
*/
#include <limits.h>
#include <QFont>
#include <kglobalsettings.h>
#include <kconfig.h>
#include <kglobal.h>
......@@ -132,7 +134,7 @@ enumCursorStyle KisConfig::getDefaultCursorStyle() const
void KisConfig::setCursorStyle(enumCursorStyle style)
{
m_cfg->writeEntry("cursorStyleDef", style);
m_cfg->writeEntry("cursorStyleDef", (int)style);
}
......@@ -330,14 +332,14 @@ float KisConfig::dockerFontSize()
float KisConfig::getDefaultDockerFontSize()
{
float ps = qMin(9, KGlobalSettings::generalFont().pointSize() * 0.8);
float ps = qMin((double)9, KGlobalSettings::generalFont().pointSize() * 0.8);
if (ps < 6) ps = 6;
return ps;
}
void KisConfig::setDockerFontSize(float size)
{
m_cfg->writeEntry("palettefontsize", size);
m_cfg->writeEntry("palettefontsize", (double)size);
}
quint32 KisConfig::getGridMainStyle()
......
......@@ -42,6 +42,7 @@
#include <klocale.h>
#include <koFrameButton.h>
#include <kactioncollection.h>
#include <kactionclasses.h>
#include "kis_resourceserver.h"
#include "kis_controlframe.h"
......@@ -68,7 +69,7 @@
KisPopupFrame::KisPopupFrame(QWidget * parent, const char* name)
: Q3PopupMenu(parent, name)
{
setFocusPolicy(StrongFocus);
setFocusPolicy(Qt::StrongFocus);
}
void KisPopupFrame::keyPressEvent(QKeyEvent * e)
......
......@@ -26,6 +26,7 @@
#include <kcursor.h>
#include <kiconloader.h>
#include <kinstance.h>
#include <kstandarddirs.h>
#include "kis_cursor.h"
......
......@@ -19,8 +19,8 @@
#ifndef KIS_CUSTOM_IMAGE_WIDGET_H
#define KIS_CUSTOM_IMAGE_WIDGET_H
#include <wdgnewimage.h>
#include "kis_global.h"
#include "kis_dlg_image_properties.h"
class KisDoc;
class KisID;
......
......@@ -42,7 +42,6 @@
#include "kis_id.h"
#include "kis_cmb_idlist.h"
#include "squeezedcombobox.h"
#include "wdgnewimage.h"
KisDlgImageProperties::KisDlgImageProperties(KisImageSP image, QWidget *parent, const char *name)
: super(parent, name, true, "", Ok | Cancel)
......
......@@ -21,11 +21,19 @@
#include <kdialogbase.h>
#include <kis_types.h>
#include "wdgnewimage.h"
class WdgNewImage;
class Q3ButtonGroup;
class KisID;
class WdgNewImage : public QWidget, public Ui::WdgNewImage
{
Q_OBJECT
public:
WdgNewImage(QWidget *parent) : QWidget(parent) { setupUi(this); }
};
class KisDlgImageProperties : public KDialogBase {
typedef KDialogBase super;
Q_OBJECT
......
......@@ -735,7 +735,7 @@ void GridSettingsTab::linkSpacingToggled(bool b)
PreferencesDialog::PreferencesDialog( QWidget* parent, const char* name )
: KDialogBase( IconList, i18n("Preferences"), Ok | Cancel | Help | Default /*| Apply*/, Ok, parent, name, true, true )
{
Q3VBox *vbox;
KVBox *vbox;
vbox = addVBoxPage( i18n( "General"), i18n( "General"), BarIcon( "misc", K3Icon::SizeMedium ));
m_general = new GeneralTab( vbox );
......
......@@ -46,6 +46,15 @@ class KisID;
/**
* "General"-tab for preferences dialog
*/
class WdgGeneralSettings : public QWidget, public Ui::WdgGeneralSettings
{
Q_OBJECT
public:
WdgGeneralSettings(QWidget *parent, const char *name) : QWidget(parent) { setObjectName(name); setupUi(this); }
};
class GeneralTab : public WdgGeneralSettings
{
Q_OBJECT
......@@ -86,6 +95,15 @@ public:
/**
* "Performance"-tab for preferences dialog
*/
class WdgPerformanceSettings : public QWidget, public Ui::WdgPerformanceSettings
{
Q_OBJECT
public:
WdgPerformanceSettings(QWidget *parent, const char *name) : QWidget(parent) { setObjectName(name); setupUi(this); }
};
class PerformanceTab : public WdgPerformanceSettings
{
Q_OBJECT
......@@ -218,6 +236,15 @@ protected slots:
/**
* Grid settings tab for preferences dialog
*/
class WdgGridSettingsBase : public QWidget, public Ui::WdgGridSettingsBase
{
Q_OBJECT
public:
WdgGridSettingsBase(QWidget *parent) : QWidget(parent) { setupUi(this); }
};
class GridSettingsTab : public WdgGridSettingsBase {
Q_OBJECT
public:
......
......@@ -285,7 +285,7 @@ QDomDocument KisDoc::saveXML()
QDomElement root = doc.documentElement();
root.setAttribute("editor", "Krita");
root.setAttribute("depth", sizeof(quint8));
root.setAttribute("depth", (uint)sizeof(quint8));
root.setAttribute("syntaxVersion", "1");
root.appendChild(saveImage(doc, m_currentImage));
......@@ -403,12 +403,12 @@ KisImageSP KisDoc::loadImage(const QDomElement& element)
if ((attr = element.attribute("mime")) == NATIVE_MIMETYPE) {
if ((name = element.attribute("name")).isNull())
return 0;
return KisImageSP(0);
if ((attr = element.attribute("width")).isNull())
return 0;
return KisImageSP(0);
width = attr.toInt();
if ((attr = element.attribute("height")).isNull())
return 0;
return KisImageSP(0);
height = attr.toInt();
description = element.attribute("description");
......@@ -443,17 +443,17 @@ KisImageSP KisDoc::loadImage(const QDomElement& element)
if (cs == 0) {
kWarning(DBG_AREA_FILE) << "Could not open colorspace\n";
return 0;
return KisImageSP(0);
}
img = new KisImage(this, width, height, cs, name);
img->blockSignals(true); // Don't send out signals while we're building the image
Q_CHECK_PTR(img);
connect( img, SIGNAL( sigImageModified() ), this, SLOT( slotImageUpdated() ));
connect( img.data(), SIGNAL( sigImageModified() ), this, SLOT( slotImageUpdated() ));
img->setDescription(description);
img->setResolution(xres, yres);
loadLayers(element, img, img->rootLayer().data());
loadLayers(element, img, img->rootLayer());
}
......@@ -479,7 +479,7 @@ void KisDoc::loadLayers(const QDomElement& element, KisImageSP img, KisGroupLaye
}
else {
img->nextLayerName(); // Make sure the nameserver is current with the number of layers.
img->addLayer(layer, parent, 0);
img->addLayer(layer, parent, KisLayerSP(0));
}
}
}
......@@ -502,19 +502,19 @@ KisLayerSP KisDoc::loadLayer(const QDomElement& element, KisImageSP img)
bool locked;
if ((name = element.attribute("name")).isNull())
return 0;
return KisLayerSP(0);
if ((attr = element.attribute("x")).isNull())
return 0;
return KisLayerSP(0);
x = attr.toInt();
if ((attr = element.attribute("y")).isNull())
return 0;
return KisLayerSP(0);
y = attr.toInt();
if ((attr = element.attribute("opacity")).isNull())
return 0;
return KisLayerSP(0);
if ((opacity = attr.toInt()) < 0 || opacity > quint8_MAX)
opacity = OPACITY_OPAQUE;
......@@ -530,7 +530,7 @@ KisLayerSP KisDoc::loadLayer(const QDomElement& element, KisImageSP img)
}
if (!compositeOp.isValid()) {
return 0;
return KisLayerSP(0);
}
if ((attr = element.attribute("visible")).isNull())
......@@ -551,16 +551,16 @@ KisLayerSP KisDoc::loadLayer(const QDomElement& element, KisImageSP img)
return loadPaintLayer(element, img, name, x, y, opacity, visible, locked, compositeOp);
if(attr == "grouplayer")
return loadGroupLayer(element, img, name, x, y, opacity, visible, locked, compositeOp).data();
return KisLayerSP(loadGroupLayer(element, img, name, x, y, opacity, visible, locked, compositeOp).data());
if(attr == "adjustmentlayer")
return loadAdjustmentLayer(element, img, name, x, y, opacity, visible, locked, compositeOp).data();
return KisLayerSP(loadAdjustmentLayer(element, img, name, x, y, opacity, visible, locked, compositeOp).data());
if(attr == "partlayer")
return loadPartLayer(element, img, name, x, y, opacity, visible, locked, compositeOp).data();
return KisLayerSP(loadPartLayer(element, img, name, x, y, opacity, visible, locked, compositeOp).data());
kWarning(DBG_AREA_FILE) << "Specified layertype is not recognised\n";
return 0;
return KisLayerSP(0);
}
......@@ -581,7 +581,7 @@ KisLayerSP KisDoc::loadPaintLayer(const QDomElement& element, KisImageSP img,
// use default profile - it will be replaced later in completLoading
cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(colorspacename,"");
layer = new KisPaintLayer(img, name, opacity, cs);
layer = new KisPaintLayer(img.data(), name, opacity, cs);
Q_CHECK_PTR(layer);
layer->setCompositeOp(compositeOp);
......@@ -604,7 +604,7 @@ KisLayerSP KisDoc::loadPaintLayer(const QDomElement& element, KisImageSP img,
layer->paintDevice()->exifInfo()->load(e);
}
}
return layer.data();
return KisLayerSP(layer.data());
}
KisGroupLayerSP KisDoc::loadGroupLayer(const QDomElement& element, KisImageSP img,
......@@ -614,7 +614,7 @@ KisGroupLayerSP KisDoc::loadGroupLayer(const QDomElement& element, KisImageSP im
QString attr;
KisGroupLayerSP layer;
layer = new KisGroupLayer(img, name, opacity);
layer = new KisGroupLayer(img.data(), name, opacity);
Q_CHECK_PTR(layer);
layer->setCompositeOp(compositeOp);
......@@ -639,19 +639,19 @@ KisAdjustmentLayerSP KisDoc::loadAdjustmentLayer(const QDomElement& element, Kis
if ((filtername = element.attribute("filtername")).isNull()) {
// XXX: Invalid adjustmentlayer! We should warn about it!
kWarning(DBG_AREA_FILE) << "No filter in adjustment layer" << endl;
return 0;
return KisAdjustmentLayerSP(0);
}
KisFilter * f = KisFilterRegistry::instance()->get(filtername);
KisFilterSP f = KisFilterRegistry::instance()->get(filtername);
if (!f) {
kWarning(DBG_AREA_FILE) << "No filter for filtername " << filtername << "\n";
return 0; // XXX: We don't have this filter. We should warn about it!
return KisAdjustmentLayerSP(0); // XXX: We don't have this filter. We should warn about it!
}
KisFilterConfiguration * kfc = f->configuration();
// We'll load the configuration and the selection later.
layer = new KisAdjustmentLayer(img, name, kfc, 0);
layer = KisAdjustmentLayerSP(new KisAdjustmentLayer(img, name, kfc, KisSelectionSP(0)));
Q_CHECK_PTR(layer);
layer->setCompositeOp(compositeOp);
......@@ -679,13 +679,13 @@ KisPartLayerSP KisDoc::loadPartLayer(const QDomElement& element, KisImageSP img,
if (partElement.isNull()) {
kWarning() << "loadPartLayer failed with partElement isNull" << endl;
return 0;
return KisPartLayerSP(0);
}
child->load(partElement);
insertChild(child);
KisPartLayerSP layer = new KisPartLayerImpl(img, child);
KisPartLayerSP layer = KisPartLayerSP(new KisPartLayerImpl(img, child));
Q_CHECK_PTR(layer);
layer->setCompositeOp(compositeOp);
......@@ -778,7 +778,7 @@ bool KisDoc::completeLoading(KoStore *store)
store->open(location);
data = store->read(store->size());
store->close();
(m_currentImage)->addAnnotation(new KisAnnotation("exif", "", data));
(m_currentImage)->addAnnotation(KisAnnotationSP(new KisAnnotation("exif", "", data)));
}
// icc profile
location = external ? QString::null : uri;
......
......@@ -218,7 +218,7 @@ private:
qint32 m_conversionDepth;
int m_ioProgressTotalSteps;
int m_ioProgressBase;
QMap<KisLayerSP, QString> m_layerFilenames; // temp storage during load
QMap<KisLayer *, QString> m_layerFilenames; // temp storage during load
};
......
......@@ -34,7 +34,7 @@
class KisLoadVisitor : public KisLayerVisitor {
public:
KisLoadVisitor(KisImageSP img, KoStore *store, QMap<KisLayerSP, QString> &layerFilenames) :
KisLoadVisitor(KisImageSP img, KoStore *store, QMap<KisLayer *, QString> &layerFilenames) :
KisLayerVisitor(),
m_layerFilenames(layerFilenames)
{
......@@ -94,7 +94,7 @@ public:
virtual bool visit(KisGroupLayer *layer)
{
KisLoadVisitor visitor(m_img,m_store ,m_layerFilenames);
KisLoadVisitor visitor(m_img, m_store, m_layerFilenames);
if(m_external)
visitor.setExternalUri(m_uri);
......@@ -125,7 +125,7 @@ public:
location += m_img->name() + "/layers/" + m_layerFilenames[layer] + ".selection";
if (m_store->hasFile(location)) {
m_store->open(location);
KisSelectionSP selection = new KisSelection();
KisSelectionSP selection = KisSelectionSP(new KisSelection());
if (!selection->read(m_store)) {
selection->disconnect();
m_store->close();
......@@ -145,7 +145,7 @@ public:
m_store->open(location);
data = m_store->read(m_store->size());
m_store->close();
if (data) {
if (!data.isEmpty()) {
KisFilterConfiguration * kfc = layer->filter();
kfc->fromXML(QString(data));
}
......@@ -160,7 +160,7 @@ private:
KoStore *m_store;
bool m_external;
QString m_uri;
QMap<KisLayerSP, QString> m_layerFilenames;
QMap<KisLayer *, QString> m_layerFilenames;
};
#endif // KIS_LOAD_VISITOR_H_
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment