]> cloud.milkyroute.net Git - dolphin.git/blob - src/panels/panel.cpp
DolphinView: display errorMessage when copy errors occurs
[dolphin.git] / src / panels / panel.cpp
1 /*
2 * SPDX-FileCopyrightText: 2006 Cvetoslav Ludmiloff <ludmiloff@gmail.com>
3 * SPDX-FileCopyrightText: 2006-2010 Peter Penz <peter.penz19@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8 #include "panel.h"
9
10 Panel::Panel(QWidget *parent)
11 : QWidget(parent)
12 , m_url()
13 , m_customContextMenuActions()
14 {
15 }
16
17 Panel::~Panel()
18 {
19 }
20
21 QUrl Panel::url() const
22 {
23 return m_url;
24 }
25
26 void Panel::setCustomContextMenuActions(const QList<QAction *> &actions)
27 {
28 m_customContextMenuActions = actions;
29 }
30
31 QList<QAction *> Panel::customContextMenuActions() const
32 {
33 return m_customContextMenuActions;
34 }
35
36 QSize Panel::sizeHint() const
37 {
38 // The size hint will be requested already when starting Dolphin even
39 // if the panel is invisible. For performance reasons most panels delay
40 // the creation and initialization of widgets until a showEvent() is called.
41 // Because of this the size-hint of the embedded widgets cannot be used
42 // and a default size is provided:
43 return QSize(180, 180);
44 }
45
46 void Panel::setUrl(const QUrl &url)
47 {
48 if (url.matches(m_url, QUrl::StripTrailingSlash)) {
49 return;
50 }
51
52 const QUrl oldUrl = m_url;
53 m_url = url;
54 if (!urlChanged()) {
55 m_url = oldUrl;
56 }
57 }
58
59 void Panel::readSettings()
60 {
61 }
62
63 #include "moc_panel.cpp"