katefiletreeplugin.cpp 14.3 KB
Newer Older
1
2
3
4
5
/* This file is part of the KDE project
   Copyright (C) 2010 Thomas Fjellstrom <thomas@fjellstrom.ca>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
Christoph Cullmann's avatar
Christoph Cullmann committed
6
7
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

   This library 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
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
*/

//BEGIN Includes

#include "katefiletreeplugin.h"
#include "katefiletree.h"
#include "katefiletreemodel.h"
#include "katefiletreeproxymodel.h"
26
#include "katefiletreeconfigpage.h"
27
28

#include <ktexteditor/view.h>
29
#include <ktexteditor/application.h>
30

Michal Humpula's avatar
Michal Humpula committed
31
32
33
34
35
#include <KAboutData>
#include <KPluginFactory>
#include <KActionCollection>
#include <KLocalizedString>
#include <KConfigGroup>
36
#include <KXMLGUIFactory>
Christoph Cullmann's avatar
Christoph Cullmann committed
37
#include <KXmlGuiWindow>
38
#include <KToolBar>
Michal Humpula's avatar
Michal Humpula committed
39
40
41

#include <QAction>
#include <QApplication>
42
#include <QStyle>
43

44
45
#include "katefiletreedebug.h"

46
47
//END Includes

Dominik Haumann's avatar
Dominik Haumann committed
48
K_PLUGIN_FACTORY_WITH_JSON(KateFileTreeFactory, "katefiletreeplugin.json", registerPlugin<KateFileTreePlugin>();)
49

50
Q_LOGGING_CATEGORY(FILETREE, "kate-filetree", QtWarningMsg)
51

52
//BEGIN KateFileTreePlugin
Dominik Haumann's avatar
Dominik Haumann committed
53
54
KateFileTreePlugin::KateFileTreePlugin(QObject *parent, const QList<QVariant> &)
    : KTextEditor::Plugin(parent)
55
56
57
{
}

58
59
KateFileTreePlugin::~KateFileTreePlugin()
{
Dominik Haumann's avatar
Dominik Haumann committed
60
    m_settings.save();
61
62
}

Dominik Haumann's avatar
Dominik Haumann committed
63
QObject *KateFileTreePlugin::createView(KTextEditor::MainWindow *mainWindow)
64
{
Dominik Haumann's avatar
Dominik Haumann committed
65
    KateFileTreePluginView *view = new KateFileTreePluginView(mainWindow, this);
66
    connect(view, &KateFileTreePluginView::destroyed, this, &KateFileTreePlugin::viewDestroyed);
Dominik Haumann's avatar
Dominik Haumann committed
67
    m_views.append(view);
68

Dominik Haumann's avatar
Dominik Haumann committed
69
    return view;
70
}
71

Dominik Haumann's avatar
Dominik Haumann committed
72
void KateFileTreePlugin::viewDestroyed(QObject *view)
73
{
Dominik Haumann's avatar
Dominik Haumann committed
74
75
    // do not access the view pointer, since it is partially destroyed already
    m_views.removeAll(static_cast<KateFileTreePluginView *>(view));
76
77
}

78
int KateFileTreePlugin::configPages() const
79
{
Dominik Haumann's avatar
Dominik Haumann committed
80
    return 1;
81
82
}

Dominik Haumann's avatar
Dominik Haumann committed
83
KTextEditor::ConfigPage *KateFileTreePlugin::configPage(int number, QWidget *parent)
84
{
Dominik Haumann's avatar
Dominik Haumann committed
85
    if (number != 0) {
86
        return nullptr;
Dominik Haumann's avatar
Dominik Haumann committed
87
    }
88

Dominik Haumann's avatar
Dominik Haumann committed
89
90
    KateFileTreeConfigPage *page = new KateFileTreeConfigPage(parent, this);
    return page;
91
}
92

93
94
const KateFileTreePluginSettings &KateFileTreePlugin::settings()
{
Dominik Haumann's avatar
Dominik Haumann committed
95
    return m_settings;
96
}
97

98
void KateFileTreePlugin::applyConfig(bool shadingEnabled, QColor viewShade, QColor editShade, bool listMode, int sortRole, bool showFullPath)
99
{
Dominik Haumann's avatar
Dominik Haumann committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
    // save to settings
    m_settings.setShadingEnabled(shadingEnabled);
    m_settings.setViewShade(viewShade);
    m_settings.setEditShade(editShade);

    m_settings.setListMode(listMode);
    m_settings.setSortRole(sortRole);
    m_settings.setShowFullPathOnRoots(showFullPath);
    m_settings.save();

    // update views
    foreach(KateFileTreePluginView * view, m_views) {
        view->setHasLocalPrefs(false);
        view->model()->setShadingEnabled(shadingEnabled);
        view->model()->setViewShade(viewShade);
        view->model()->setEditShade(editShade);
        view->setListMode(listMode);
        view->proxy()->setSortRole(sortRole);
        view->model()->setShowFullPathOnRoots(showFullPath);
    }
120
}
121

122
123
124
//END KateFileTreePlugin

//BEGIN KateFileTreePluginView
Dominik Haumann's avatar
Dominik Haumann committed
125
126
127
128
129
KateFileTreePluginView::KateFileTreePluginView(KTextEditor::MainWindow *mainWindow, KateFileTreePlugin *plug)
    : QObject(mainWindow)
    , m_loadingDocuments(false)
    , m_plug(plug)
    , m_mainWindow(mainWindow)
130
{
Laurent Montel's avatar
Laurent Montel committed
131
132
    KXMLGUIClient::setComponentName(QStringLiteral("katefiletree"), i18n("Kate File Tree"));
    setXMLFile(QStringLiteral("ui.rc"));
133

Laurent Montel's avatar
Laurent Montel committed
134
    m_toolView = mainWindow->createToolView(plug, QStringLiteral("kate_private_plugin_katefiletreeplugin"), KTextEditor::MainWindow::Left, QIcon::fromTheme(QStringLiteral("document-open")), i18n("Documents"));
135

Dominik Haumann's avatar
Dominik Haumann committed
136
137
138
139
140
    // create toolbar
    m_toolbar = new KToolBar(m_toolView);
    m_toolbar->setMovable(false);
    m_toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
    m_toolbar->setContextMenuPolicy(Qt::NoContextMenu);
141
142
143
144
145
146

    // ensure reasonable icons sizes, like e.g. the quick-open and co. icons
    // the normal toolbar sizes are TOO large, e.g. for scaled stuff even more!
    const int iconSize = m_toolView->style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, m_toolView);
    m_toolbar->setIconSize(QSize(iconSize, iconSize));

Dominik Haumann's avatar
Dominik Haumann committed
147
148
149
    // create filetree
    m_fileTree = new KateFileTree(m_toolView);
    m_fileTree->setSortingEnabled(true);
Christoph Cullmann's avatar
Christoph Cullmann committed
150

151
152
153
    connect(m_fileTree, &KateFileTree::activateDocument, this, &KateFileTreePluginView::activateDocument);
    connect(m_fileTree, &KateFileTree::viewModeChanged, this, &KateFileTreePluginView::viewModeChanged);
    connect(m_fileTree, &KateFileTree::sortRoleChanged, this, &KateFileTreePluginView::sortRoleChanged);
Christoph Cullmann's avatar
Christoph Cullmann committed
154

Dominik Haumann's avatar
Dominik Haumann committed
155
156
157
158
    m_documentModel = new KateFileTreeModel(this);
    m_proxyModel = new KateFileTreeProxyModel(this);
    m_proxyModel->setSourceModel(m_documentModel);
    m_proxyModel->setDynamicSortFilter(true);
159

Dominik Haumann's avatar
Dominik Haumann committed
160
161
162
163
    m_documentModel->setShowFullPathOnRoots(m_plug->settings().showFullPathOnRoots());
    m_documentModel->setShadingEnabled(m_plug->settings().shadingEnabled());
    m_documentModel->setViewShade(m_plug->settings().viewShade());
    m_documentModel->setEditShade(m_plug->settings().editShade());
Christoph Cullmann's avatar
Christoph Cullmann committed
164

165
166
167
168
169
170
171
172
173
    connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentWillBeDeleted,
            m_documentModel, &KateFileTreeModel::documentClosed);
    connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentCreated,
            this, &KateFileTreePluginView::documentOpened);
    connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentWillBeDeleted,
            this, &KateFileTreePluginView::documentClosed);
    connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::aboutToCreateDocuments,
            this, &KateFileTreePluginView::slotAboutToCreateDocuments);

Yuri Chornoivan's avatar
Yuri Chornoivan committed
174
175
    connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentsCreated,
            this, &KateFileTreePluginView::slotDocumentsCreated);
Christoph Cullmann's avatar
Christoph Cullmann committed
176

177
178
179
180
181
182
183
184
185
    connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::aboutToDeleteDocuments,
            m_documentModel, &KateFileTreeModel::slotAboutToDeleteDocuments);
    connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentsDeleted,
            m_documentModel, &KateFileTreeModel::slotDocumentsDeleted);

    connect(m_documentModel, &KateFileTreeModel::triggerViewChangeAfterNameChange, [=] {
                KateFileTreePluginView::viewChanged();
            });

Dominik Haumann's avatar
Dominik Haumann committed
186
    m_fileTree->setModel(m_proxyModel);
Christoph Cullmann's avatar
Christoph Cullmann committed
187

Dominik Haumann's avatar
Dominik Haumann committed
188
189
190
    m_fileTree->setDragEnabled(false);
    m_fileTree->setDragDropMode(QAbstractItemView::InternalMove);
    m_fileTree->setDropIndicatorShown(false);
191

Dominik Haumann's avatar
Dominik Haumann committed
192
    m_fileTree->setSelectionMode(QAbstractItemView::SingleSelection);
193

194
195
    connect(m_fileTree->selectionModel(), &QItemSelectionModel::currentChanged,
            m_fileTree, &KateFileTree::slotCurrentChanged);
Christoph Cullmann's avatar
Christoph Cullmann committed
196

197
    connect(mainWindow, &KTextEditor::MainWindow::viewChanged, this, &KateFileTreePluginView::viewChanged);
198

Dominik Haumann's avatar
Dominik Haumann committed
199
200
201
202
    //
    // actions
    //
    setupActions();
Christoph Cullmann's avatar
Christoph Cullmann committed
203

Dominik Haumann's avatar
Dominik Haumann committed
204
    mainWindow->guiFactory()->addClient(this);
Christoph Cullmann's avatar
Christoph Cullmann committed
205

Dominik Haumann's avatar
Dominik Haumann committed
206
    m_proxyModel->setSortRole(Qt::DisplayRole);
Christoph Cullmann's avatar
Christoph Cullmann committed
207

Dominik Haumann's avatar
Dominik Haumann committed
208
209
    m_proxyModel->sort(0, Qt::AscendingOrder);
    m_proxyModel->invalidate();
210
211
}

Dominik Haumann's avatar
Dominik Haumann committed
212
KateFileTreePluginView::~KateFileTreePluginView()
213
{
Dominik Haumann's avatar
Dominik Haumann committed
214
    m_mainWindow->guiFactory()->removeClient(this);
215

Dominik Haumann's avatar
Dominik Haumann committed
216
217
218
219
220
    // clean up tree and toolview
    delete m_fileTree->parentWidget();
    // delete m_toolView;
    // and TreeModel
    delete m_documentModel;
221
222
}

223
224
void KateFileTreePluginView::setupActions()
{
Laurent Montel's avatar
Laurent Montel committed
225
    auto aPrev = actionCollection()->addAction(QStringLiteral("filetree_prev_document"));
Yuri Chornoivan's avatar
Yuri Chornoivan committed
226
    aPrev->setText(i18n("Previous Document"));
Laurent Montel's avatar
Laurent Montel committed
227
    aPrev->setIcon(QIcon::fromTheme(QStringLiteral("go-up")));
228
    actionCollection()->setDefaultShortcut(aPrev, Qt::ALT + Qt::Key_Up);
229
    connect(aPrev, &QAction::triggered, m_fileTree, &KateFileTree::slotDocumentPrev);
230

Laurent Montel's avatar
Laurent Montel committed
231
    auto aNext = actionCollection()->addAction(QStringLiteral("filetree_next_document"));
232
    aNext->setText(i18n("Next Document"));
Laurent Montel's avatar
Laurent Montel committed
233
    aNext->setIcon(QIcon::fromTheme(QStringLiteral("go-down")));
234
    actionCollection()->setDefaultShortcut(aNext, Qt::ALT + Qt::Key_Down);
235
    connect(aNext, &QAction::triggered, m_fileTree, &KateFileTree::slotDocumentNext);
236

Laurent Montel's avatar
Laurent Montel committed
237
    auto aShowActive = actionCollection()->addAction(QStringLiteral("filetree_show_active_document"));
238
    aShowActive->setText(i18n("&Show Active"));
Laurent Montel's avatar
Laurent Montel committed
239
    aShowActive->setIcon(QIcon::fromTheme(QStringLiteral("folder-sync")));
240
    connect(aShowActive, &QAction::triggered, this, &KateFileTreePluginView::showActiveDocument);
241

Laurent Montel's avatar
Laurent Montel committed
242
    auto aSave = actionCollection()->addAction(QStringLiteral("filetree_save"), this, SLOT(slotDocumentSave()));
Dominik Haumann's avatar
Dominik Haumann committed
243
244
    aSave->setText(i18n("Save Current Document"));
    aSave->setToolTip(i18n("Save the current document"));
Laurent Montel's avatar
Laurent Montel committed
245
    aSave->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
Dominik Haumann's avatar
Dominik Haumann committed
246

Laurent Montel's avatar
Laurent Montel committed
247
    auto aSaveAs = actionCollection()->addAction(QStringLiteral("filetree_save_as"), this, SLOT(slotDocumentSaveAs()));
Dominik Haumann's avatar
Dominik Haumann committed
248
249
    aSaveAs->setText(i18n("Save Current Document As"));
    aSaveAs->setToolTip(i18n("Save current document under new name"));
Laurent Montel's avatar
Laurent Montel committed
250
    aSaveAs->setIcon(QIcon::fromTheme(QStringLiteral("document-save-as")));
Christoph Cullmann's avatar
Christoph Cullmann committed
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268

    /**
     * add new & open, if hosting application has it
     */
    if (KXmlGuiWindow *parentClient = qobject_cast<KXmlGuiWindow *>(m_mainWindow->window())) {
        bool newOrOpen = false;
        if (auto a = parentClient->action("file_new")) {
            m_toolbar->addAction(a);
            newOrOpen = true;
        }
        if (auto a = parentClient->action("file_open")) {
            m_toolbar->addAction(a);
            newOrOpen = true;
        }
        if (newOrOpen) {
            m_toolbar->addSeparator();
        }
    }
Dominik Haumann's avatar
Dominik Haumann committed
269

Christoph Cullmann's avatar
Christoph Cullmann committed
270
271
272
    /**
     * add own actions
     */
273
274
    m_toolbar->addAction(aPrev);
    m_toolbar->addAction(aNext);
Christoph Cullmann's avatar
Christoph Cullmann committed
275
276
277
    m_toolbar->addSeparator();
    m_toolbar->addAction(aSave);
    m_toolbar->addAction(aSaveAs);
278
279
}

280
281
KateFileTreeModel *KateFileTreePluginView::model()
{
Dominik Haumann's avatar
Dominik Haumann committed
282
    return m_documentModel;
283
284
285
286
}

KateFileTreeProxyModel *KateFileTreePluginView::proxy()
{
Dominik Haumann's avatar
Dominik Haumann committed
287
    return m_proxyModel;
288
289
}

290
291
KateFileTree *KateFileTreePluginView::tree()
{
Dominik Haumann's avatar
Dominik Haumann committed
292
    return m_fileTree;
293
294
}

295
void KateFileTreePluginView::documentOpened(KTextEditor::Document *doc)
296
{
Dominik Haumann's avatar
Dominik Haumann committed
297
298
299
    if (m_loadingDocuments) {
        return;
    }
Christoph Cullmann's avatar
Christoph Cullmann committed
300

Dominik Haumann's avatar
Dominik Haumann committed
301
302
    m_documentModel->documentOpened(doc);
    m_proxyModel->invalidate();
303
304
}

305
void KateFileTreePluginView::documentClosed(KTextEditor::Document *doc)
306
{
Dominik Haumann's avatar
Dominik Haumann committed
307
308
    Q_UNUSED(doc);
    m_proxyModel->invalidate();
309
}
Christoph Cullmann's avatar
Christoph Cullmann committed
310

Christoph Cullmann's avatar
Christoph Cullmann committed
311
void KateFileTreePluginView::viewChanged(KTextEditor::View *)
312
{
Dominik Haumann's avatar
Dominik Haumann committed
313
314
315
316
    KTextEditor::View *view = m_mainWindow->activeView();
    if (!view) {
        return;
    }
Christoph Cullmann's avatar
Christoph Cullmann committed
317

Dominik Haumann's avatar
Dominik Haumann committed
318
319
    KTextEditor::Document *doc = view->document();
    QModelIndex index = m_proxyModel->docIndex(doc);
320

Dominik Haumann's avatar
Dominik Haumann committed
321
    QString display = m_proxyModel->data(index, Qt::DisplayRole).toString();
322

Dominik Haumann's avatar
Dominik Haumann committed
323
324
    // update the model on which doc is active
    m_documentModel->documentActivated(doc);
Christoph Cullmann's avatar
Christoph Cullmann committed
325

Dominik Haumann's avatar
Dominik Haumann committed
326
    m_fileTree->selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
Christoph Cullmann's avatar
Christoph Cullmann committed
327

Dominik Haumann's avatar
Dominik Haumann committed
328
    m_fileTree->scrollTo(index);
Christoph Cullmann's avatar
Christoph Cullmann committed
329

Dominik Haumann's avatar
Dominik Haumann committed
330
331
332
333
    while (index != QModelIndex()) {
        m_fileTree->expand(index);
        index = index.parent();
    }
334
335
}

336
337
void KateFileTreePluginView::setListMode(bool listMode)
{
Dominik Haumann's avatar
Dominik Haumann committed
338
339
340
341
342
343
344
    if (listMode) {
        m_documentModel->setListMode(true);
        m_fileTree->setRootIsDecorated(false);
    } else {
        m_documentModel->setListMode(false);
        m_fileTree->setRootIsDecorated(true);
    }
345

Dominik Haumann's avatar
Dominik Haumann committed
346
347
    m_proxyModel->sort(0, Qt::AscendingOrder);
    m_proxyModel->invalidate();
348
349
350
351
}

void KateFileTreePluginView::viewModeChanged(bool listMode)
{
Dominik Haumann's avatar
Dominik Haumann committed
352
353
    setHasLocalPrefs(true);
    setListMode(listMode);
354
355
356
357
}

void KateFileTreePluginView::sortRoleChanged(int role)
{
Dominik Haumann's avatar
Dominik Haumann committed
358
359
360
    setHasLocalPrefs(true);
    m_proxyModel->setSortRole(role);
    m_proxyModel->invalidate();
361
362
}

363
364
void KateFileTreePluginView::activateDocument(KTextEditor::Document *doc)
{
Dominik Haumann's avatar
Dominik Haumann committed
365
    m_mainWindow->activateView(doc);
366
367
}

368
369
void KateFileTreePluginView::showToolView()
{
Dominik Haumann's avatar
Dominik Haumann committed
370
371
    m_mainWindow->showToolView(m_toolView);
    m_toolView->setFocus();
372
373
374
375
}

void KateFileTreePluginView::hideToolView()
{
Dominik Haumann's avatar
Dominik Haumann committed
376
    m_mainWindow->hideToolView(m_toolView);
377
378
}

379
380
void KateFileTreePluginView::showActiveDocument()
{
Dominik Haumann's avatar
Dominik Haumann committed
381
382
383
384
    // hack?
    viewChanged();
    // make the tool view show if it was hidden
    showToolView();
385
386
}

387
388
bool KateFileTreePluginView::hasLocalPrefs()
{
Dominik Haumann's avatar
Dominik Haumann committed
389
    return m_hasLocalPrefs;
390
391
392
393
}

void KateFileTreePluginView::setHasLocalPrefs(bool h)
{
Dominik Haumann's avatar
Dominik Haumann committed
394
    m_hasLocalPrefs = h;
395
396
}

Dominik Haumann's avatar
Dominik Haumann committed
397
void KateFileTreePluginView::readSessionConfig(const KConfigGroup &g)
398
{
Dominik Haumann's avatar
Dominik Haumann committed
399
400
401
402
403
    if (g.exists()) {
        m_hasLocalPrefs = true;
    } else {
        m_hasLocalPrefs = false;
    }
Christoph Cullmann's avatar
Christoph Cullmann committed
404

Dominik Haumann's avatar
Dominik Haumann committed
405
406
407
    // we chain to the global settings by using them as the defaults
    //  here in the session view config loading.
    const KateFileTreePluginSettings &defaults = m_plug->settings();
Christoph Cullmann's avatar
Christoph Cullmann committed
408

Dominik Haumann's avatar
Dominik Haumann committed
409
    bool listMode = g.readEntry("listMode", defaults.listMode());
Christoph Cullmann's avatar
Christoph Cullmann committed
410

Dominik Haumann's avatar
Dominik Haumann committed
411
    setListMode(listMode);
412

Dominik Haumann's avatar
Dominik Haumann committed
413
414
    int sortRole = g.readEntry("sortRole", defaults.sortRole());
    m_proxyModel->setSortRole(sortRole);
415
416
}

Dominik Haumann's avatar
Dominik Haumann committed
417
void KateFileTreePluginView::writeSessionConfig(KConfigGroup &g)
418
{
Dominik Haumann's avatar
Dominik Haumann committed
419
420
421
422
423
424
425
    if (m_hasLocalPrefs) {
        g.writeEntry("listMode", QVariant(m_documentModel->listMode()));
        g.writeEntry("sortRole", int(m_proxyModel->sortRole()));
    } else {
        g.deleteEntry("listMode");
        g.deleteEntry("sortRole");
    }
Christoph Cullmann's avatar
Christoph Cullmann committed
426

Dominik Haumann's avatar
Dominik Haumann committed
427
    g.sync();
428
}
429
430
431

void KateFileTreePluginView::slotAboutToCreateDocuments()
{
Dominik Haumann's avatar
Dominik Haumann committed
432
    m_loadingDocuments = true;
433
434
}

Dominik Haumann's avatar
Dominik Haumann committed
435
void KateFileTreePluginView::slotDocumentsCreated(const QList<KTextEditor::Document *> &docs)
436
{
Dominik Haumann's avatar
Dominik Haumann committed
437
438
439
    m_documentModel->documentsOpened(docs);
    m_loadingDocuments = false;
    viewChanged();
440
441
}

Christoph Cullmann's avatar
Christoph Cullmann committed
442
443
void KateFileTreePluginView::slotDocumentSave()
{
Dominik Haumann's avatar
Dominik Haumann committed
444
    if (auto view = m_mainWindow->activeView()) {
Christoph Cullmann's avatar
Christoph Cullmann committed
445
        view->document()->documentSave();
Dominik Haumann's avatar
Dominik Haumann committed
446
    }
Christoph Cullmann's avatar
Christoph Cullmann committed
447
448
449
450
}

void KateFileTreePluginView::slotDocumentSaveAs()
{
Dominik Haumann's avatar
Dominik Haumann committed
451
    if (auto view = m_mainWindow->activeView()) {
Christoph Cullmann's avatar
Christoph Cullmann committed
452
        view->document()->documentSaveAs();
Dominik Haumann's avatar
Dominik Haumann committed
453
    }
Christoph Cullmann's avatar
Christoph Cullmann committed
454
455
}

Vegard Øye's avatar
Vegard Øye committed
456
457
//END KateFileTreePluginView

458
#include "katefiletreeplugin.moc"