]>
cloud.milkyroute.net Git - dolphin.git/blob - src/panels/places/placespanel.cpp
1 /***************************************************************************
2 * Copyright (C) 2008 by Peter Penz <peter.penz19@gmail.com> *
3 * Copyright (C) 2010 by Christian Muehlhaeuser <muesli@gmail.com> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
21 #include "placespanel.h"
24 #include <konq_operations.h>
25 #include <views/draganddrophelper.h>
27 PlacesPanel::PlacesPanel(QWidget
* parent
) :
28 KFilePlacesView(parent
),
29 m_mouseButtons(Qt::NoButton
)
31 setDropOnPlaceEnabled(true);
32 connect(this, SIGNAL(urlsDropped(KUrl
,QDropEvent
*,QWidget
*)),
33 this, SLOT(slotUrlsDropped(KUrl
,QDropEvent
*,QWidget
*)));
34 connect(this, SIGNAL(urlChanged(KUrl
)),
35 this, SLOT(emitExtendedUrlChangedSignal(KUrl
)));
38 PlacesPanel::~PlacesPanel()
42 void PlacesPanel::mousePressEvent(QMouseEvent
* event
)
44 m_mouseButtons
= event
->buttons();
45 KFilePlacesView::mousePressEvent(event
);
48 void PlacesPanel::slotUrlsDropped(const KUrl
& dest
, QDropEvent
* event
, QWidget
* parent
)
51 const KFileItem
destItem(KFileItem::Unknown
, KFileItem::Unknown
, dest
);
52 DragAndDropHelper::dropUrls(destItem
, event
);
55 void PlacesPanel::emitExtendedUrlChangedSignal(const KUrl
& url
)
57 emit
urlChanged(url
, m_mouseButtons
);
60 #include "placespanel.moc"