]>
cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinpart.cpp
1 /* This file is part of the KDE project
2 Copyright (c) 2007 David Faure <faure@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #include "dolphinpart.h"
21 #include <kparts/genericfactory.h>
22 #include "dolphinview.h"
23 #include "dolphinsortfilterproxymodel.h"
24 #include <kdirmodel.h>
25 #include <kdirlister.h>
27 typedef KParts::GenericFactory
<DolphinPart
> DolphinPartFactory
;
28 K_EXPORT_COMPONENT_FACTORY(dolphinpart
, DolphinPartFactory
)
30 DolphinPart::DolphinPart(QWidget
* parentWidget
, QObject
* parent
, const QStringList
& args
)
31 : KParts::ReadOnlyPart(parent
)
34 setComponentData( DolphinPartFactory::componentData() );
35 //setBrowserExtension( new DolphinPartBrowserExtension( this ) );
37 m_dirLister
= new KDirLister
;
38 m_dirLister
->setAutoUpdate(true);
39 m_dirLister
->setMainWindow(parentWidget
->topLevelWidget());
40 m_dirLister
->setDelayedMimeTypes(true);
42 m_dirModel
= new KDirModel(this);
43 m_dirModel
->setDirLister(m_dirLister
);
45 m_proxyModel
= new DolphinSortFilterProxyModel(this);
46 m_proxyModel
->setSourceModel(m_dirModel
);
48 m_view
= new DolphinView(parentWidget
,
56 DolphinPart::~DolphinPart()
61 KAboutData
* DolphinPart::createAboutData()
63 return new KAboutData("dolphinpart", 0, ki18n( "Dolphin Part" ), "0.1");
66 bool DolphinPart::openUrl(const KUrl
& url
)
72 #include "dolphinpart.moc"