]> cloud.milkyroute.net Git - dolphin.git/blob - src/settings/trashsettingspage.cpp
Fix temporary regression of sorting introduced by SVN commit 1126410
[dolphin.git] / src / settings / trashsettingspage.cpp
1 /***************************************************************************
2 * Copyright (C) 2009 by Shaun Reich shaun.reich@kdemail.net *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program 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 *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
19
20 //Own
21 #include "trashsettingspage.h"
22 #include "dolphinsettings.h"
23 //KDE
24 #include <KCModuleProxy>
25 #include <kdialog.h>
26 #include <kvbox.h>
27 //Qt
28 #include <QVBoxLayout>
29
30
31 TrashSettingsPage::TrashSettingsPage(QWidget* parent) :
32 SettingsPageBase(parent)
33 {
34 const int spacing = KDialog::spacingHint();
35
36 QVBoxLayout* topLayout = new QVBoxLayout(this);
37 KVBox* vBox = new KVBox(this);
38 vBox->setSpacing(spacing);
39
40 m_proxy = new KCModuleProxy("kcmtrash");
41 connect(m_proxy, SIGNAL(changed(bool)), this, SIGNAL(changed()));
42 topLayout->addWidget(m_proxy);
43
44 // Add a dummy widget with no restriction regarding
45 // a vertical resizing. This assures that the dialog layout
46 // is not stretched vertically.
47 new QWidget(vBox);
48 topLayout->addWidget(vBox);
49
50 loadSettings();
51 }
52
53 TrashSettingsPage::~TrashSettingsPage()
54 {
55 }
56
57 void TrashSettingsPage::applySettings()
58 {
59 m_proxy->save();
60 }
61
62 void TrashSettingsPage::restoreDefaults()
63 {
64 m_proxy->defaults();
65 }
66
67 void TrashSettingsPage::loadSettings()
68 {
69 m_proxy->load();
70 }
71
72 #include "trashsettingspage.moc"