2007-01-26 00:55:49 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Peter Penz *
|
|
|
|
* peter.penz@gmx.at *
|
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
* *
|
|
|
|
* 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 *
|
|
|
|
***************************************************************************/
|
|
|
|
|
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 <KActionCollection>
|
|
|
|
#include <KIO/Job>
|
2007-01-26 00:55:49 +00:00
|
|
|
|
2013-08-16 18:22:33 +00:00
|
|
|
DolphinNewFileMenu::DolphinNewFileMenu(KActionCollection* collection, QObject* parent) :
|
2013-08-28 16:46:45 +00:00
|
|
|
KNewFileMenu(collection, "new_menu", parent)
|
2007-05-06 17:41:49 +00:00
|
|
|
{
|
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
|
|
|
|
2010-08-27 05:26:27 +00:00
|
|
|
void DolphinNewFileMenu::slotResult(KJob* job)
|
2007-01-26 00:55:49 +00:00
|
|
|
{
|
|
|
|
if (job->error()) {
|
2013-08-16 18:22:33 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|