Changeset View
Changeset View
Standalone View
Standalone View
krusader/MountMan/kmountman.h
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
54 | { | 54 | { | ||
55 | Q_OBJECT | 55 | Q_OBJECT | ||
56 | friend class KMountManGUI; | 56 | friend class KMountManGUI; | ||
57 | 57 | | |||
58 | public: | 58 | public: | ||
59 | enum mntStatus {DOESNT_EXIST, NOT_MOUNTED, MOUNTED}; | 59 | enum mntStatus {DOESNT_EXIST, NOT_MOUNTED, MOUNTED}; | ||
60 | 60 | | |||
61 | inline bool operational() { | 61 | inline bool operational() { | ||
62 | return Operational; | 62 | return _operational; | ||
63 | } // check this 1st | 63 | } // check this 1st | ||
64 | 64 | | |||
65 | void mount(QString mntPoint, bool blocking = true); // this is probably what you need for mount | 65 | void mount(QString mntPoint, bool blocking = true); // this is probably what you need for mount | ||
66 | void unmount(QString mntPoint, bool blocking = true); // this is probably what you need for unmount | 66 | void unmount(QString mntPoint, bool blocking = true); // this is probably what you need for unmount | ||
67 | mntStatus getStatus(QString mntPoint); // return the status of a mntPoint (if any) | 67 | mntStatus getStatus(QString mntPoint); // return the status of a mntPoint (if any) | ||
68 | void eject(QString mntPoint); | 68 | void eject(QString mntPoint); | ||
69 | bool ejectable(QString path); | 69 | bool ejectable(QString path); | ||
70 | bool removable(QString path); | 70 | bool removable(QString path); | ||
Show All 11 Lines | |||||
82 | 82 | | |||
83 | // NOTE: this function needs some time (~50msec) | 83 | // NOTE: this function needs some time (~50msec) | ||
84 | QString findUdiForPath(QString path, const Solid::DeviceInterface::Type &expType = Solid::DeviceInterface::Unknown); | 84 | QString findUdiForPath(QString path, const Solid::DeviceInterface::Type &expType = Solid::DeviceInterface::Unknown); | ||
85 | QString pathForUdi(QString udi); | 85 | QString pathForUdi(QString udi); | ||
86 | 86 | | |||
87 | public slots: | 87 | public slots: | ||
88 | void mainWindow(); // opens up the GUI | 88 | void mainWindow(); // opens up the GUI | ||
89 | void autoMount(QString path); // just call it before refreshing into a dir | 89 | void autoMount(QString path); // just call it before refreshing into a dir | ||
90 | void delayedPerformAction(QAction *); | 90 | void delayedPerformAction(const QAction *action); | ||
91 | void performAction(); | | |||
92 | void quickList(); | 91 | void quickList(); | ||
93 | 92 | | |||
94 | protected slots: | 93 | protected slots: | ||
95 | void jobResult(KJob *job); | 94 | void jobResult(KJob *job); | ||
96 | void slotTeardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi); | 95 | void slotTeardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi); | ||
97 | void slotSetupDone(Solid::ErrorType error, QVariant errorData, const QString &udi); | 96 | void slotSetupDone(Solid::ErrorType error, QVariant errorData, const QString &udi); | ||
98 | 97 | | |||
99 | protected: | 98 | protected: | ||
100 | // used internally | 99 | // used internally | ||
101 | static QExplicitlySharedDataPointer<KMountPoint> findInListByMntPoint(KMountPoint::List &lst, QString value); | 100 | static QExplicitlySharedDataPointer<KMountPoint> findInListByMntPoint(KMountPoint::List &lst, QString value); | ||
102 | void toggleMount(QString mntPoint); | 101 | void toggleMount(QString mntPoint); | ||
103 | void emitRefreshPanel(const QUrl &url) { | 102 | void emitRefreshPanel(const QUrl &url) { | ||
104 | emit refreshPanel(url); | 103 | emit refreshPanel(url); | ||
105 | } | 104 | } | ||
106 | 105 | | |||
107 | signals: | 106 | signals: | ||
108 | void refreshPanel(const QUrl &); | 107 | void refreshPanel(const QUrl &); | ||
109 | 108 | | |||
110 | private: | 109 | private: | ||
111 | QString *_actions; | 110 | enum ActionType { Mount, Unmount }; | ||
111 | | ||||
112 | KToolBarPopupAction *_action; | 112 | KToolBarPopupAction *_action; | ||
113 | QAction *_manageAction; | ||||
113 | 114 | | |||
114 | bool Operational; // if false, something went terribly wrong on startup | 115 | bool _operational; // if false, something went terribly wrong on startup | ||
115 | bool waiting; // used to block krusader while waiting for (un)mount operation | 116 | bool waiting; // used to block krusader while waiting for (un)mount operation | ||
116 | KMountManGUI *mountManGui; | 117 | KMountManGUI *mountManGui; | ||
117 | // the following is the FS type | 118 | // the following is the FS type | ||
118 | QStringList invalid_fs; | 119 | QStringList invalid_fs; | ||
119 | QStringList nonmount_fs; | 120 | QStringList nonmount_fs; | ||
120 | QStringList network_fs; | 121 | QStringList network_fs; | ||
121 | // the following is the FS name | 122 | // the following is the FS name | ||
122 | QStringList nonmount_fs_mntpoint; | 123 | QStringList nonmount_fs_mntpoint; | ||
123 | QPointer<QWidget> parentWindow; | 124 | QPointer<QWidget> parentWindow; | ||
124 | }; | 125 | }; | ||
125 | 126 | | |||
126 | #endif | 127 | #endif |