Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/knewfilemenu.h
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 59 | public: | |||
---|---|---|---|---|---|
62 | * @param collection the KActionCollection the QAction with name @p name should be added to. | 62 | * @param collection the KActionCollection the QAction with name @p name should be added to. | ||
63 | * @param name action name, when adding the action to @p collection | 63 | * @param name action name, when adding the action to @p collection | ||
64 | * @param parent the parent object, for ownership. | 64 | * @param parent the parent object, for ownership. | ||
65 | * If the parent object is a widget, it will also used as parent widget | 65 | * If the parent object is a widget, it will also used as parent widget | ||
66 | * for any dialogs that this class might show. Otherwise, call setParentWidget. | 66 | * for any dialogs that this class might show. Otherwise, call setParentWidget. | ||
67 | * @note If you want the "Create directory..." action shortcut to show up next to its text, | 67 | * @note If you want the "Create directory..." action shortcut to show up next to its text, | ||
68 | * make sure to have an action with name "create_dir" (and shortcut set) in @p collection. | 68 | * make sure to have an action with name "create_dir" (and shortcut set) in @p collection. | ||
69 | * This will only work with KIO >= 5.27. | 69 | * This will only work with KIO >= 5.27. | ||
70 | * From KIO >= 5.52, an action named "create_file" (and shortcut set) in @p collection | ||||
71 | * will be linked to the creation of the first file template (either from XDG_TEMPLATES_DIR | ||||
72 | * or from :/kio5/newfile-templates) | ||||
70 | */ | 73 | */ | ||
71 | KNewFileMenu(KActionCollection *collection, const QString &name, QObject *parent); | 74 | KNewFileMenu(KActionCollection *collection, const QString &name, QObject *parent); | ||
72 | 75 | | |||
73 | /** | 76 | /** | ||
74 | * Destructor. | 77 | * Destructor. | ||
75 | * KNewMenu uses internally a globally shared cache, so that multiple instances | 78 | * KNewMenu uses internally a globally shared cache, so that multiple instances | ||
76 | * of it don't need to parse the installed templates multiple times. Therefore | 79 | * of it don't need to parse the installed templates multiple times. Therefore | ||
77 | * you can safely create and delete KNewMenu instances without a performance issue. | 80 | * you can safely create and delete KNewMenu instances without a performance issue. | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 136 | public Q_SLOTS: | |||
143 | * a popupmenu. This is useful to make sure that creating a directory with | 146 | * a popupmenu. This is useful to make sure that creating a directory with | ||
144 | * a key shortcut (e.g. F10) triggers the exact same code as when using | 147 | * a key shortcut (e.g. F10) triggers the exact same code as when using | ||
145 | * the New menu. | 148 | * the New menu. | ||
146 | * Requirements: call setPopupFiles first, and keep this KNewFileMenu instance | 149 | * Requirements: call setPopupFiles first, and keep this KNewFileMenu instance | ||
147 | * alive (the mkdir is async). | 150 | * alive (the mkdir is async). | ||
148 | */ | 151 | */ | ||
149 | void createDirectory(); | 152 | void createDirectory(); | ||
150 | 153 | | |||
154 | /** | ||||
155 | * Call this to create a new file as if the user had done it using | ||||
156 | * a popupmenu. This is useful to make sure that creating a directory with | ||||
157 | * a key shortcut (e.g. Shift-F10) triggers the exact same code as when using | ||||
158 | * the New menu. | ||||
159 | * Requirements: call setPopupFiles first, and keep this KNewFileMenu instance | ||||
160 | * alive (the copy is async). | ||||
161 | * @since 5.52 | ||||
162 | */ | ||||
elvisangelaccio: Missing @since | |||||
163 | void createFile(); | ||||
164 | | ||||
151 | Q_SIGNALS: | 165 | Q_SIGNALS: | ||
152 | /** | 166 | /** | ||
153 | * Emitted once the file (or symlink) @p url has been successfully created | 167 | * Emitted once the file (or symlink) @p url has been successfully created | ||
154 | */ | 168 | */ | ||
155 | void fileCreated(const QUrl &url); | 169 | void fileCreated(const QUrl &url); | ||
156 | 170 | | |||
157 | /** | 171 | /** | ||
158 | * Emitted once the directory @p url has been successfully created | 172 | * Emitted once the directory @p url has been successfully created | ||
Show All 31 Lines |
Missing @since