kis_view2.cpp 19.5 KB
Newer Older
1 2 3 4 5 6 7 8 9
/*
 *  This file is part of KimageShop^WKrayon^WKrita
 *
 *  Copyright (c) 1999 Matthias Elter  <me@kde.org>
 *                1999 Michael Koch    <koch@kde.org>
 *                1999 Carsten Pfeiffer <pfeiffer@kde.org>
 *                2002 Patrick Julien <freak@codepimps.org>
 *                2003-2007 Boudewijn Rempt <boud@valdyas.org>
 *                2004 Clarence Dang <dang@kde.org>
10
 *
11 12 13 14
 *  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.
15
 *
16 17 18 19
 *  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.
20
 *
21 22 23
 *  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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
 */
25 26
#include "kis_view2.h"

27
#include <QGridLayout>
28
#include <QRect>
29
#include <QWidget>
30 31 32
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QApplication>
33

34
#include <k3urldrag.h>
35 36
#include <kaction.h>
#include <klocale.h>
37
#include <kmenu.h>
38 39 40 41 42
#include <kparts/componentfactory.h>
#include <kparts/event.h>
#include <kparts/plugin.h>
#include <kservice.h>
#include <kservicetypetrader.h>
Aaron J. Seigo's avatar
Aaron J. Seigo committed
43 44
#include <kstandardaction.h>
#include <kstandardaction.h>
Boudewijn Rempt's avatar
Boudewijn Rempt committed
45
#include <ktogglefullscreenaction.h>
46 47 48
#include <kurl.h>
#include <kxmlguifactory.h>
#include <kxmlguifactory.h>
49
#include <kmessagebox.h>
50

51
#include <KoMainWindow.h>
52
#include <KoCanvasController.h>
53 54
#include <KoShapeManager.h>
#include <KoShape.h>
55
#include <KoSelection.h>
56
#include <KoToolBoxFactory.h>
57 58 59
#include <KoZoomHandler.h>
#include <KoViewConverter.h>
#include <KoView.h>
Thomas Zander's avatar
Thomas Zander committed
60
#include <KoToolDockerFactory.h>
61
#include <KoColorDocker.h>
62

63 64
#include <kactioncollection.h>

65
#include <kis_image.h>
66 67
#include <kis_undo_adapter.h>
#include <kis_layer.h>
68

Boudewijn Rempt's avatar
Boudewijn Rempt committed
69
#include "kis_config.h"
70
#include "kis_statusbar.h"
71
#include "kis_canvas2.h"
72 73 74
#include "kis_doc2.h"
#include "kis_factory2.h"
#include "kis_filter_manager.h"
75
#include "kis_resource_provider.h"
76
#include "kis_resource_provider.h"
77
#include "kis_selection_manager.h"
78
#include "kis_image_manager.h"
79
#include "kis_controlframe.h"
80
#include "kis_birdeye_box.h"
81 82 83
#include "kis_layerbox.h"
#include "kis_layer_manager.h"
#include "kis_zoom_manager.h"
84 85 86
#include "kis_grid_manager.h"
#include "kis_perspective_grid_manager.h"
#include "kis_mask_manager.h"
Boudewijn Rempt's avatar
Boudewijn Rempt committed
87
#include "kis_dlg_preferences.h"
88
#include "kis_group_layer.h"
89 90 91
#include "kis_custom_palette.h"
#include "ui_wdgpalettechooser.h"
#include "kis_resourceserver.h"
92
#include "kis_palette_docker.h"
93
#include "kis_layer_model.h"
94

95 96 97 98
class KisView2::KisView2Private {

public:

99 100 101 102 103 104 105 106 107 108 109 110 111 112
    KisView2Private()
        : canvas( 0 )
        , doc( 0 )
        , viewConverter( 0 )
        , canvasController( 0 )
        , resourceProvider( 0 )
        , filterManager( 0 )
        , statusBar( 0 )
        , selectionManager( 0 )
        , controlFrame( 0 )
        , birdEyeBox( 0 )
        , layerBox( 0 )
        , layerManager( 0 )
        , zoomManager( 0 )
113 114
        , imageManager( 0 )
        , maskManager( 0 )
115 116
        , gridManager( 0 )
        , perspectiveGridManager( 0 )
117 118 119 120 121
        {
        }

    ~KisView2Private()
        {
122
            KoToolManager::instance()->removeCanvasController( canvasController );
123
            delete canvas;
124
            delete filterManager;
125
            delete selectionManager;
126 127
            delete layerManager;
            delete zoomManager;
128 129
            delete imageManager;
            delete maskManager;
130 131
            delete gridManager;
            delete perspectiveGridManager;
132 133 134 135
        }

public:

136 137
    KisCanvas2 *canvas;
    KisDoc2 *doc;
138
    KoZoomHandler * viewConverter;
139
    KoCanvasController * canvasController;
140
    KisResourceProvider * resourceProvider;
141
    KisFilterManager * filterManager;
142
    KisStatusBar * statusBar;
143
    QAction * fullScreen;
144
    KisSelectionManager *selectionManager;
145
    KisControlFrame * controlFrame;
146
    KisBirdEyeBox * birdEyeBox;
147 148 149
    KisLayerBox * layerBox;
    KisLayerManager * layerManager;
    KisZoomManager * zoomManager;
150 151
    KisImageManager * imageManager;
    KisMaskManager * maskManager;
152 153
    KisGridManager * gridManager;
    KisPerspectiveGridManager * perspectiveGridManager;
154
};
155

156

157
KisView2::KisView2(KisDoc2 * doc, QWidget * parent)
158 159
    : KoView(doc, parent)
{
160

161
    setComponentData(KisFactory2::componentData(), false);
162

163 164 165 166
    if (!doc->isReadWrite())
        setXMLFile("krita_readonly.rc");
    else
        setXMLFile("krita.rc");
167

168 169
    if( mainWindow() )
        actionCollection()->addAction(KStandardAction::KeyBindings, "keybindings", mainWindow()->guiFactory(), SLOT( configureShortcuts() ));
170

171
    m_d = new KisView2Private();
172 173

    m_d->doc = doc;
174
    m_d->viewConverter = new KoZoomHandler();
175
    m_d->canvasController = new KoCanvasController( this );
176
    m_d->canvas = new KisCanvas2( m_d->viewConverter, this, doc->shapeController() );
177 178
    m_d->canvasController->setCanvas( m_d->canvas );
    m_d->resourceProvider = new KisResourceProvider( this );
179

180 181
    createActions();
    createManagers();
182
    createGUI();
183

184
    loadPlugins();
185

186 187
    // Wait for the async image to have loaded
    if ( m_d->doc->isLoading() ) {
188
        connect( m_d->doc, SIGNAL( sigLoadingFinished() ), this, SLOT( slotLoadingFinished() ) );
189 190
    }
    else {
191
        slotLoadingFinished();
192
    }
193

194
    setAcceptDrops(true);
195 196 197
}


198
KisView2::~KisView2()
199
{
200
    delete m_d->viewConverter;
201 202 203
    delete m_d;
}

204 205 206

void KisView2::dragEnterEvent(QDragEnterEvent *event)
{
207
    kDebug() << "KisView2::dragEnterEvent" << endl;
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
    // Only accept drag if we're not busy, particularly as we may
    // be showing a progress bar and calling qApp->processEvents().
    if (K3URLDrag::canDecode(event) && QApplication::overrideCursor() == 0) {
        event->accept();
    } else {
        event->ignore();
    }
}

void KisView2::dropEvent(QDropEvent *event)
{
    KUrl::List urls;

    if (K3URLDrag::decode(event, urls))
    {
        if (urls.count() > 0) {

            KMenu popup(this);
            popup.setObjectName("drop_popup");

228 229
            QAction *insertAsNewLayer = new QAction(i18n("Insert as New Layer"), &popup);
            QAction *insertAsNewLayers = new QAction(i18n("Insert as New Layers"), &popup);
230

231 232
            QAction *openInNewDocument = new QAction(i18n("Open in New Document"), &popup);
            QAction *openInNewDocuments = new QAction(i18n("Open in New Documents"), &popup);
233

234
            QAction *cancel = new QAction(i18n("Cancel"), &popup);
235 236 237

            if (urls.count() == 1) {
                if (!image().isNull()) {
238
                    popup.addAction(insertAsNewLayer);
239
                }
240
                popup.addAction(openInNewDocument);
241 242 243
            }
            else {
                if (!image().isNull()) {
244
                    popup.addAction(insertAsNewLayers);
245
                }
246
                popup.addAction(openInNewDocuments);
247 248
            }

249 250
            popup.addSeparator();
            popup.addAction(cancel);
251 252 253

            QAction *action = popup.exec(QCursor::pos());

254
            if (action != 0 && action != cancel) {
255 256 257
                for (KUrl::List::ConstIterator it = urls.begin (); it != urls.end (); ++it) {
                    KUrl url = *it;

258
                    if (action == insertAsNewLayer || action == insertAsNewLayers) {
259 260
                        m_d->imageManager->importImage(url);
                    } else {
261
                        Q_ASSERT(action == openInNewDocument || action == openInNewDocuments);
262 263 264 265 266 267 268 269 270 271 272 273

                        if (shell() != 0) {
                            shell()->openDocument(url);
                        }
                    }
                }
            }
        }
    }
}


274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
void KisView2::slotChildActivated(bool a) {

    // It should be so that the only part (child) we can activate, is
    // the current layer:
    KisImageSP img = image();
    if ( img && img->activeLayer())
    {
        if (a) {
            img->activeLayer()->activate();
        } else {
            img->activeLayer()->deactivate();
        }
    }

    KoView::slotChildActivated(a);
}


292 293 294 295 296 297
void KisView2::canvasAddChild(KoViewChild *child) {
    KoView::canvasAddChild(child);
    connect(this, SIGNAL(viewTransformationsChanged()), child, SLOT(reposition()));
}


298

299 300
KisImageSP KisView2::image()
{
301
    return m_d->doc->image();
302 303
}

304 305 306 307 308
KisResourceProvider * KisView2::resourceProvider()
{
    return m_d->resourceProvider;
}

309
KisCanvas2 * KisView2::canvasBase() const
Boudewijn Rempt's avatar
Boudewijn Rempt committed
310 311 312
{
    return m_d->canvas;
}
313

314 315 316 317 318
QWidget* KisView2::canvas() const
{
    return m_d->canvas->canvasWidget();
}

319 320 321 322 323
KisStatusBar * KisView2::statusBar() const
{
    return m_d->statusBar;
}

324 325 326 327 328
KisSelectionManager * KisView2::selectionManager()
{
    return m_d->selectionManager;
}

329 330 331 332 333
KoCanvasController * KisView2::canvasController()
{
    return m_d->canvasController;
}

334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
KisLayerManager * KisView2::layerManager()
{
    return m_d->layerManager;
}

KisZoomManager * KisView2::zoomManager()
{
    return m_d->zoomManager;
}

KisFilterManager * KisView2::filterManager()
{
    return m_d->filterManager;
}

Boudewijn Rempt's avatar
Boudewijn Rempt committed
349 350 351 352 353
KisImageManager * KisView2::imageManager()
{
    return m_d->imageManager;
}

354 355 356 357 358
KisUndoAdapter * KisView2::undoAdapter()
{
    return m_d->doc->undoAdapter();
}

359

360
void KisView2::slotLoadingFinished()
361
{
362
    disconnect(m_d->doc, SIGNAL(sigLoadingFinished()), this, SLOT(slotLoadingFinished()));
363

364 365
    KisImageSP img = image();

366
    m_d->canvas->setImageSize( img->width(), img->height() );
367

368 369 370 371
    if(m_d->statusBar) {
        m_d->statusBar->imageSizeChanged(img->width(), img->height());
    }

372 373
    m_d->zoomManager->setDocumentResolution(img->xRes(), img->yRes());

374 375
    m_d->layerManager->layersUpdated();
    updateGUI();
376

Thomas Zander's avatar
Thomas Zander committed
377
    KoToolDockerFactory toolDockerFactory;
378 379
    KoToolDocker * d =  dynamic_cast<KoToolDocker*>( createDockWidget( &toolDockerFactory ) );
    if(d)
380
        connect(m_d->canvasController, SIGNAL(toolOptionWidgetChanged(QWidget*)), d, SLOT(newOptionWidget(QWidget*)));
381
    else
382
        kWarning(41007) << "Could not create tool docker: " << d << endl;
383

384
    connectCurrentImage();
385 386
    img->blockSignals( false );
    img->unlock();
387

388
//     kDebug(41007) << "image finished loading, active layer: " << img->activeLayer() << ", root layer: " << img->rootLayer() << endl;
389

390 391
}

392

393 394
void KisView2::createGUI()
{
395
    KoToolManager::instance()->addController(m_d->canvasController);
396

397
    KoToolBoxFactory toolBoxFactory( m_d->canvasController, "Krita" );
398
    createDockWidget( &toolBoxFactory );
399

400 401 402 403
    KoColorDockerFactory colorDockerFactory;
    KoColorDocker * docker = qobject_cast<KoColorDocker*>( createDockWidget( &colorDockerFactory ) );
    Q_UNUSED( docker );

Sven Langkamp's avatar
Sven Langkamp committed
404
    KisPaletteDockerFactory paletteDockerFactory(this);
405 406
    KisPaletteDocker* paletteDocker = qobject_cast<KisPaletteDocker*>( createDockWidget( &paletteDockerFactory ) );
    Q_UNUSED( paletteDocker );
Sven Langkamp's avatar
Sven Langkamp committed
407

408 409
    KisBirdEyeBoxFactory birdeyeFactory(this);
    m_d->birdEyeBox = qobject_cast<KisBirdEyeBox*>( createDockWidget( &birdeyeFactory ) );
410

411
    KisLayerBoxFactory layerboxFactory;
412 413
    m_d->layerBox = qobject_cast<KisLayerBox*>( createDockWidget( &layerboxFactory ) );

414
    m_d->statusBar = KoView::statusBar() ? new KisStatusBar( KoView::statusBar(), this ) : 0;
415 416 417
    connect(m_d->canvasController, SIGNAL( documentMousePositionChanged(const QPointF & )), 
            m_d->statusBar, SLOT( documentMousePositionChanged( const QPointF & ) ) );

418
    m_d->controlFrame = new KisControlFrame( mainWindow(), this );
419

420
    show();
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441

    connect(m_d->layerBox, SIGNAL(sigRequestLayer(KisGroupLayerSP, KisLayerSP)),
            m_d->layerManager, SLOT(addLayer(KisGroupLayerSP, KisLayerSP)));

    connect(m_d->layerBox, SIGNAL(sigRequestGroupLayer(KisGroupLayerSP, KisLayerSP)),
            m_d->layerManager, SLOT(addGroupLayer(KisGroupLayerSP, KisLayerSP)));

    connect(m_d->layerBox, SIGNAL(sigRequestAdjustmentLayer(KisGroupLayerSP, KisLayerSP)),
            m_d->layerManager, SLOT(addAdjustmentLayer(KisGroupLayerSP, KisLayerSP)));

    connect(m_d->layerBox, SIGNAL(sigRequestLayerProperties(KisLayerSP)),
            m_d->layerManager, SLOT(showLayerProperties(KisLayerSP)));

    connect(m_d->layerBox, SIGNAL(sigOpacityChanged(int, bool)),
            m_d->layerManager, SLOT(layerOpacity(int, bool)));

    connect(m_d->layerBox, SIGNAL(sigOpacityFinishedChanging(int, int)),
            m_d->layerManager, SLOT(layerOpacityFinishedChanging(int, int)));

    connect(m_d->layerBox, SIGNAL(sigItemComposite(const KoCompositeOp*)),
            m_d->layerManager, SLOT(layerCompositeOp(const KoCompositeOp*)));
442 443 444
}


445 446
void KisView2::createActions()
{
447 448
    actionCollection()->addAction(KStandardAction::FullScreen, "full_screen", this, SLOT( slotUpdateFullScreen( bool )));
    actionCollection()->addAction(KStandardAction::Preferences,  "preferences", this, SLOT(slotPreferences()));
449 450 451 452

    KAction* action = new KAction(i18n("Edit Palette..."), this);
    actionCollection()->addAction("edit_palette", action );
    connect(action, SIGNAL(triggered()), this, SLOT(slotEditPalette()));
453 454 455 456 457 458
}


void KisView2::createManagers()
{
    // Create the managers for filters, selections, layers etc.
459 460 461
    // XXX: When the currentlayer changes, call updateGUI on all
    // managers

462
    m_d->filterManager = new KisFilterManager(this, m_d->doc);
463 464 465 466 467
    m_d->filterManager->setup(actionCollection());

    m_d->selectionManager = new KisSelectionManager( this, m_d->doc );
    m_d->selectionManager->setup( actionCollection() );

468 469 470
    m_d->layerManager = new KisLayerManager( this, m_d->doc );
    m_d->layerManager->setup( actionCollection() );

471 472
    // the following cast is not really safe, but better here than in the zoomManager
    // best place would be outside kisview too
473
    m_d->zoomManager = new KisZoomManager( this, m_d->viewConverter, m_d->canvasController);
474
    m_d->zoomManager->setup( actionCollection() );
475

476 477 478 479 480
    m_d->imageManager = new KisImageManager( this );
    m_d->imageManager->setup( actionCollection() );

    m_d->maskManager = new KisMaskManager( this );
    m_d->maskManager->setup( actionCollection() );
481

482 483 484 485 486 487
    m_d->gridManager = new KisGridManager( this );
    m_d->gridManager->setup( actionCollection() );

    m_d->perspectiveGridManager = new KisPerspectiveGridManager( this );
    m_d->perspectiveGridManager->setup( actionCollection() );

488 489
}

490 491 492 493 494 495 496
void KisView2::updateGUI()
{

    m_d->layerManager->updateGUI();
    m_d->selectionManager->updateGUI();
    m_d->filterManager->updateGUI();
    m_d->zoomManager->updateGUI();
497 498
    m_d->imageManager->updateGUI();
    m_d->maskManager->updateGUI();
499 500
    m_d->gridManager->updateGUI();
    m_d->perspectiveGridManager->updateGUI();
501 502 503 504 505 506 507 508

}


void KisView2::connectCurrentImage()
{
    KisImageSP img = image();
    if (img) {
509
//         kDebug(41007) << "Going to connect current image\n";
510

511 512
        connect(img.data(), SIGNAL(sigActiveSelectionChanged(KisImageSP)), m_d->selectionManager, SLOT(imgSelectionChanged(KisImageSP)));
        //connect(img.data(), SIGNAL(sigActiveSelectionChanged(KisImageSP)), this, SLOT(updateCanvas()));
513 514 515
        if( m_d->statusBar ) {
            connect(img.data(), SIGNAL(sigColorSpaceChanged(KoColorSpace *)), m_d->statusBar, SLOT(updateStatusBarProfileLabel()));
            connect(img.data(), SIGNAL(sigProfileChanged(KoColorProfile * )), m_d->statusBar, SLOT(updateStatusBarProfileLabel()));
516
            connect(img.data(), SIGNAL(sigSizeChanged(qint32, qint32)), m_d->statusBar, SLOT(imageSizeChanged(qint32, qint32)));
517
        }
518 519

        connect(img.data(), SIGNAL(sigLayersChanged(KisGroupLayerSP)), m_d->layerManager, SLOT(layersUpdated()));
520
        connect(img.data(), SIGNAL(sigMaskInfoChanged()), m_d->maskManager, SLOT(maskUpdated()));
521 522 523 524 525 526 527
        connect(img.data(), SIGNAL(sigLayerAdded(KisLayerSP)), m_d->layerManager, SLOT(layersUpdated()));
        connect(img.data(), SIGNAL(sigLayerRemoved(KisLayerSP, KisGroupLayerSP, KisLayerSP)), m_d->layerManager, SLOT(layersUpdated()));
        connect(img.data(), SIGNAL(sigLayerMoved(KisLayerSP, KisGroupLayerSP, KisLayerSP)), m_d->layerManager, SLOT(layersUpdated()));
        connect(img.data(), SIGNAL(sigLayerActivated(KisLayerSP)), m_d->layerManager, SLOT(layersUpdated()));
        connect(img.data(), SIGNAL(sigLayerActivated(KisLayerSP)), m_d->canvas, SLOT(updateCanvas()));
        connect(img.data(), SIGNAL(sigLayerPropertiesChanged(KisLayerSP)), m_d->layerManager, SLOT(layersUpdated()));

528
        m_d->maskManager->maskUpdated();
529
    }
530
    m_d->canvas->connectCurrentImage();
531
    if( m_d->layerBox )
532
        m_d->layerBox->setImage( img, m_d->doc->layerModel() );
533
    if( m_d->birdEyeBox )
534
        m_d->birdEyeBox->setImage( img );
535 536 537 538 539 540 541 542 543 544 545 546

}

void KisView2::disconnectCurrentImage()
{
    KisImageSP img = image();

    if (img) {

        img->disconnect(this);
        img->disconnect( m_d->layerManager );
        img->disconnect( m_d->selectionManager );
547 548
        if( m_d->statusBar )
            img->disconnect( m_d->statusBar );
549

550
        if( m_d->layerBox )
551
            m_d->layerBox->setImage(KisImageSP(0), 0);
552 553
        if( m_d->birdEyeBox )
            m_d->birdEyeBox->setImage(KisImageSP(0));
554
        m_d->canvas->disconnectCurrentImage();
555 556 557
    }
}

Boudewijn Rempt's avatar
Boudewijn Rempt committed
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573
void KisView2::slotUpdateFullScreen(bool toggle)
{
    if (KoView::shell()) {

        Qt::WindowStates newState = KoView::shell()->windowState();

        if (toggle) {
            newState |= Qt::WindowFullScreen;
        } else {
            newState &= ~Qt::WindowFullScreen;
        }

        KoView::shell()->setWindowState(newState);
    }
}

Boudewijn Rempt's avatar
Boudewijn Rempt committed
574 575
void KisView2::slotPreferences()
{
576 577
    if (PreferencesDialog::editPreferences()) {
        m_d->canvas->resetCanvas();
Boudewijn Rempt's avatar
Boudewijn Rempt committed
578 579 580
    }
}

581 582
void KisView2::slotEditPalette()
{
583
    KisResourceServerBase* srv = KisResourceServerRegistry::instance()->value("PaletteServer");
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603
    if (!srv) {
        return;
    }
    QList<KisResource*> resources = srv->resources();
    QList<KisPalette*> palettes;

    foreach (KisResource *resource, resources) {
        KisPalette* palette = dynamic_cast<KisPalette*>(resource);
        palettes.append(palette);
    }

    KDialog* base = new KDialog(this );
    base->setCaption(  i18n("Edit Palette") );
    base->setButtons( KDialog::Ok);
    base->setDefaultButton( KDialog::Ok);
    KisCustomPalette* cp = new KisCustomPalette(palettes, base, "edit palette", i18n("Edit Palette"), this);
    base->setMainWidget(cp);
    base->show();
}

604 605 606 607 608 609 610 611 612 613 614 615 616 617
void KisView2::loadPlugins()
{
    // Load all plugins
    KService::List offers = KServiceTypeTrader::self()->query(QString::fromLatin1("Krita/ViewPlugin"),
                                                              QString::fromLatin1("(Type == 'Service') and "
                                                                                  "([X-Krita-Version] == 3)"));
    KService::List::ConstIterator iter;
    for(iter = offers.begin(); iter != offers.end(); ++iter)
    {
        KService::Ptr service = *iter;
        int errCode = 0;
        KParts::Plugin* plugin =
            KService::createInstance<KParts::Plugin> ( service, this, QStringList(), &errCode);
        if ( plugin ) {
618
//             kDebug(41006) << "found plugin " << service->property("Name").toString() << "\n";
619 620 621
            insertChildClient(plugin);
        }
        else {
622
//             kDebug(41006) << "found plugin " << service->property("Name").toString() << ", " << errCode << "\n";
623 624
            if( errCode == KLibLoader::ErrNoLibrary)
            {
625
                kWarning() << " Error loading plugin was : ErrNoLibrary " << KLibLoader::self()->lastErrorMessage() << endl;
626 627 628 629
            }
        }
    }
}
Boudewijn Rempt's avatar
Boudewijn Rempt committed
630

Peter Simonsson's avatar
Peter Simonsson committed
631 632 633 634
KisDoc2 * KisView2::document() const
{
    return m_d->doc;
}
635

636
#include "kis_view2.moc"