2020-08-25 17:07:38 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2006 Peter Penz <peter.penz@gmx.at>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-01-26 00:55:49 +00:00
|
|
|
|
2010-08-27 05:26:27 +00:00
|
|
|
#include "dolphinnewfilemenu.h"
|
2009-03-17 20:47:03 +00:00
|
|
|
|
2010-08-27 05:26:27 +00:00
|
|
|
#include "views/dolphinnewfilemenuobserver.h"
|
2007-01-26 00:55:49 +00:00
|
|
|
|
2011-02-04 14:43:21 +00:00
|
|
|
#include <KIO/Job>
|
2007-01-26 00:55:49 +00:00
|
|
|
|
2023-05-12 22:13:39 +00:00
|
|
|
#include <QAction>
|
|
|
|
|
|
|
|
DolphinNewFileMenu::DolphinNewFileMenu(QAction *createDirAction, QObject *parent)
|
2022-10-18 20:38:45 +00:00
|
|
|
: KNewFileMenu(parent)
|
|
|
|
{
|
2023-05-12 22:13:39 +00:00
|
|
|
setNewFolderShortcutAction(createDirAction);
|
2010-08-27 05:26:27 +00:00
|
|
|
DolphinNewFileMenuObserver::instance().attach(this);
|
2007-05-06 17:41:49 +00:00
|
|
|
}
|
2007-01-26 00:55:49 +00:00
|
|
|
|
2010-08-27 05:26:27 +00:00
|
|
|
DolphinNewFileMenu::~DolphinNewFileMenu()
|
2007-05-06 17:41:49 +00:00
|
|
|
{
|
2010-08-27 05:26:27 +00:00
|
|
|
DolphinNewFileMenuObserver::instance().detach(this);
|
2007-05-06 17:41:49 +00:00
|
|
|
}
|
2007-01-26 00:55:49 +00:00
|
|
|
|
2023-02-03 17:14:53 +00:00
|
|
|
void DolphinNewFileMenu::slotResult(KJob *job)
|
2007-01-26 00:55:49 +00:00
|
|
|
{
|
2022-08-24 15:00:01 +00:00
|
|
|
if (job->error() && job->error() != KIO::ERR_USER_CANCELED) {
|
2020-10-23 17:51:33 +00:00
|
|
|
Q_EMIT errorMessage(job->errorString());
|
2007-04-09 19:12:54 +00:00
|
|
|
} else {
|
2010-01-26 12:04:56 +00:00
|
|
|
KNewFileMenu::slotResult(job);
|
2007-01-26 00:55:49 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-04 20:07:48 +00:00
|
|
|
|
|
|
|
#include "moc_dolphinnewfilemenu.cpp"
|