~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to core/utilities/imageeditor/editor/editorwindow.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * http://www.digikam.org
5
5
 *
6
6
 * Date        : 2006-01-20
7
 
 * Description : main image editor GUI implementation
 
7
 * Description : core image editor GUI implementation
8
8
 *
9
 
 * Copyright (C) 2006-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
10
 
 * Copyright (C) 2009-2011 by Andi Clemens <andi dot clemens at googlemail dot com>
 
9
 * Copyright (C) 2006-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 * Copyright (C) 2009-2011 by Andi Clemens <andi dot clemens at gmail dot com>
11
11
 *
12
12
 * This program is free software; you can redistribute it
13
13
 * and/or modify it under the terms of the GNU General
42
42
#include <QGroupBox>
43
43
#include <QHBoxLayout>
44
44
#include <QImageReader>
 
45
#include <QKeyEvent>
45
46
#include <QLabel>
46
47
#include <QLayout>
47
48
#include <QPointer>
48
49
#include <QProgressBar>
49
 
#include <QSignalMapper>
50
50
#include <QSplitter>
51
51
#include <QTimer>
52
52
#include <QToolButton>
63
63
#include <kactioncategory.h>
64
64
#endif
65
65
#include <kactioncollection.h>
66
 
#include <kactionmenu.h>
67
66
#include <kapplication.h>
68
67
#include <kconfig.h>
69
68
#include <kcursor.h>
77
76
#include <kiconloader.h>
78
77
#include <kimageio.h>
79
78
#include <klocale.h>
80
 
#include <kmenu.h>
81
79
#include <kmenubar.h>
82
80
#include <kmessagebox.h>
83
81
#include <knotifyconfigwidget.h>
115
113
// Local includes
116
114
 
117
115
#include "albumsettings.h"
 
116
#include "actioncategorizedview.h"
118
117
#include "buttonicondisabler.h"
119
118
#include "canvas.h"
120
119
#include "categorizeditemmodel.h"
121
120
#include "colorcorrectiondlg.h"
122
 
#include "dimginterface.h"
 
121
#include "editorcore.h"
123
122
#include "dlogoaction.h"
124
123
#include "dmetadata.h"
125
124
#include "dzoombar.h"
138
137
#include "imagedialog.h"
139
138
#include "imageplugin.h"
140
139
#include "imagepluginloader.h"
141
 
#include "iofilesettingscontainer.h"
 
140
#include "iofilesettings.h"
142
141
#include "libsinfodlg.h"
143
142
#include "loadingcacheinterface.h"
144
143
#include "printhelper.h"
145
144
#include "jpegsettings.h"
146
145
#include "pngsettings.h"
147
 
#include "savingcontextcontainer.h"
 
146
#include "savingcontext.h"
148
147
#include "sidebar.h"
149
148
#include "slideshowsettings.h"
150
149
#include "softproofdialog.h"
153
152
#include "thumbnailsize.h"
154
153
#include "thumbnailloadthread.h"
155
154
#include "triplechoicedialog.h"
 
155
#include "undostate.h"
156
156
#include "versionmanager.h"
157
157
 
158
158
namespace Digikam
161
161
const QString EditorWindow::CONFIG_GROUP_NAME = "ImageViewer Settings";
162
162
 
163
163
EditorWindow::EditorWindow(const char* name)
164
 
    : KXmlGuiWindow(0), d(new EditorWindowPriv)
 
164
    : KXmlGuiWindow(0), d(new Private)
165
165
{
166
166
    setObjectName(name);
167
167
    setWindowFlags(Qt::Window);
204
204
 
205
205
    d->exposureSettings        = new ExposureSettingsContainer();
206
206
    d->toolIface               = new EditorToolIface(this);
207
 
    m_IOFileSettings           = new IOFileSettingsContainer();
 
207
    m_IOFileSettings           = new IOFileSettings();
208
208
    d->waitingLoop             = new QEventLoop(this);
209
209
}
210
210
 
628
628
    actionCollection()->addAction("editorwindow_selecttool", m_selectToolsAction);
629
629
    // setup is done after image plugins are loaded
630
630
 
631
 
    m_applyToolAction = new KAction(KStandardGuiItem::ok().icon(), i18n("Ok"), this);
 
631
    m_applyToolAction = new KAction(KStandardGuiItem::ok().icon(), i18n("OK"), this);
632
632
    actionCollection()->addAction("editorwindow_applytool", m_applyToolAction);
633
633
    m_applyToolAction->setShortcut(KShortcut(Qt::Key_Return));
634
634
    connect(m_applyToolAction, SIGNAL(triggered()), this, SLOT(slotApplyTool()));
646
646
    toggleToolActions();
647
647
}
648
648
 
649
 
void EditorWindow::EditorWindowPriv::plugNewVersionInFormatAction(EditorWindow* q, KActionMenu* menuAction,
650
 
                                                                  const QString& text, const QString& format)
651
 
{
652
 
    if (!formatMenuActionMapper)
653
 
    {
654
 
        formatMenuActionMapper = new QSignalMapper(q);
655
 
        connect(formatMenuActionMapper, SIGNAL(mapped(QString)),
656
 
                q, SLOT(saveNewVersionInFormat(QString)));
657
 
    }
658
 
 
659
 
    KAction* action = new KAction(text, q);
660
 
    connect(action, SIGNAL(triggered()), formatMenuActionMapper, SLOT(map()));
661
 
    formatMenuActionMapper->setMapping(action, format);
662
 
    menuAction->menu()->addAction(action);
663
 
}
664
 
 
665
649
void EditorWindow::setupStatusBar()
666
650
{
667
651
    m_nameLabel  = new StatusProgressBar(statusBar());
734
718
 
735
719
void EditorWindow::printImage(const KUrl& /*url*/)
736
720
{
737
 
    uchar* ptr      = m_canvas->interface()->getImage();
738
 
    int w           = m_canvas->interface()->origWidth();
739
 
    int h           = m_canvas->interface()->origHeight();
740
 
    bool hasAlpha   = m_canvas->interface()->hasAlpha();
741
 
    bool sixteenBit = m_canvas->interface()->sixteenBit();
 
721
    DImg* image = m_canvas->interface()->getImg();
742
722
 
743
 
    if (!ptr || !w || !h)
 
723
    if (!image || !image->isNull())
744
724
    {
745
725
        return;
746
726
    }
747
727
 
748
 
    DImg image(w, h, sixteenBit, hasAlpha, ptr);
749
 
 
750
728
    PrintHelper printHelp(this);
751
 
    printHelp.print(image);
 
729
    printHelp.print(*image);
752
730
}
753
731
 
754
732
void EditorWindow::slotEditKeys()
1217
1195
            foreach(KToolBar* toolbar, toolbars)
1218
1196
            {
1219
1197
                // name is set in ui.rc XML file
1220
 
                if (toolbar->objectName() == "ToolBar")
 
1198
                if (toolbar->objectName() == "mainToolBar")
1221
1199
                {
1222
1200
                    toolbar->removeAction(m_fullScreenAction);
1223
1201
                    break;
1248
1226
            KToolBar* mainToolbar     = 0;
1249
1227
            foreach(KToolBar* toolbar, toolbars)
1250
1228
            {
1251
 
                if (toolbar->objectName() == "ToolBar")
 
1229
                if (toolbar->objectName() == "mainToolBar")
1252
1230
                {
1253
1231
                    mainToolbar = toolbar;
1254
1232
                    break;
1255
1233
                }
1256
1234
            }
 
1235
            kDebug() << mainToolbar;
1257
1236
 
1258
1237
            // add fullscreen action if necessary
1259
1238
            if (mainToolbar && !mainToolbar->actions().contains(m_fullScreenAction))
1260
1239
            {
1261
 
                mainToolbar->addAction(m_fullScreenAction);
 
1240
                if (mainToolbar->actions().isEmpty())
 
1241
                {
 
1242
                    mainToolbar->addAction(m_fullScreenAction);
 
1243
                }
 
1244
                else
 
1245
                {
 
1246
                    mainToolbar->insertAction(mainToolbar->actions().first(), m_fullScreenAction);
 
1247
                }
1262
1248
                d->removeFullScreenButton = true;
1263
1249
            }
1264
1250
            else
1275
1261
    }
1276
1262
}
1277
1263
 
 
1264
void EditorWindow::keyPressEvent(QKeyEvent* e)
 
1265
{
 
1266
    if (e->key() == Qt::Key_Escape)
 
1267
    {
 
1268
        slotEscapePressed();
 
1269
    }
 
1270
}
 
1271
 
1278
1272
void EditorWindow::slotLoadingProgress(const QString&, float progress)
1279
1273
{
1280
1274
    m_nameLabel->setProgressValue((int)(progress * 100.0));
1337
1331
 
1338
1332
void EditorWindow::slotUndoStateChanged()
1339
1333
{
1340
 
    DImgInterface::UndoState state = m_canvas->interface()->undoState();
 
1334
    UndoState state = m_canvas->interface()->undoState();
1341
1335
 
1342
1336
    // RAW conversion qualifies as a "non-undoable" action
1343
1337
    // You can save as new version, but cannot undo or revert
1609
1603
            if (saving)
1610
1604
            {
1611
1605
                // Waiting for asynchronous image file saving operation running in separate thread.
1612
 
                m_savingContext.synchronizingState = SavingContextContainer::SynchronousSaving;
 
1606
                m_savingContext.synchronizingState = SavingContext::SynchronousSaving;
1613
1607
                enterWaitingLoop();
1614
 
                m_savingContext.synchronizingState = SavingContextContainer::NormalSaving;
 
1608
                m_savingContext.synchronizingState = SavingContext::NormalSaving;
1615
1609
                return m_savingContext.synchronousSavingResult;
1616
1610
            }
1617
1611
            else
1637
1631
bool EditorWindow::waitForSavingToComplete()
1638
1632
{
1639
1633
    // avoid reentrancy - return false means we have reentered the loop already.
1640
 
    if (m_savingContext.synchronizingState == SavingContextContainer::SynchronousSaving)
 
1634
    if (m_savingContext.synchronizingState == SavingContext::SynchronousSaving)
1641
1635
    {
1642
1636
        return false;
1643
1637
    }
1644
1638
 
1645
 
    if (m_savingContext.savingState != SavingContextContainer::SavingStateNone)
 
1639
    if (m_savingContext.savingState != SavingContext::SavingStateNone)
1646
1640
    {
1647
1641
        // Waiting for asynchronous image file saving operation running in separate thread.
1648
 
        m_savingContext.synchronizingState = SavingContextContainer::SynchronousSaving;
 
1642
        m_savingContext.synchronizingState = SavingContext::SynchronousSaving;
1649
1643
        /*QFrame processFrame;
1650
1644
        StatusProgressBar *pb = m_nameLabel;
1651
1645
        pb->setParent(&processFrame);
1655
1649
                                              i18n("Please wait while the image is being saved..."));
1656
1650
        */
1657
1651
        enterWaitingLoop();
1658
 
        m_savingContext.synchronizingState = SavingContextContainer::NormalSaving;
 
1652
        m_savingContext.synchronizingState = SavingContext::NormalSaving;
1659
1653
    }
1660
1654
 
1661
1655
    return true;
1819
1813
void EditorWindow::slotNameLabelCancelButtonPressed()
1820
1814
{
1821
1815
    // If we saving an image...
1822
 
    if (m_savingContext.savingState != SavingContextContainer::SavingStateNone)
 
1816
    if (m_savingContext.savingState != SavingContext::SavingStateNone)
1823
1817
    {
1824
1818
        m_savingContext.abortingSaving = true;
1825
1819
        m_canvas->abortSaving();
1863
1857
void EditorWindow::slotSavingFinished(const QString& filename, bool success)
1864
1858
{
1865
1859
    Q_UNUSED(filename);
1866
 
    kDebug() << filename << success << (m_savingContext.savingState != SavingContextContainer::SavingStateNone);
 
1860
    kDebug() << filename << success << (m_savingContext.savingState != SavingContext::SavingStateNone);
1867
1861
 
1868
1862
    // only handle this if we really wanted to save a file...
1869
 
    if (m_savingContext.savingState != SavingContextContainer::SavingStateNone)
 
1863
    if (m_savingContext.savingState != SavingContext::SavingStateNone)
1870
1864
    {
1871
1865
        m_savingContext.executedOperation = m_savingContext.savingState;
1872
 
        m_savingContext.savingState = SavingContextContainer::SavingStateNone;
 
1866
        m_savingContext.savingState = SavingContext::SavingStateNone;
1873
1867
 
1874
1868
        if (!success)
1875
1869
        {
1921
1915
 
1922
1916
    switch (m_savingContext.executedOperation)
1923
1917
    {
1924
 
        case SavingContextContainer::SavingStateNone:
 
1918
        case SavingContext::SavingStateNone:
1925
1919
            break;
1926
1920
 
1927
 
        case SavingContextContainer::SavingStateSave:
 
1921
        case SavingContext::SavingStateSave:
1928
1922
            saveIsComplete();
1929
1923
            break;
1930
1924
 
1931
 
        case SavingContextContainer::SavingStateSaveAs:
 
1925
        case SavingContext::SavingStateSaveAs:
1932
1926
            saveAsIsComplete();
1933
1927
            break;
1934
1928
 
1935
 
        case SavingContextContainer::SavingStateVersion:
 
1929
        case SavingContext::SavingStateVersion:
1936
1930
            saveVersionIsComplete();
1937
1931
            break;
1938
1932
    }
1949
1943
    m_savingContext.saveTempFile = 0;
1950
1944
 
1951
1945
    // Exit of internal Qt event loop to unlock promptUserSave() method.
1952
 
    if (m_savingContext.synchronizingState == SavingContextContainer::SynchronousSaving)
 
1946
    if (m_savingContext.synchronizingState == SavingContext::SynchronousSaving)
1953
1947
    {
1954
1948
        quitWaitingLoop();
1955
1949
    }
2019
2013
    kDebug() << "startSaving url = " << url;
2020
2014
 
2021
2015
    // avoid any reentrancy. Should be impossible anyway since actions will be disabled.
2022
 
    if (m_savingContext.savingState != SavingContextContainer::SavingStateNone)
 
2016
    if (m_savingContext.savingState != SavingContext::SavingStateNone)
2023
2017
    {
2024
2018
        return;
2025
2019
    }
2026
2020
 
2027
 
    m_savingContext = SavingContextContainer();
 
2021
    m_savingContext = SavingContext();
2028
2022
 
2029
2023
    if (!checkPermissions(url))
2030
2024
    {
2039
2033
    m_savingContext.originalFormat     = m_canvas->currentImageFileFormat();
2040
2034
    m_savingContext.format             = m_savingContext.originalFormat;
2041
2035
    m_savingContext.abortingSaving     = false;
2042
 
    m_savingContext.savingState        = SavingContextContainer::SavingStateSave;
2043
 
    m_savingContext.executedOperation  = SavingContextContainer::SavingStateNone;
 
2036
    m_savingContext.savingState        = SavingContext::SavingStateSave;
 
2037
    m_savingContext.executedOperation  = SavingContext::SavingStateNone;
2044
2038
 
2045
2039
    m_canvas->interface()->saveAs(m_savingContext.saveTempFileName, m_IOFileSettings,
2046
2040
                                  m_setExifOrientationTag && m_canvas->exifRotated(), m_savingContext.format,
2049
2043
 
2050
2044
bool EditorWindow::showFileSaveDialog(const KUrl& initialUrl, KUrl& newURL)
2051
2045
{
2052
 
    FileSaveOptionsBox* options      = new FileSaveOptionsBox();
2053
 
    QPointer<KFileDialog> imageFileSaveDialog
2054
 
        = new KFileDialog(initialUrl, QString(), this, options);
 
2046
    FileSaveOptionsBox* options               = new FileSaveOptionsBox();
 
2047
    QPointer<KFileDialog> imageFileSaveDialog = new KFileDialog(initialUrl, QString(), this, options);
2055
2048
    options->setDialog(imageFileSaveDialog);
2056
2049
 
2057
2050
    ImageDialogPreview* preview = new ImageDialogPreview(imageFileSaveDialog);
2061
2054
    imageFileSaveDialog->setCaption(i18n("New Image File Name"));
2062
2055
 
2063
2056
    // restore old settings for the dialog
2064
 
    KSharedConfig::Ptr config = KGlobal::config();
2065
 
    KConfigGroup group        = config->group(CONFIG_GROUP_NAME);
 
2057
    KSharedConfig::Ptr config         = KGlobal::config();
 
2058
    KConfigGroup group                = config->group(CONFIG_GROUP_NAME);
2066
2059
    const QString optionLastExtension = "LastSavedImageExtension";
2067
 
    QString ext               = group.readEntry(optionLastExtension, "png");
 
2060
    QString ext                       = group.readEntry(optionLastExtension, "png");
2068
2061
 
2069
2062
    // adjust extension of proposed filename
2070
 
    QString fileName = initialUrl.fileName(KUrl::ObeyTrailingSlash);
 
2063
    QString fileName                  = initialUrl.fileName(KUrl::ObeyTrailingSlash);
2071
2064
 
2072
2065
    if (!fileName.isNull())
2073
2066
    {
2074
 
        int lastDot = fileName.lastIndexOf(QLatin1Char('.'));
 
2067
        int lastDot              = fileName.lastIndexOf(QLatin1Char('.'));
2075
2068
        QString completeBaseName = (lastDot == -1) ? fileName : fileName.left(lastDot);
2076
 
        fileName = completeBaseName + QLatin1Char('.') + ext;
 
2069
        fileName                 = completeBaseName + QLatin1Char('.') + ext;
2077
2070
    }
2078
2071
 
2079
 
    QString autoFilter = imageFileSaveDialog->filterWidget()->defaultFilter();
2080
 
 
 
2072
    QString autoFilter          = imageFileSaveDialog->filterWidget()->defaultFilter();
2081
2073
    QStringList writablePattern = getWritingFilters();
2082
2074
 
2083
2075
    if (writablePattern.first().count("*.") > 10) // try to verify it's the "All image files" filter
2132
2124
    //-- Show Settings Dialog ----------------------------------------------
2133
2125
 
2134
2126
    const QString configShowImageSettingsDialog = "ShowImageSettingsDialog";
2135
 
    bool showDialog = group.readEntry(configShowImageSettingsDialog, true);
 
2127
    bool showDialog                             = group.readEntry(configShowImageSettingsDialog, true);
2136
2128
 
2137
2129
    if (showDialog && options->discoverFormat(newURL.fileName(), DImg::NONE) != DImg::NONE)
2138
2130
    {
2139
 
        FileSaveOptionsDlg* fileSaveOptionsDialog   = new FileSaveOptionsDlg(this, options);
 
2131
        FileSaveOptionsDlg* fileSaveOptionsDialog = new FileSaveOptionsDlg(this, options);
2140
2132
        options->slotImageFileFormatChanged(newURL.fileName());
2141
2133
 
2142
2134
        if (d->currentWindowModalDialog)
2149
2141
        {
2150
2142
            fileSaveOptionsDialog->setWindowModality(Qt::WindowModal);
2151
2143
            d->currentWindowModalDialog = fileSaveOptionsDialog;
2152
 
            result = fileSaveOptionsDialog->exec();
 
2144
            result                      = fileSaveOptionsDialog->exec();
2153
2145
            d->currentWindowModalDialog = 0;
2154
2146
        }
2155
2147
 
2356
2348
{
2357
2349
    kDebug() << "startSavingAs called";
2358
2350
 
2359
 
    if (m_savingContext.savingState != SavingContextContainer::SavingStateNone)
 
2351
    if (m_savingContext.savingState != SavingContext::SavingStateNone)
2360
2352
    {
2361
2353
        return false;
2362
2354
    }
2363
2355
 
2364
 
    m_savingContext = SavingContextContainer();
 
2356
    m_savingContext = SavingContext();
2365
2357
    m_savingContext.srcURL = url;
2366
2358
 
2367
2359
    // prepare the save dialog
2433
2425
 
2434
2426
    m_savingContext.destinationURL = newURL;
2435
2427
    m_savingContext.originalFormat = m_canvas->currentImageFileFormat();
2436
 
    m_savingContext.savingState    = SavingContextContainer::SavingStateSaveAs;
2437
 
    m_savingContext.executedOperation = SavingContextContainer::SavingStateNone;
 
2428
    m_savingContext.savingState    = SavingContext::SavingStateSaveAs;
 
2429
    m_savingContext.executedOperation = SavingContext::SavingStateNone;
2438
2430
    m_savingContext.abortingSaving = false;
2439
2431
 
2440
2432
    // in any case, destructive (Save as) or non (Export), mark as New Version
2481
2473
VersionFileOperation EditorWindow::saveAsVersionFileOperation(const KUrl& url, const KUrl& saveUrl, const QString& format)
2482
2474
{
2483
2475
    DImageHistory resolvedHistory = m_canvas->interface()->getResolvedInitialHistory();
2484
 
    DImageHistory history = m_canvas->interface()->getImageHistory();
 
2476
    DImageHistory history         = m_canvas->interface()->getImageHistory();
2485
2477
 
2486
2478
    VersionFileInfo currentName(url.directory(), url.fileName(), m_canvas->currentImageFileFormat());
2487
2479
    VersionFileInfo saveLocation(saveUrl.directory(), saveUrl.fileName(), format);
2491
2483
VersionFileOperation EditorWindow::saveInFormatVersionFileOperation(const KUrl& url, const QString& format)
2492
2484
{
2493
2485
    DImageHistory resolvedHistory = m_canvas->interface()->getResolvedInitialHistory();
2494
 
    DImageHistory history = m_canvas->interface()->getImageHistory();
 
2486
    DImageHistory history         = m_canvas->interface()->getImageHistory();
2495
2487
 
2496
2488
    VersionFileInfo currentName(url.directory(), url.fileName(), m_canvas->currentImageFileFormat());
2497
2489
    return versionManager()->operationNewVersionInFormat(currentName, format, resolvedHistory, history);
2502
2494
    kDebug() << "Saving image" << url << "non-destructive, new version:"
2503
2495
             << fork << ", saveAs:" << saveAs << "format:" << format;
2504
2496
 
2505
 
    if (m_savingContext.savingState != SavingContextContainer::SavingStateNone)
 
2497
    if (m_savingContext.savingState != SavingContext::SavingStateNone)
2506
2498
    {
2507
2499
        return false;
2508
2500
    }
2509
2501
 
2510
 
    m_savingContext = SavingContextContainer();
 
2502
    m_savingContext                      = SavingContext();
2511
2503
    m_savingContext.versionFileOperation = saveVersionFileOperation(url, fork);
2512
2504
    m_canvas->interface()->setHistoryIsBranch(fork);
2513
2505
 
2583
2575
    m_savingContext.originalFormat     = m_canvas->currentImageFileFormat();
2584
2576
    m_savingContext.format             = m_savingContext.versionFileOperation.saveFile.format;
2585
2577
    m_savingContext.abortingSaving     = false;
2586
 
    m_savingContext.savingState        = SavingContextContainer::SavingStateVersion;
2587
 
    m_savingContext.executedOperation  = SavingContextContainer::SavingStateNone;
 
2578
    m_savingContext.savingState        = SavingContext::SavingStateVersion;
 
2579
    m_savingContext.executedOperation  = SavingContext::SavingStateNone;
2588
2580
 
2589
2581
    m_canvas->interface()->saveAs(m_savingContext.saveTempFileName, m_IOFileSettings,
2590
2582
                                  m_setExifOrientationTag && m_canvas->exifRotated(),
2594
2586
    return true;
2595
2587
}
2596
2588
 
2597
 
 
2598
2589
bool EditorWindow::checkPermissions(const KUrl& url)
2599
2590
{
2600
2591
    //TODO: Check that the permissions can actually be changed
2728
2719
    {
2729
2720
        kDebug() << "moving a local file";
2730
2721
 
2731
 
        if (m_savingContext.executedOperation == SavingContextContainer::SavingStateVersion)
 
2722
        if (m_savingContext.executedOperation == SavingContext::SavingStateVersion)
2732
2723
        {
2733
2724
            // check if we need to move the current file to an intermediate name
2734
2725
            if (m_savingContext.versionFileOperation.tasks & VersionFileOperation::MoveToIntermediate)
2746
2737
        bool moveSuccessful = moveLocalFile(m_savingContext.saveTempFileName,
2747
2738
                                            m_savingContext.destinationURL.toLocalFile());
2748
2739
 
2749
 
        if (m_savingContext.executedOperation == SavingContextContainer::SavingStateVersion)
 
2740
        if (m_savingContext.executedOperation == SavingContext::SavingStateVersion)
2750
2741
        {
2751
2742
            if (moveSuccessful &&
2752
2743
                m_savingContext.versionFileOperation.tasks & VersionFileOperation::SaveAndDelete)
2975
2966
    d->previewToolBar->setPreviewModeMask(mask);
2976
2967
}
2977
2968
 
2978
 
PreviewToolBar::PreviewMode EditorWindow::previewMode()
 
2969
PreviewToolBar::PreviewMode EditorWindow::previewMode() const
2979
2970
{
2980
2971
    return d->previewToolBar->previewMode();
2981
2972
}