Fix crash if key bindings specified in profile cannot be found. Improve
[personal-kdebase.git] / apps / lib / konq / konq_copytomenu_p.h
blobd355d765beb4ed832d535dc6bf96089e69bf4754
1 /* This file is part of the KDE project
3 Copyright 2008 David Faure <faure@kde.org>
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Library General Public License as published
7 by the Free Software Foundation; either version 2 of the License or
8 ( at your option ) version 3 or, at the discretion of KDE e.V.
9 ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #include <kconfiggroup.h>
23 #include <kmenu.h>
24 #include <QActionGroup>
25 #include <QObject>
26 #include <kurl.h>
28 class KonqCopyToMenuPrivate : public QObject
30 Q_OBJECT
31 public:
32 KonqCopyToMenuPrivate();
34 public:
35 KUrl::List m_urls;
36 bool m_readOnly;
39 enum MenuType { Copy, Move };
41 // The main menu, shown when opening "Copy To" or "Move To"
42 // It contains Home Folder, Root Folder, Browse, and recent destinations
43 class KonqCopyToMainMenu : public KMenu
45 Q_OBJECT
46 public:
47 KonqCopyToMainMenu(QMenu* parent, KonqCopyToMenuPrivate* d, MenuType menuType);
49 QActionGroup& actionGroup() { return m_actionGroup; } // used by submenus
50 MenuType menuType() const { return m_menuType; } // used by submenus
52 private Q_SLOTS:
53 void slotAboutToShow();
54 void slotBrowse();
55 void slotTriggered(QAction* action);
57 private:
58 void copyOrMoveTo(const KUrl& dest);
60 private:
61 MenuType m_menuType;
62 QActionGroup m_actionGroup;
63 KonqCopyToMenuPrivate* d; // this isn't our own d pointer, it's the one for the public class
64 KConfigGroup m_recentDirsGroup;
67 // The menu that lists a directory
68 class KonqCopyToDirectoryMenu : public KMenu
70 Q_OBJECT
71 public:
72 KonqCopyToDirectoryMenu(QMenu* parent, KonqCopyToMainMenu* mainMenu, const QString& path);
74 private Q_SLOTS:
75 void slotAboutToShow();
77 private:
78 KonqCopyToMainMenu* m_mainMenu;
79 QString m_path;